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: trace.CoverageResults.write_results can't write results file for modules loaded by __path__ manipulation
Type: behavior Stage: patch review
Components: Library (Lib) Versions: Python 3.1, Python 3.2, Python 2.7, Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, matthewlmcclure
Priority: normal Keywords: easy, patch

Created on 2009-01-14 04:16 by matthewlmcclure, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
tracebug.zip matthewlmcclure, 2009-01-14 04:16 test case
tracebug.patch matthewlmcclure, 2009-01-14 04:19 patch
Messages (3)
msg79826 - (view) Author: Matt McClure (matthewlmcclure) * Date: 2009-01-14 04:16
The function trace.CoverageResults.write_results() can't write coverage
results on Windows for modules loaded by using the __path__ feature of
PEP 302.

For example, Bazaar uses the __path__ feature to load plugins from
directories specified by the BZR_PLUGIN_PATH environment variable.

The attached zip file contains a test case.  If it is unpacked so that
tracebug.py is in C:\, it will fail to produce a coverage results file
for C:\tracebug\dir2\hello.py.  Instead it will produce an empty file
named C:\tracebug\out\C .

The bug appears to be that trace.fullmodname() returns
C:.tracebug.dir2.hello .  Since the result contains a colon (:), it
can't be used as the filename of the output file produced by
trace.CoverageResults.write_results().
msg79827 - (view) Author: Matt McClure (matthewlmcclure) * Date: 2009-01-14 04:19
The attached patch replaces the offending colon with a period.
msg112334 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-08-01 14:38
Should be fixed in r83405.
History
Date User Action Args
2022-04-11 14:56:44adminsetgithub: 49193
2010-08-01 14:38:52georg.brandlsetstatus: open -> closed

nosy: + georg.brandl
messages: + msg112334

resolution: fixed
2010-06-25 23:26:01terry.reedysetkeywords: + easy
stage: patch review
type: behavior
versions: + Python 3.1, Python 2.7, Python 3.2, - Python 2.5, Python 2.4
2009-01-14 04:19:02matthewlmccluresetfiles: + tracebug.patch
keywords: + patch
messages: + msg79827
2009-01-14 04:16:06matthewlmcclurecreate