{"id":6146,"library":"pyobjc-framework-netfs","title":"PyObjC NetFS Framework","description":"PyObjC-framework-NetFS provides Python wrappers for the NetFS framework on macOS, enabling Python scripts to interact with macOS's network file system APIs. It is part of the larger PyObjC project, which bridges Python and Objective-C to facilitate macOS application development. The library is actively maintained, with version 12.1 currently available, and releases often align with macOS SDK updates.","status":"active","version":"12.1","language":"en","source_language":"en","source_url":"https://github.com/ronaldoussoren/pyobjc","tags":["macos","objc","framework","netfs","apple","network"],"install":[{"cmd":"pip install pyobjc-framework-netfs","lang":"bash","label":"Install pyobjc-framework-netfs"}],"dependencies":[{"reason":"Provides the core bridge between Python and Objective-C, essential for all PyObjC framework wrappers.","package":"pyobjc-core"},{"reason":"Requires Python version >=3.10.","package":"python"}],"imports":[{"note":"Framework classes, functions, and constants are available directly under the imported framework module.","symbol":"NetFS","correct":"import NetFS"}],"quickstart":{"code":"import NetFS\nfrom Foundation import NSObject\n\n# The NetFS framework provides APIs for managing network file system mounts.\n# To use specific classes, refer to Apple's NetFS documentation.\n# For example, checking for a common class:\n\nif hasattr(NetFS, 'NetFSMountSession'):\n    print('NetFSMountSession class is available.')\nelse:\n    print('NetFSMountSession class not found.')\n\n# This example just demonstrates loading the framework and checking for a symbol.\n# Real-world usage would involve creating instances and calling methods.\n# For example, to instantiate a dummy NSObject (part of Foundation, often used with Cocoa):\nobj = NSObject.alloc().init()\nprint(f'Created an NSObject: {obj}')","lang":"python","description":"This quickstart demonstrates how to import the `NetFS` framework and verify the availability of a representative class within it. PyObjC framework wrappers typically expose Objective-C classes, functions, and constants directly under the imported module. Detailed usage requires consulting Apple's official NetFS framework documentation."},"warnings":[{"fix":"Upgrade your Python interpreter to version 3.10 or newer.","message":"Python 3.9 support was dropped with PyObjC 12.0. Python 3.8 support was dropped with PyObjC 11.0. Ensure your Python environment is 3.10 or newer.","severity":"breaking","affected_versions":"11.0, 12.0 and later"},{"fix":"Review code that interacts with Objective-C initializer methods, particularly custom Python subclasses, to ensure correct reference handling, especially if upgrading from pre-11.1 versions.","message":"PyObjC 11.1 introduced significant changes in how it models Objective-C initializer methods (methods in the 'init' family) to align with `clang`'s Automatic Reference Counting (ARC) documentation. These methods now correctly steal a reference to `self` and return a new one.","severity":"breaking","affected_versions":"11.1 and later"},{"fix":"If encountering issues with `__init__` not being called, especially when subclassing Objective-C classes, consider implementing `__new__` in your Python class or using alternative initialization patterns compatible with PyObjC's object creation lifecycle.","message":"PyObjC 10.3 temporarily broke the ability to use `__init__` in Python classes that subclass Objective-C classes (when `__new__` was not user-implemented). While 10.3.1 partially restored this for classes with user-implemented `__new__`, code relying on PyObjC's provided `__new__` still cannot use `__init__` for initialization.","severity":"gotcha","affected_versions":"10.3, 10.3.1 and later"},{"fix":"Always use the latest macOS SDK (usually with Xcode or Command Line Tools) when building PyObjC from source. If using pre-built wheels, ensure they are compatible with your macOS version and Python architecture.","message":"PyObjC frequently updates its framework bindings for new macOS SDK versions. Building PyObjC from source or with specific extensions using an older SDK than the target macOS or the PyObjC release was built against can lead to compilation and runtime errors.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Avoid direct Python subclassing of Cocoa string classes. If you need string-like behavior, wrap the Cocoa string object or use standard Python strings.","message":"Subclassing Cocoa string classes (e.g., NSString) directly in Python with PyObjC is not supported and will result in crashes due to special handling of these types within the bridge.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Proceed with caution when using PyObjC in a free-threaded Python environment. Consult PyObjC documentation for the latest status and any specific guidelines for free-threading support.","message":"While PyObjC 11.0 introduced experimental support for free-threading (PEP 703) with Python 3.13, this is an advanced feature and earlier versions (e.g., 10.3) explicitly stated lack of support. Users experimenting with free-threading should be aware of potential instabilities or limitations.","severity":"gotcha","affected_versions":"10.3, 11.0 and later (Python 3.13+)"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z","problems":[]}