Pyobjc

Latest version: v11.0

Safety actively analyzes 702323 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 9 of 18

4.0

-----------

* :issue:`204`: Metadata for CGPDFDictionaryGetObject was wrong

Reported by Nickolas Pohilets.

* Updated metadata for Xcode 9 GM.

* :issue:`202`: Add bindings for ``CGPDFDictionaryRef``, ``CGPDFScannerRef``
``CGPDFStreamRef`` and ``CGPDFStringRef`` to the Quartz bindings (including
some minor updates to function metadata)

Reported by Nickolas Pohilets.

* :issue:`205`: Add ability to read bytes from ``objc.varlist``

Instances of ``objc.varlist`` now have a method to return a memoryview
that refers to the first section of the list::

def as_buffer(self, count : int) -> memoryview

This returns a memoryview the references the underlying memory for
the first *count* elements in the list.

Reported by Nickolas Pohilets.

* Added bindings for the :doc:`GameKit </apinotes/GameKit>` framework introduced in macOS 10.8.

* Added bindings for the :doc:`GameplayKit </apinotes/GameplayKit>` framework introduced in macOS 10.11.

Note that these bindings are less useful than they could be because
PyObjC currently does not support "vector" types that are used in
some APIs.

4.0b1

-------------

* Removed PyObjCTools.TestSupport.filterWarnings, use warnings.catch_warnings
instead.

* Building pyobjc-core using "python setup.py develop" will use 'ccache'
when available.

* Building pyobjc-core will compile the source files from new to old files,
to speed up feedback while working on the source code.

* Legacy BridgeSupport files on macOS 10.13 (which aren't used by default
by PyObjC) can contain junk data in typestring data. Cleanup that data
before using it.

* Deal with loading bundle variables of a C string type, that used to crash
to do an oddity of locating that information.

* Using wrappers for C structs as sequences is deprecated, this
feature was introduced a long while ago when the framework wrappers
were very incomplete and is no longer useful.

* Add ``objc.options.structs_indexable``. When this option is True
(the default) wrappers for C structs behave as before, when the
option is False these wrappers can no longer be used as writable
tuples, that is all "sequence" methods will raise ``TypeError``.

* Add ``objc.options.structs_writable``. When this option is True
(the default) wrappers for C structs behave as before, when the
option is False these wrappers can no longer be modified.

* Add availability macro ``MAC_OS_X_VERSION_10_13`` to ``objc``.

* New framework wrappers:

- :doc:`ColorSync </apinotes/ColorSync>` (new in macOS 10.13)
- :doc:`CoreML </apinotes/CoreML>` (new in macOS 10.13)
- :doc:`ExternalAccessory </apinotes/ExternalAccessory>` (new in macOS 10.13)
- :doc:`CoreSpotlight </apinotes/CoreSpotlight>` (new in macOS 10.13)
- :doc:`Vision </apinotes/Vision>` (new in macOS 10.13)

* metadata updates:

- :doc:`Accounts </apinotes/Accounts>`
- :doc:`AddressBook </apinotes/AddressBook>`
- :doc:`AppKit </apinotes/AppKit>`
- :doc:`ApplicationServices </apinotes/ApplicationServices>`
- :doc:`Automator </apinotes/Automator>`
- :doc:`AVKit </apinotes/AVKit>`
- :doc:`CalendarStore </apinotes/CalendarStore>`
- :doc:`CFNetwork </apinotes/CFNetwork>`
- :doc:`CloudKit </apinotes/CloudKit>`
- :doc:`Contacts </apinotes/Contacts>`
- :doc:`CoreBluetooth </apinotes/CoreBluetooth>`
- :doc:`CoreData </apinotes/CoreData>`
- :doc:`CoreFoundation </apinotes/CoreFoundation>`
- :doc:`CoreGraphics </apinotes/CoreGraphics>`
- :doc:`CoreImage </apinotes/CoreImage>`
- :doc:`CoreLocation </apinotes/CoreLocation>`
- :doc:`CoreServices </apinotes/CoreServices>`
- :doc:`CoreText </apinotes/CoreText>`
- :doc:`CoreVideo </apinotes/CoreVideo>`
- :doc:`CoreWLAN </apinotes/CoreWLAN>`
- :doc:`CryptoTokenKit </apinotes/CryptoTokenKit>`
- :doc:`EventKit </apinotes/EventKit>`
- :doc:`FinderSync </apinotes/FinderSync>`
- :doc:`Foundation </apinotes/Foundation>`
- :doc:`FSEvents </apinotes/FSEvents>`
- :doc:`GameController </apinotes/GameController>`
- IMServicePlugIn
- :doc:`ImageCaptureCore </apinotes/ImageCaptureCore>`
- :doc:`ImageIO </apinotes/ImageIO>`
- :doc:`Intents </apinotes/Intents>`
- :doc:`IOSurface </apinotes/IOSurface>`
- :doc:`JavaScriptCore </apinotes/JavaScriptCore>`
- :doc:`LocalAuthentication </apinotes/LocalAuthentication>`
- :doc:`MapKit </apinotes/MapKit>`
- :doc:`MediaLibrary </apinotes/MediaLibrary>`
- :doc:`MediaPlayer </apinotes/MediaPlayer>`
- :doc:`ModelIO </apinotes/ModelIO>`
- :doc:`MultipeerConnectivity </apinotes/MultipeerConnectivity>`
- :doc:`NetFS </apinotes/NetFS>`
- :doc:`NetworkExtension </apinotes/NetworkExtension>`
- :doc:`OpenDirectory </apinotes/OpenDirectory>`
- :doc:`Photos </apinotes/Photos>`
- :doc:`PhotosUI </apinotes/PhotosUI>`
- QTKit
- :doc:`Quartz </apinotes/Quartz>`
- :doc:`QuartzCore </apinotes/QuartzCore>`
- :doc:`QuickLook </apinotes/QuickLook>`
- :doc:`SafariServices </apinotes/SafariServices>`
- :doc:`SceneKit </apinotes/SceneKit>`
- :doc:`ScreenSaver </apinotes/ScreenSaver>`
- :doc:`Social </apinotes/Social>`
- :doc:`SpriteKit </apinotes/SpriteKit>`
- :doc:`SystemConfiguration </apinotes/SystemConfiguration>`
- :doc:`WebKit </apinotes/WebKit>`

3.3

-----------

New features:

* :issue:`15`: Fix crash when handling stack blocks

Patch by Max Bélanger. Fixes a crash when a stackbased block is passed
into python.

Later updated with tests and a different implementation.

* :issue:`192`: 32/64-bit issue with AppHelper.endSheetMethod

This helper decorator used the wrong signature string, which happens to
work on 32-bit systems but not on 64-bit ones.

* "pip install pyobjc" should now fail with a better error message when
installing on a system that isn't running macOS.

* Updated framework wrappers for the API changes in the SDK shipped with
Xcode 8.3.2.

* Added new framework wrapper: "pyobjc-framework-CoreServices".

This exposes no new functionality for now, but makes it possible to access
the functionality exposed by the "CoreServices" framework by using "import
CoreServices", instead of directly importing the name of the subframework.

* Added new framework wrapper: "pyobjc-framework-iTunesLibrary"

This is a wrapper for the iTunesLibrary framework located in
"/Library/Frameworks", which is a framework installed by iTunes that
can be used to (read-only) access information about an iTunes library.

* :issue:`178`: Add basic example for the Contacts framework

The Contacts framework now contains a very simple example that shows how
to fetch contacts from the contact store. Apple's documentation on
the framework contains more comprehensive sample code, which should make
it clear how to use the framework.

* Add initial support for deprecation warnings in metadata

Metadata files can now contain information for deprecation warnings for
methods and functions. Users can turn on deprecation warnings using::

import objc
objc.deprecation_warnings = objc.MAC_OS_X_VERSION_10_6

This will emit deprecation warnings for APIs that were deprecated in
macOS 10.6 (or earlier).

Note that this version does have metadata that uses the new functionality,
that will be added in a future release.

Bugfixes:

* The OC_Python* Objective-C classes used to expose Python objects to
Objective-C don't support secure coding, added a
"supportsSecureCoding" implementation to make this explicit.

* :issue:`182`: The block signature registered in the ObjC runtime
datastructures for Python blocks was wrong, which confuses Objective-C
code that looks at the runtime data.

* Fix requirement info in Collaboration setup.py.

Patch by Alex Chekunkov.

* :issue:`189`: Invalid invocation of "atos" command on recent macOS versions

The Objective-C exception logging code in pyobjc-framework-ExceptionHandling
calls out to the "atos" command to get readable stack traces, that
invocation caused problems on recent macOS versions.

3.2.2

-------------

Bugfixes:

* :issue:`162`: Fix conversion of unicode python string to Objective-C "UniChar"
array, it used to do the wrong thing when converting characters outside of
the BMP.

Fix by Ted Morin and Benoit Pierre.

3.2.1

-------------

Updates:

* Small change to the shared setup.py code for framework wrappers to allow
building wheels for wrappers without a C exention on any system.

This was mostly done to make it easier to provide wheels in future releases.

Bugfixes:

* Avoid build error with Python 2.7 when using the OSX 10.12 SDK, triggered
when Python was build using MacPython support.

* Compatibility definitions for MAC_OS_X_VERSION_10_10, MAC_OS_X_VERSION_10_11
and MAC_OS_X_VERSION_10_12 were wrong, adjusted these.

* Fix obscure crash in test suite of pyobjc-core: the definition of a class
that claims to conform to a protocol but didn't actually conform could
result in having a partial class definition in the Objective-C runtime.

* Updated implementation for ``NSMutableArray.extend``. This both avoids an
error with the list interface tests in Python 3.6, and avoids unnecessary
memory usage with large arguments.

3.2

-----------

**Backward compatibility note:** Due to a change in the way the default
method signature is calculated PyObjC is now more strict in enforcing
the Python<->Objective-C mapping for selectors and a number of code patterns
that were allowed before are no longer allowed, in particular the following
method definitions raise ``objc.BadPrototypeError``::

class MyObject (NSObject):
def mymethod(self, a, b): ...
def method_arg_(self, a, b, c): ...

If these methods are only used from Python and are never used from Objective-C
the error can be avoided by decorating these methods with ``objc.python_method``::

class MyObject (NSObject):
objc.python_method
def mymethod(self, a, b): ...

This cannot be used for methods used from Objective-C, for those you will
have to rename the method or you will have to provide an appropriate selector
explicitly.

* Fix crash when using some APIs in the LaunchServices framework.

* :issue:`100`: Building with the Command Line Tools for Xcode installed caused build errors
on OSX 10.10

* Python 3.6 made a change to the bytecode format that affected the way
PyObjC calculates the default method signature for Python methods.

Earlier versions of PyObjC will therefore not work properly with Python 3.6.

* Update metadata for macOS 10.12.1

Note: Building PyObjC on macOS 10.12 requires Xcode 8.1 (or a later version)

* Added bindings for the SafariServices and Intents frameworks, both introduced in macOS 10.12.

* Added bindings for the MediaPlayer framework, introduced in macOS 10.12.1.

* Add bindings for the ModelIO framework, introduced in OSX 10.11.

* :issue:`153`: Add missing metadata file to ApplicationServices bindings

* :issue:`157`: Bad reference to "_metadata" in ApplicationServices bindings

* ApplicationServices framework didn't do "from ... import \*" as was intended.

* Don't force the installation of py2app.

* Fix build failure using the OSX 10.10 SDK.

* :issue:`21`: Tweak build procedure for PyObjC to avoid building pyobjc-core
multiple times when using ``pip install pyobjc``.

* :issue:`123`: Use Twisted's cfreactor module in the examples using Twisted.

* :issue:`148`: Fix build issue for the MapKit bindings on a case
sensitive filesystem.

* Added bindings for the IOSurface framework (pyobjc-framework-IOSurface)

* Added bindings for the NetworkExtension framework (pyobjc-framework-NetworkExtension)

* :issue:`149`: Fix compile problems with Anaconda

* Fix SystemError for accessing a method whose ``__metadata__`` cannot be calculated,
found while researching issue :issue:`122`.

* :issue:`146`: Don't hang when running ``python setup.py build`` using PyPy.

Note that PyPy still doesn't work, this just ensures that the build fails instead
of hanging indefinely.

* :issue:`143`: Fix calculation of default type signature for selectors

Due to this change it is possible to use decorators like this:

.. sourcecode:: python

def decorator(func):
functools.wraps(func)
def wrapper(*args, **kwds):
return func(*args, **kwds)
return decorator

Before this patch PyObjC gave an error due to the signature of ``wrapper``,
and if ``wrapper`` was defined with an explicit ``self`` argument PyObjC would
not give an error but would calculate the wrong method signature for wrapped
methods.

An unfortunate side effect of this change is that the argument count
of methods must now match the implied argument count of the selector, that is
a method with name ``someMethod_`` must now have exactly two arguments (``self``
and the argument implied by the underscore at the end).

Use ``objc.python_method`` as a decorator for python methods that don't use
this convention and do no need to be registered with the Objective-C runtime
as Objective-C selectors.

* The bridge now considers the default arguments for a function when determining
if the Python signature of a function is compatible with the Objective-C
signature, that is the following method definition is valid::

class MyObject (NSObject):
def someMethod_(self, a, b=2): pass

* The default selector calculated for Python methods with embedded underscores and
without a closing underscore has changed, the embedded underscores are not translated
to colons because the resulting Objective-C selector would not be valid.

That is, in earlier versions the default selector for "some_method" would be
"some:method", and from this version on the default for selector for this
method is "some_method".

* (Python 3) Methods and functions with keyword-only arguments that don't have defaults
cause a ``objc.BadPrototypeError`` exception when proxied to Objective-C
because those can never be called from Objective-C without causing an
exception.

Page 9 of 18

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.