[issue25703] test_sys is failed if standard stream is redirected in 2.7

Serhiy Storchaka report at bugs.python.org
Mon Nov 23 04:35:47 EST 2015


New submission from Serhiy Storchaka:

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.

----------
assignee: serhiy.storchaka
components: Tests
files: test_sys_test_43581.patch
keywords: patch
messages: 255142
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: test_sys is failed if standard stream is redirected in 2.7
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file41132/test_sys_test_43581.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25703>
_______________________________________


More information about the Python-bugs-list mailing list