Issue1825

classification
Title: EnvironmentError.filename is `str` even if original name is `unicode`
Type: Severity: normal
Components: Versions:
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: pjenvey Nosy List: pekka.klarck, pjenvey
Priority: Keywords:

Created on 2011-12-07.08:41:13 by pekka.klarck, last changed 2011-12-10.01:07:55 by pjenvey.

Messages
msg6739 (view) Author: Pekka Klärck (pekka.klarck) Date: 2011-12-07.08:41:12
To reproduce:

$ cat filename.py 
try:
    open(u'hyv\xe4')
except EnvironmentError, err:
    print type(err.filename), repr(err.filename)

$ python filename.py 
<type 'unicode'> u'hyv\xe4'

$ jython --version
Jython 2.5.2

$ jython filename.py 
<type 'str'> 'hyv\xe4'
msg6740 (view) Author: Philip Jenvey (pjenvey) Date: 2011-12-10.01:07:54
I fixed this in open and in some os module functions which had the same issue

(32b8ace8ef6d & d70e1a817a61)

It could still crop up again with exception callbacks triggered by the jnr-posix library (in org.python.modules.posix.PythonPosixHandler#error). A fix for that requires a hacky solution or a rethinking of how jnr-posix does those callback exceptions, so I'll defer that for later
History
Date User Action Args
2011-12-10 01:07:55pjenveysetstatus: open -> closed
resolution: fixed
messages: + msg6740
2011-12-08 02:34:52pjenveysetassignee: pjenvey
nosy: + pjenvey
2011-12-07 08:41:13pekka.klarckcreate