homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Reassure user: test_os BytesWarning is OK
Type: enhancement Stage: resolved
Components: Tests Versions: Python 3.2
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: hfuru, pitrou, r.david.murray
Priority: normal Keywords:

Created on 2010年11月04日 14:03 by hfuru, last changed 2022年04月11日 14:57 by admin. This issue is now closed.

Messages (8)
msg120407 - (view) Author: Hallvard B Furuseth (hfuru) Date: 2010年11月04日 14:03
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
 try:
msg120410 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010年11月04日 14:38
I don't see any bytes warnings when I run test_os with -b or -bb on linux on py3k trunk. (If there were such a warning and it was expected, the fix would be to capture the warning and ignore it.)
Under what circumstances do you see this warning?
msg120411 - (view) Author: Hallvard B Furuseth (hfuru) Date: 2010年11月04日 14:41
R. David Murray writes:
> I don't see any bytes warnings when I run test_os with -b or -bb on
> linux on py3k trunk. (If there were such a warning and it was expected,
> the fix would be to capture the warning and ignore it.)
> 
> Under what circumstances do you see this warning?
Python 3.2a3, test_os with python -b.
msg120423 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010年11月04日 17:30
Can you give the exact command line you are using to run it, and the OS and version, and perhaps a printenv? I can't reproduce it in 3.1 or 3.2a3.
msg120424 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010年11月04日 17:30
Running it with -E and seeing if that changes the behavior would also be useful.
msg120439 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010年11月04日 20:59
I guess you're not seeing them because Victor silenced them a couple of days ago in r85902.
Hallvard, if you update your py3k working copy, do these warnings disappear?
msg120442 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010年11月04日 21:11
Ah, then this report is probably out of date. I just realized that I ran my 3.2a3 test incorrectly, so my report that I didn't see them there is invalid.
msg120474 - (view) Author: Hallvard B Furuseth (hfuru) Date: 2010年11月05日 09:03
Antoine Pitrou writes:
> Hallvard, if you update your py3k working copy, do these warnings disappear?
Yes, switching to the svn version shuts them up.
History
Date User Action Args
2022年04月11日 14:57:08adminsetgithub: 54522
2010年11月05日 09:18:59r.david.murraysetstatus: open -> closed
resolution: out of date
stage: resolved
2010年11月05日 09:03:12hfurusetmessages: + msg120474
2010年11月04日 21:11:40r.david.murraysetmessages: + msg120442
2010年11月04日 20:59:29pitrousetnosy: + pitrou
messages: + msg120439
2010年11月04日 17:30:57r.david.murraysetmessages: + msg120424
2010年11月04日 17:30:14r.david.murraysetmessages: + msg120423
2010年11月04日 14:41:59hfurusetmessages: + msg120411
2010年11月04日 14:38:36r.david.murraysetnosy: + r.david.murray
messages: + msg120410
2010年11月04日 14:03:15hfurucreate

AltStyle によって変換されたページ (->オリジナル) /