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.

Author vstinner
Recipients vstinner
Date 2010-10-27.00:58:03
SpamBayes Score 9.436896e-16
Marked as misclassified No
Message-id <1288141086.46.0.441985990964.issue10210@psf.upfronthosting.co.za>
In-reply-to
Content
Using -b command line option, os.get_exec_path() always produce a warning. Example:

$ ./python -b
>>> import os: os.get_exec_path({'PATH': ''})
.../Lib/os.py:395: BytesWarning: Comparison between bytes and string
  path_listb = env[b'PATH']
['']

You can see such warning on some buildbots. This function should make this warning quiet because it is expected: it is not possible to check that a dict contains 'PATH' and b'PATH' keys without emiting a BytesWarning (see issue #9636).

Attached patch fixes this bug. It imports the warnings module in get_exec_path() function because os is a core module and it should not import too much modules. But... I'm not sure that it's the right way to fix this issue.
History
Date User Action Args
2010-10-27 00:58:06vstinnersetrecipients: + vstinner
2010-10-27 00:58:06vstinnersetmessageid: <1288141086.46.0.441985990964.issue10210@psf.upfronthosting.co.za>
2010-10-27 00:58:04vstinnerlinkissue10210 messages
2010-10-27 00:58:04vstinnercreate