classification
Title: test_sys is failed if standard stream is redirected in 2.7
Type: behavior Stage: resolved
Components: Tests Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: python-dev, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2015-11-23 09:35 by serhiy.storchaka, last changed 2015-11-25 14:20 by serhiy.storchaka. This issue is now closed.

Files
File name Uploaded Description Edit
test_sys_test_43581.patch serhiy.storchaka, 2015-11-23 09:35 review
Messages (2)
msg255142 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-11-23 09:35
When stdout or stderr (but not both) are redirected and PYTHONIOENCODING is not set, test_sys is failed in 2.7.

======================================================================
FAIL: test_43581 (test.test_sys.SysModuleTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/serhiy/py/cpython2.7-debug/Lib/test/test_sys.py", line 415, in test_43581
    self.assertTrue(sys.__stdout__.encoding == sys.__stderr__.encoding)
AssertionError: False is not true

----------------------------------------------------------------------

Can be reproduced by one of following commands:

$ ./python -m test.regrtest -v test_sys | cat
$ ./python -m test.regrtest -v test_sys 2>/dev/null

Proposed patch fixes the test.
msg255356 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-11-25 14:20
New changeset eb9d2e5bc8dc by Serhiy Storchaka in branch '2.7':
Issue #25703: Skip test_43581 if one of stdout or stderr is redirected.
https://hg.python.org/cpython/rev/eb9d2e5bc8dc
History
Date User Action Args
2015-11-25 14:20:42serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2015-11-25 14:20:26python-devsetnosy: + python-dev
messages: + msg255356
2015-11-23 09:35:47serhiy.storchakacreate