Title: Windows: ValueError: invalid encoding: None
Type: behaviour Severity: normal
Components: Versions: Jython 2.7
Milestone: Jython 2.7.1
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: stefan.richthofer Nosy List: stefan.richthofer
Priority: normal Keywords:

Created on 2017-03-03.13:58:26 by stefan.richthofer, last changed 2017-03-28.05:28:37 by zyasoft.

msg11166 (view) Author: Stefan Richthofer (stefan.richthofer) Date: 2017-03-03.13:58:26
On Windows 10 I observe this or rather similar output frequently in test_io, test_io_jy and test_univnewlines:

Traceback (most recent call last):
  File "Lib\test\", line 2504, in test_read_nonbytes
    t = self.TextIOWrapper(NonbytesStream('a'))
  File "D:\workspace\linux\Jython\ssh\jython\dist\Lib\", line 1037, in __init__
    raise ValueError("invalid encoding: %r" % encoding)
ValueError: invalid encoding: None

It always names one of these locations: line 1037 line 1489
msg11177 (view) Author: Stefan Richthofer (stefan.richthofer) Date: 2017-03-04.23:10:52
Fixed as of

test_io, test_io_jy and test_univnewlines pass now also on Windows.

This came from completely operating in fallback mode, while additionally assuming to be on posix. For now I fixed the crucieal points in, but the better, more sustainable fix would be to port _localemodule.c properly to Java (still would need adjustment for proper platform detection or needs to be added as PyShadowString-target to sys.platform).
However porting _localemodule should maybe better go directly into Jython 3...
Date User Action Args
2017-03-28 05:28:37zyasoftsetstatus: pending -> closed
2017-03-04 23:10:52stefan.richthofersetstatus: open -> pending
assignee: stefan.richthofer
resolution: fixed
messages: + msg11177
milestone: Jython 2.7.1
2017-03-03 13:58:26stefan.richthofercreate