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

Exception when trying to "save as" - Python 3.5 #18

Closed
MosesofEgypt opened this issue Feb 2, 2020 · 2 comments · Fixed by #28
Closed

Exception when trying to "save as" - Python 3.5 #18

MosesofEgypt opened this issue Feb 2, 2020 · 2 comments · Fixed by #28

Comments

@MosesofEgypt
Copy link
Contributor

MosesofEgypt commented Feb 2, 2020

Can be recreated by opening any tag in binilla and trying to save as. This is probably specific to 3.5, as there is probably a Path object being passed to an os function without being converted to a string.

from binilla import run
Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Python35\lib\tkinter\__init__.py", line 1558, in __call__
    return self.func(*args)
  File "C:\Python35\lib\site-packages\binilla\app_window.py", line 1367, in save_as
    self.save_tag_as()
  File "C:\Python35\lib\site-packages\binilla\app_window.py", line 1474, in save_tag_as
    initialdir=os.path.dirname(tag.filepath), defaultextension=ext,
  File "C:\Python35\lib\ntpath.py", line 239, in dirname
    return split(p)[0]
  File "C:\Python35\lib\ntpath.py", line 204, in split
    d, p = splitdrive(p)
  File "C:\Python35\lib\ntpath.py", line 139, in splitdrive
    if len(p) >= 2:
TypeError: object of type 'WindowsPath' has no len()
@ShellyHerself ShellyHerself added the tkinter tkinter label Feb 2, 2020
@ShellyHerself
Copy link
Member

ShellyHerself commented Feb 2, 2020

Cannot reproduce on Python 3.7.5 - Linux

@MosesofEgypt
Copy link
Contributor Author

MosesofEgypt commented Feb 10, 2020

It's not tkinter related, it's the line initialdir=os.path.dirname(tag.filepath). tag.filepath is a pathlib.Path object. This is a 3.5 issue.

@MosesofEgypt MosesofEgypt removed the tkinter tkinter label Feb 10, 2020
@ShellyHerself ShellyHerself changed the title Exception when trying to "save as" Exception when trying to "save as" - Python 3.5 Apr 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants