[New-bugs-announce] [issue10313] Reassure user: test_os BytesWarning is OK

Hallvard B Furuseth report at bugs.python.org
Thu Nov 4 15:03:17 CET 2010

New submission from Hallvard B Furuseth <h.b.furuseth at usit.uio.no>:

A test giving a strange warning can make a poor user nervous.  Here's
a minimal patch to calm his nerves.  It would be better to only give
the message if python -b (not -bb) is active, but I do not know how.

diff -prU2 Lib/test/test_os.py Lib/test/test_os.py
--- Lib/test/test_os.py
+++ Lib/test/test_os.py
@@ -443,4 +443,7 @@ class EnvironTests(mapping_tests.BasicTe
         test_env = {'PATH': os.pathsep.join(test_path)}
+        if os.supports_bytes_environ:
+            print("This test may give some 'BytesWarning's.", file=sys.stderr)
         saved_environ = os.environ

components: Tests
messages: 120407
nosy: hfuru
priority: normal
severity: normal
status: open
title: Reassure user: test_os BytesWarning is OK
type: feature request
versions: Python 3.2

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list