Re: [Python-Dev] r84204 - in python/branches/py3k/Lib: os.py test/test_os.py

Aug. 19, 2010
5:15 p.m.
On Thu, 19 Aug 2010 19:10:19 +0200 (CEST) victor.stinner <python-checkins@python.org> wrote:
Author: victor.stinner Date: Thu Aug 19 19:10:18 2010 New Revision: 84204
Log: Fix os.get_exec_path() (code and tests) for python -bb
Catch BytesWarning exceptions.
You should not catch warnings, but silence them using constructs provided by the warnings module: with warnings.catch_warnings(): warnings.simplefilter(ignore, BytesWarning) # the rest of your code Otherwise you'll get buggy behaviour where e.g. env[b'PATH'] raises BytesWarning because of an unicode key, but it would have succeeded otherwise. Regards Antoine.
5329
Age (days ago)
5329
Last active (days ago)
0 comments
1 participants
participants (1)
-
Antoine Pitrou