-
Notifications
You must be signed in to change notification settings - Fork 37
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
I don't know what the problem is #5
Comments
Hmmm… I don't know either. The zxing Java binary is notably terrible at parsing the filenames sent to it by Python (it's possible that the Chinese characters in the path are confusing it). The fact that you're running on Windows doesn't help… Can you try adding these two lines and re-running? It should print two extra lines with the filename and “file URI” before failing. diff --git a/zxing/__init__.py b/zxing/__init__.py
index bd0dd31..c767f0a 100644
--- a/zxing/__init__.py
+++ b/zxing/__init__.py
@@ -58,7 +58,9 @@ class BarCodeReader(object):
elif stdout.startswith(b'''Exception in thread "main" java.io.IOException: Could not load '''):
raise BarCodeReaderException("Java library could not read image; is it in a supported format?", filename)
elif stdout.startswith(b'''Exception '''):
+ print(filename)
+ print(file_uri)
raise BarCodeReaderException("Unknown Java exception: %s" % stdout)
elif p.returncode:
raise BarCodeReaderException("Unexpected subprocess return code %d" % p.returncode, self.java) |
I had the same problem (I'm also on Windows). I got the package through pip and I saw that there are some differences in My downloaded While on github it looks like this (link): The version on github worked for me.
Maybe something needs to be updated on pypi? |
I appreciate the feedback about the working change, but your way of demonstrating the difference is a little excruciating. 😓 A simple
Indeed. The aforementioned changes haven't yet been rolled into a release. Update: Done. Latest version tagged as |
zxing: error: Unknown Java exception: b'Exception in thread "main" java.lang.IllegalArgumentException: URI path component is empty\r\n\tat sun.nio.fs.WindowsUriSupport.fromUri(Unknown Source)\r\n\tat sun.nio.fs.WindowsFileSystemProvider.getPath(Unknown Source)\r\n\tat java.nio.file.Paths.get(Unknown Source)\r\n\tat com.google.zxing.client.j2se.CommandLineRunner.expand(CommandLineRunner.java:112)\r\n\tat com.google.zxing.client.j2se.CommandLineRunner.main(CommandLineRunner.java:76)\r\n'
The text was updated successfully, but these errors were encountered: