Issue2646

classification
Title: Test failure in test_os_jy after utf-8 decode
Type: behaviour Severity: normal
Components: None Versions: Jython 2.7
Milestone: Jython 2.7.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: jeff.allen Nosy List: jamesmudd, jeff.allen
Priority: Keywords:

Created on 2017-11-22.19:48:04 by jamesmudd, last changed 2018-02-28.19:50:47 by jeff.allen.

Messages
msg11677 (view) Author: James Mudd (jamesmudd) Date: 2017-11-22.19:48:04
https://travis-ci.org/jythontools/jython/jobs/305970286#L1066

Think this one looks like a unicode issue. Interestingly I don't see it on my machine?
msg11678 (view) Author: Jeff Allen (jeff.allen) Date: 2017-11-22.20:21:10
Offending result for reference:

test_os_jy

     [exec] bash: warning: setlocale: LC_ALL: cannot change locale (tr_TR.UTF-8)
     [exec] bash: warning: setlocale: LC_ALL: cannot change locale (tr_TR.UTF-8)
     [exec] test test_os_jy failed -- Traceback (most recent call last):
     [exec]   File "/home/travis/build/jythontools/jython/dist/Lib/test/test_os_jy.py", line 243, in test_getcwd
     [exec]     self.assertEqual(p.stdout.read().decode("utf-8"), temp_cwd)
     [exec] AssertionError: u'/home/travis/build/jythontools/jython/tempcwd-\xe4\xb8\xad\xe6\x96\x87' != '/home/travis/build/jythontools/jython/tempcwd-\xe4\xb8\xad\xe6\x96\x87'

But those two strings aren't equal, and Jython knows it now because I just fixed unicode-str comparison in #2638. It looks like it is coming from a test using spawned subprocesses. subprocess has a different implementation on Windows (me) and Unix (Travis), or maybe the test is skipped on Windows.

Anyway, I think investigation will show that the test is at fault. (Looks like a bit I touched in the file name encoding change.)
msg11683 (view) Author: Jeff Allen (jeff.allen) Date: 2017-11-26.16:51:45
Grrr. Another failure I missed because we suppress test_os_jy from the regrtest on Windows. The previous definition of str-unicode equality let this bit of double-think slip through.

We only do this because the locale tests fail for Cygwin. I'll re-enable it and Cygwin users will just have to put up with that. Unless anyone can tell me quickly how to skipIf(is_cygwin)?
msg11726 (view) Author: Jeff Allen (jeff.allen) Date: 2018-02-28.19:50:47
Fixed at https://hg.python.org/jython/rev/320911f1aeba, and the test enabled for Windows.
History
Date User Action Args
2018-02-28 19:50:47jeff.allensetstatus: open -> closed
resolution: accepted -> fixed
messages: + msg11726
2017-11-26 16:51:46jeff.allensetassignee: jeff.allen
resolution: accepted
messages: + msg11683
2017-11-22 20:21:11jeff.allensetmessages: + msg11678
title: Test failure looks like a unicode issue -> Test failure in test_os_jy after utf-8 decode
2017-11-22 19:48:04jamesmuddcreate