A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/nedbat/coveragepy/issues/203 below:

Duplicate filenames reported when filename contains uppercase letters on windows. · Issue #203 · nedbat/coveragepy · GitHub

Originally reported by Thomas Maslach (Bitbucket: tmaslach, GitHub: tmaslach)

Our source code contains python files that have uppercase letters in the filenames. On windows, when running tests that utilize these source files, the coverage report is showing the files with uppercase letters twice in the list - once with the upper case letters, once in all lower case.

I have figured out why:

In data.py:
It seems touch_file is called for all files. Passed into it is the filename that contains upper cased letters.

For files that are partly coveraged, we also call add_line_data. The filename passed into here is the canonical filename which is gotten from File.py, FileLocator.canonical_filename. This function calls os.path.normcase, which lowers the case on windows. Uh-oh! We don't do that when we call touch_file, so files show up in the report twice when they have uppercased letters..

How to fix? I'm not sure what the right solution is, but my guess is we should call the canonical_filename function before calling touch_file. This would be in control.py.

Let me know if you have any questions.. My fix is just a suggestion... Thanks!


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