mathgeniuszach / xdialog

A cross-platform wrapper for native dialogs written entirely in python.
MIT License
22 stars 3 forks source link

ValueError: embedded null character #9

Closed IvanNazaruk closed 1 year ago

IvanNazaruk commented 1 year ago

Python: 3.7.15 x64 xdialog: 1.0.10.0

Error msg:

  File "C:\ProgramData\Miniconda3\envs\test3.7\lib\site-packages\xdialog\__init__.py", line 66, in open_file
    return dialogs.open_file(title, filetypes, multiple)
  File "C:\ProgramData\Miniconda3\envs\test3.7\lib\site-packages\xdialog\windows_dialogs.py", line 53, in open_file
    opts.lpstrFilter = ''.join(out)+'\0' # Extra NULL byte just in case
ValueError: embedded null character

I tried to solve this problem myself using the solution from here: https://github.com/arsenetar/send2trash/issues/17 https://github.com/arsenetar/send2trash/pull/18/commits/213417d3f2562f0dd5c9e11bdca272b6fb355fed And I was able to fix it, but it looks pretty rough and only for this function (xdialog.dialogs.open_file).

mathgeniuszach commented 1 year ago

This is kinda dumb, but alright lol, thanks for providing a solution

mathgeniuszach commented 1 year ago

Fixed by https://github.com/xMGZx/xdialog/commit/c4e13fad294b3a054e8fe5294d03e1146108169a