dlenski / python-zxing

python wrapper for the ZXing barcode library
GNU Lesser General Public License v3.0
121 stars 36 forks source link

Fix URI creation method. #4

Closed shatterhand19 closed 4 years ago

shatterhand19 commented 4 years ago

URI creation method was not working on Windows, throwing unknown Java error. This fix should work (works on Windows).

dlenski commented 4 years ago

Thanks for this. Should fix #3.

I borked this in a94f672fb35fe02638196a1eb7a04bbb8bb6e733, which was intended a hurried fix for #3. 🤦‍♂

It didn't do the trick because the issue is that Windows paths actually need to be converted to POSIX-y paths in order to be jammed into a URI. Using pathlib.Path.as_uri() is much better. 👍