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

filechooser.save_file pyobjus-related (?) error on MacOS #764

Open
yas0nia opened this issue May 6, 2023 · 2 comments
Open

filechooser.save_file pyobjus-related (?) error on MacOS #764

yas0nia opened this issue May 6, 2023 · 2 comments

Comments

@yas0nia
Copy link

yas0nia commented May 6, 2023

Hey there! Getting a following error:

File "/Users/xxx/kivyapp/macosx/main.py", line 156, in download_report
     filechooser.save_file(
   File "/Users/xxx/mambaforge/envs/pyinstKivy/lib/python3.10/site-packages/plyer/facades/filechooser.py", line 61, in save_file
     return self._file_selection_dialog(mode="save", *args, **kwargs)
   File "/Users/xxx/mambaforge/envs/pyinstKivy/lib/python3.10/site-packages/plyer/platforms/macosx/filechooser.py", line 122, in _file_selection_dialog
     return MacFileChooser(**kwargs).run()
   File "/Users/xxx/mambaforge/envs/pyinstKivy/lib/python3.10/site-packages/plyer/platforms/macosx/filechooser.py", line 67, in run
     panel = NSSavePanel.savePanel()
   File "pyobjus/pyobjus.pyx", line 499, 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 736, in pyobjus.autoclass
   File "pyobjus/pyobjus.pyx", line 622, in pyobjus.resolve_super_class_methods
   File "pyobjus/pyobjus.pyx", line 538, in pyobjus.class_get_methods
   File "pyobjus/pyobjus.pyx", line 530, in pyobjus.objc_method_to_py
   File "pyobjus/pyobjus.pyx", line 239, 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

OS: MacOS Monterrey 12.6 (M1 Apple Silicon)

The most interesting part is that it sometimes works, and sometimes doesn't, and I couldn't figure out what is the reason behind this behaviour..

Code snippet just in case:

def download_report(self):
		filechooser.save_file(
			path=self.get_downloads_folder(),
			filters=[("PDF files", "*.pdf")],
			on_selection=self.save_report_selection,
			preview=False,
		)
@Alexandro1112
Copy link

I have solution this problem.In filechooser.py does not use pyobjus library. I think you need reinstall pyobjc to newest version via command
pip install -U PyObjC That is all.

@yas0nia
Copy link
Author

yas0nia commented Sep 1, 2023

@Alexandro1112 hey there! thanks for the reply. Unfortunately, I've tried it too and it doesn't help. :(

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

2 participants