Issue2467

classification
Title: Some threading's Thread methods return unicode strings
Type: Severity: normal
Components: Library Versions: Jython 2.7
Milestone:
process
Status: open Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: jeff.allen, memoselyk, zyasoft
Priority: Keywords:

Created on 2016-02-16.22:12:01 by memoselyk, last changed 2018-03-03.17:48:17 by jeff.allen.

Messages
msg10746 (view) Author: memoselyk (memoselyk) Date: 2016-02-16.22:20:37
In Jython, threading.currentThread().getName() returns u"MainThread", whereas Python 2.7 returns "MainThread".

This asymmetry could lead to subtle bugs only arising in jython 2.7.
msg10747 (view) Author: Jim Baker (zyasoft) Date: 2016-02-16.23:46:13
In general, these names can be unicode but we have been doing str if possible to represent using ascii elsewhere in Jython.
msg11741 (view) Author: Jeff Allen (jeff.allen) Date: 2018-03-03.17:48:16
Strings coming from Java are unicode objects (in 2.7), so if Python can only tolerate str types we should be encoding at this point with str().

If non-ascii thread names are a serious possibility, I suggest we use the *conventional* file system encoding (sys.getfilesystemencoding()).

Fairly simple (I think) but also not a blocker to 2.7.2.
History
Date User Action Args
2018-03-03 17:48:17jeff.allensetnosy: + jeff.allen
messages: + msg11741
milestone: Jython 2.7.2 ->
2016-02-16 23:46:13zyasoftsetresolution: accepted
messages: + msg10747
nosy: + zyasoft
milestone: Jython 2.7.2
2016-02-16 22:20:37memoselyksetmessages: + msg10746
2016-02-16 22:12:01memoselykcreate