Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError in type_enc.pxi #21

Open
cbenhagen opened this issue Dec 9, 2015 · 6 comments
Open

IndexError in type_enc.pxi #21

cbenhagen opened this issue Dec 9, 2015 · 6 comments

Comments

@cbenhagen
Copy link

cbenhagen commented Dec 9, 2015

On OS X Yosemite using a PyInstaller packaged app looking like this:

#!/usr/bin/env python
from plyer import filechooser

print(filechooser.choose_dir())

I get:

Traceback (most recent call last):
  File "<string>", line 4, in <module>
  File "/usr/local/lib/python2.7/site-packages/plyer/facades/filechooser.py", line 53, in choose_dir
  File "/usr/local/lib/python2.7/site-packages/plyer/platforms/macosx/filechooser.py", line 104, in _file_selection_dialog
  File "/usr/local/lib/python2.7/site-packages/plyer/platforms/macosx/filechooser.py", line 48, in run
  File "pyobjus.pyx", line 439, in pyobjus.ObjcMethod.__call__ (pyobjus/pyobjus.c:31580)
  File "pyobjus_conversions.pxi", line 239, in pyobjus.convert_cy_ret_to_py (pyobjus/pyobjus.c:20238)
  File "pyobjus_conversions.pxi", line 180, in pyobjus.convert_to_cy_cls_instance (pyobjus/pyobjus.c:19322)
  File "pyobjus.pyx", line 669, in pyobjus.autoclass (pyobjus/pyobjus.c:34152)
  File "pyobjus.pyx", line 482, in pyobjus.class_get_methods (pyobjus/pyobjus.c:32077)
  File "pyobjus.pyx", line 474, in pyobjus.objc_method_to_py (pyobjus/pyobjus.c:31931)
  File "pyobjus.pyx", line 181, in pyobjus.ObjcMethod.__init__ (pyobjus/pyobjus.c:28225)
  File "type_enc.pxi", line 15, in pyobjus.parse_signature (pyobjus/pyobjus.c:4228)
  File "type_enc.pxi", line 4, in pyobjus.seperate_encoding (pyobjus/pyobjus.c:3999)
IndexError: list index out of range

Did I maybe miss to package a library?

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/28985982-indexerror-in-type_enc-pxi?utm_campaign=plugin&utm_content=tracker%2F77137&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F77137&utm_medium=issues&utm_source=github).
@cbenhagen
Copy link
Author

This is the package:
https://www.dropbox.com/s/eb4a6pygjkrv67d/fc.zip?dl=1

@cbenhagen
Copy link
Author

I just ran in to the same issue when using pyobjus together with rumps (no PyInstaller involved):

import rumps
from pyobjus import autoclass

NSString = autoclass('NSString')
text = NSString.alloc().initWithUTF8String_('Hello world')
print text.UTF8String()
  File "./issue-21.py", line 6, in <module>
    text = NSString.alloc().initWithUTF8String_('Hello world')
  File "pyobjus/pyobjus.pyx", line 439, in pyobjus.ObjcMethod.__call__ (pyobjus/pyobjus.c:33943)
  File "pyobjus/pyobjus_conversions.pxi", line 239, in pyobjus.convert_cy_ret_to_py (pyobjus/pyobjus.c:21592)
  File "pyobjus/pyobjus_conversions.pxi", line 180, in pyobjus.convert_to_cy_cls_instance (pyobjus/pyobjus.c:20519)
  File "pyobjus/pyobjus.pyx", line 670, in pyobjus.autoclass (pyobjus/pyobjus.c:36636)
  File "pyobjus/pyobjus.pyx", line 566, in pyobjus.resolve_super_class_methods (pyobjus/pyobjus.c:35260)
  File "pyobjus/pyobjus.pyx", line 482, in pyobjus.class_get_methods (pyobjus/pyobjus.c:34441)
  File "pyobjus/pyobjus.pyx", line 474, in pyobjus.objc_method_to_py (pyobjus/pyobjus.c:34298)
  File "pyobjus/pyobjus.pyx", line 181, in pyobjus.ObjcMethod.__init__ (pyobjus/pyobjus.c:30407)
  File "pyobjus/type_enc.pxi", line 15, in pyobjus.parse_signature (pyobjus/pyobjus.c:4441)
  File "pyobjus/type_enc.pxi", line 4, in pyobjus.seperate_encoding (pyobjus/pyobjus.c:4210)
IndexError: list index out of range

@hackalog
Copy link
Contributor

hackalog commented Feb 7, 2019

I don't see this on current pyobjus, so it may have been fixed since then. Could you perhaps try with a recent pyobjus and let me know if we can close this?

@Julian-O
Copy link
Contributor

Closing as presumed fix. Did not hear back from OP.

@macarooni-man
Copy link

Hello @Julian-O! I wanted to let you know that it appears that this is now an issue again on macOS Sequoia (15.0) on my M3 pro Macbook Pro. I found this GitHub issue subsequently to doing a similar thing as OP. I can reproduce the error with the above code (using the latest version of plyer, and pyobjus):

...truncated...
   File "/Users/kaleb/Documents/GitHub/auto-mcs/build-tools/venv/lib/python3.9/site-packages/plyer/platforms/macosx/filechooser.py", line 59, in run
     panel = NSOpenPanel.openPanel()
   File "pyobjus/pyobjus.pyx", line 504, in pyobjus.ObjcMethod.__call__
   File "pyobjus/pyobjus_conversions.pxi", line 240, in pyobjus.convert_cy_ret_to_py
   File "pyobjus/pyobjus_conversions.pxi", line 181, in pyobjus.convert_to_cy_cls_instance
   File "pyobjus/pyobjus.pyx", line 741, in pyobjus.autoclass
   File "pyobjus/pyobjus.pyx", line 627, in pyobjus.resolve_super_class_methods
   File "pyobjus/pyobjus.pyx", line 543, in pyobjus.class_get_methods
   File "pyobjus/pyobjus.pyx", line 535, in pyobjus.objc_method_to_py
   File "pyobjus/pyobjus.pyx", line 244, in pyobjus.ObjcMethod.__init__
   File "pyobjus/type_enc.pxi", line 13, in pyobjus.parse_signature
   File "pyobjus/type_enc.pxi", line 2, in pyobjus.seperate_encoding
 IndexError: list index out of range

@akshayaurora
Copy link
Member

akshayaurora commented Sep 24, 2024

@macarooni-man Ditto, #89 seems to be already in place which fixes this issue.

Update: tested this pull makes it work on 15.0 and before.

@akshayaurora akshayaurora reopened this Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants