jython / jython

Python for the Java Platform
https://www.jython.org
Other
1.23k stars 194 forks source link

non-ASCII exception #31

Open Kaabun opened 4 years ago

Kaabun commented 4 years ago

Hi, I found a small bug in Jython (2.7.2). Jython is throwing a unicode exception when it tries to load some files from the path which contains non-ASCII characters (for example non-ASCII character could be in username in Windows - C:\Users\Micha?\AppData\Roaming\BurpSuite\bapps\a158fd3fc9394253be3aa0bc4c181d1f)

Full stacktrace is below:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
OSError: (22, 'Invalid argument', 'C:\\Users\\Micha?\\AppData\\Roaming\\BurpSuite\\bapps\\a158fd3fc9394253be3aa0bc4c181d1f')

    at org.python.core.Py.OSError(Py.java:135)
    at org.python.modules.posix.PosixModule.absolutePath(PosixModule.java:1343)
    at org.python.modules.posix.PosixModule.chdir(PosixModule.java:300)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:567)
    at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:190)
    at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:208)
    at org.python.core.PyObject.__call__(PyObject.java:461)
    at org.python.core.PyObject.__call__(PyObject.java:465)
    at org.python.pycode._pyx2.f$0(<string>:1)
    at org.python.pycode._pyx2.call_function(<string>)
    at org.python.core.PyTableCode.call(PyTableCode.java:173)
    at org.python.core.PyCode.call(PyCode.java:18)
    at org.python.core.Py.runCode(Py.java:1687)
    at org.python.core.Py.exec(Py.java:1731)
    at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:268)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:567)
    at burp.gbi.<init>(Unknown Source)
    at burp.gvv.a(Unknown Source)
    at burp.elq.lambda$panelLoaded$0(Unknown Source)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:830)
jeff5 commented 4 years ago

Originally raised as https://github.com/jythontools/jython issue 185.