Skip to content

autoclass('NSString', ... ) => 'TypeError: expected bytes, str found' #76

@HeRo002

Description

@HeRo002

After converting the Print() statements in https://github.com/kivy/pyobjus/blob/master/examples/using_autoclass.py from Python2 to Python3 I deployed it on the iPhone 7 simulator in Xcode ver. 12.4 on MacOS Catalina ver. 10.15.7. The first few statements work fine, but line 17:

NSString = autoclass('NSString', load_class_methods=['alloc'], load_instance_methods=['init', 'initWithString:', 'UTF8String'])

results in this error:

Traceback (most recent call last):
  File "/Users/henrik/pyobjus-original-example-ny-ios/YourApp/main.py", line 17, in <module>
  File "pyobjus/pyobjus.pyx", line 719, in pyobjus.pyobjus.autoclass
  File "pyobjus/pyobjus.pyx", line 556, in pyobjus.pyobjus.class_get_partial_methods
TypeError: expected bytes, str found
2021-03-19 20:57:08.013155+0100 pyobjus-original-example-ny[12926:512737] Application quit abnormally!
2021-03-19 20:57:08.021033+0100 pyobjus-original-example-ny[12926:512737] Leaving

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions