On Thu, 19 Aug 2010 19:10:19 +0200 (CEST) victor.stinner <python-checkins at 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.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4