File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ Version 3.5.3b1
21
21
- Optimized .pyo files may not have been handled correctly, `issue 195`_.
22
22
Thanks, Marius Gedminas.
23
23
24
+ - Certain unusually named file paths could have been mangled during reporting,
25
+ `issue 194`_. Thanks, Marius Gedminas.
26
+
24
27
- Try to do a better job of the impossible task of detecting when we can't
25
28
build the C extension, fixing `issue 183`_.
26
29
@@ -29,6 +32,7 @@ Version 3.5.3b1
29
32
.. _issue 82: https://bitbucket.org/ned/coveragepy/issue/82/tokenerror-when-generating-html-report
30
33
.. _issue 179: https://bitbucket.org/ned/coveragepy/issue/179/htmlreporter-fails-when-source-file-is
31
34
.. _issue 183: https://bitbucket.org/ned/coveragepy/issue/183/install-fails-for-python-23
35
+ .. _issue 194: https://bitbucket.org/ned/coveragepy/issue/194/filelocatorrelative_filename-could-mangle
32
36
.. _issue 195: https://bitbucket.org/ned/coveragepy/issue/195/pyo-file-handling-in-codeunit
33
37
.. _tox: http://tox.readthedocs.org/
34
38
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ def relative_filename(self, filename):
27
27
28
28
"""
29
29
if filename .startswith (self .relative_dir ):
30
- filename = filename .replace (self .relative_dir , "" )
30
+ filename = filename .replace (self .relative_dir , "" , 1 )
31
31
return filename
32
32
33
33
def canonical_filename (self , filename ):
Original file line number Diff line number Diff line change @@ -37,6 +37,13 @@ def test_peer_directories(self):
37
37
self .assertEqual (fl .relative_filename (a1 ), "file1.py" )
38
38
self .assertEqual (fl .relative_filename (a2 ), a2 )
39
39
40
+ def test_filepath_contains_absolute_prefix_twice (self ):
41
+ # https://bitbucket.org/ned/coveragepy/issue/194/filelocatorrelative_filename-could-mangle
42
+ fl = FileLocator ()
43
+ d = fl .abs_file (os .curdir )
44
+ rel = os .path .join ('sub' , d .lstrip (os .path .sep ), 'file1.py' )
45
+ self .assertEqual (fl .relative_filename (fl .abs_file (rel )), rel )
46
+
40
47
41
48
class MatcherTest (CoverageTest ):
42
49
"""Tests of file matchers."""
You can’t perform that action at this time.
0 commit comments