summaryrefslogtreecommitdiff
path: root/coverage/files.py
Commit message (Collapse)AuthorAgeFilesLines
* refactor: we no longer need to protect against UnicodeError, it was only on 3.6Ned Batchelder2022-01-031-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was the failure it was protecting against on Python 3.6: ``` ___________________________ ProcessTest.test_lang_c ____________________________ [gw0] linux -- Python 3.6.15 /home/runner/work/coveragepy/coveragepy/.tox/py36/bin/python self = <tests.test_process.ProcessTest object at 0x7fe57e63b198> @pytest.mark.skipif(env.PYPY, reason="PyPy is unreliable with this test") # Jython as of 2.7.1rc3 won't compile a filename that isn't utf-8. @pytest.mark.skipif(env.JYTHON, reason="Jython can't handle this test") def test_lang_c(self): # LANG=C forces getfilesystemencoding on Linux to 'ascii', which causes # failures with non-ascii file names. We don't want to make a real file # with strange characters, though, because that gets the test runners # tangled up. This will isolate the concerns to the coverage.py code. # https://github.com/nedbat/coveragepy/issues/533 self.make_file("weird_file.py", r""" globs = {} code = "a = 1\nb = 2\n" exec(compile(code, "wut\xe9\xea\xeb\xec\x01\x02.py", 'exec'), globs) print(globs['a']) print(globs['b']) """) self.set_environ("LANG", "C") out = self.run_command("coverage run weird_file.py") > assert out == "1\n2\n" E assert 'Traceback (m...ion by zero\n' == '1\n2\n' E - 1 E - 2 E + Traceback (most recent call last): E + File "/home/runner/work/coveragepy/coveragepy/coverage/files.py", line 149, in abs_file E + path = os.path.realpath(path) E + File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/posixpath.py", line 395, in realpath E + path, ok = _joinrealpath(filename[:0], filename, {}) E + File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/posixpath.py", line 429, in _joinrealpath E + if not islink(newpath): E + File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/posixpath.py", line 171, in islink E + st = os.lstat(path) E + UnicodeEncodeError: 'ascii' codec can't encode characters in position 3-6: ordinal not in range(128) ```
* refactor: super-nit-picky tweaks from mypyNed Batchelder2021-11-211-2/+2
|
* refactor: specialize exceptionsNed Batchelder2021-11-141-2/+2
| | | | | | CoverageException is fine as a base class, but not good to use for raising (and catching sometimes). Introduce specialized exceptions that allow third-party tools to integrate better.
* fix: remapping paths during combining needs to follow relative_files=True. #1147Ned Batchelder2021-11-061-2/+5
|
* fix: give a default value to the name argument for Matchers. #1273Ned Batchelder2021-11-051-3/+3
|
* fix: use human sorting on human-readable thingsNed Batchelder2021-10-121-2/+2
|
* style: the name of the matchers don't need quotes in the reprsNed Batchelder2021-10-101-3/+3
|
* test: canonicalize this bit of debug outputNed Batchelder2021-10-081-1/+1
|
* fix: generate flat file names differentlyNed Batchelder2021-07-151-8/+9
| | | | | | | | Fixes a few unusual issues with reports: - #580: HTML report generation fails on too long path - #584: File collisions in coverage report html - #1167: Remove leading underscore in coverage html
* refactor: remove a now no-op functionNed Batchelder2021-05-021-8/+1
|
* refactor: move exceptions to their own moduleNed Batchelder2021-05-021-1/+2
|
* refactor: pyupgrade --py36-plus coverage/*.pyNed Batchelder2021-05-021-8/+8
|
* refactor: remove code explicitly choosing between py2 and py3Ned Batchelder2021-05-011-16/+4
|
* debug: label each matcher with its roleNed Batchelder2021-04-111-6/+9
|
* fix: make TreeMatcher right for case-sensitive worldsNed Batchelder2021-04-101-2/+4
|
* fix: combine aliases on windows base dirs (ie: ``X:\``) (fixes: #577)Valentin Lab2021-01-171-2/+4
| | | | Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
* Don't do vars and users in abs_fileNed Batchelder2019-11-281-3/+2
| | | | It meant file names could be incorrectly expanded.
* Adapt to 3.9's way of reporting files using absolute paths.Ned Batchelder2019-11-251-0/+7
|
* No need for format indexes (mostly)Ned Batchelder2019-09-011-1/+1
|
* Make sure that the cache is properly filled. (25x speedup on our system that ↵Stephan Richter2019-01-281-2/+3
| | | | | | has a large sys.path.) It is always a bad idea to reassign the cachekey during the computation.
* Keep windows working in the face of bizarre errorsNed Batchelder2018-09-091-1/+3
|
* Move fiddly fnmatch logic into its own testable functionNed Batchelder2018-09-021-25/+37
|
* Update NOTICE link to GitHub.Ned Batchelder2018-06-241-1/+1
|
* Simplify the aliases structureNed Batchelder2018-01-231-4/+4
|
* Ensure mapped paths use the separator of the result. #618Ned Batchelder2018-01-221-2/+1
|
* Don't ever create HTML filenames longer than ~200 chars. Fixes #627.Ned Batchelder2018-01-201-1/+9
|
* Root is acceptable as a combining path (the manylinux tests end up with one ↵Ned Batchelder2017-10-261-2/+10
| | | | of these)
* Avoid a deprecation warning (from https://github.com/nedbat/coveragepy/pull/33)Ned Batchelder2017-10-121-5/+4
|
* Python3.7 removed an unneeded backslash from fnmatch.translateNed Batchelder2017-10-051-1/+3
|
* Clarify how TreeMatcher works.Ned Batchelder2017-02-201-9/+15
|
* Don't collapse in an ascii-only file-world. #533Ned Batchelder2016-11-171-2/+10
|
* In Python 3.6, fnmatch changed a little bit. Adapt.Ned Batchelder2016-09-131-2/+5
|
* Use unicode_filename more, and account for missing filesystemencodingNed Batchelder2015-10-251-3/+2
|
* Properly handle filenames with non-ASCII characters. #432Ned Batchelder2015-10-251-5/+30
|
* Protect ourselves from mock'ed os. #416Ned Batchelder2015-10-061-1/+3
|
* Fix 'filename' to be 'file name' in English.Ned Batchelder2015-08-201-5/+5
|
* Use ntpath so Windows file manipulation can be tested the same everywhere.Ned Batchelder2015-08-151-1/+1
|
* Move flat_rootname from FileReporter to a utility function.Ned Batchelder2015-08-091-0/+14
|
* Windows fixes due to data changesNed Batchelder2015-07-261-1/+4
|
* Get rid of napoleon style docstrings, they don't format nicely.Ned Batchelder2015-07-261-4/+3
|
* Add license mention to the top of all files. #313.Ned Batchelder2015-07-241-0/+3
|
* Be more specific with PathAliases tests.Ned Batchelder2015-06-161-1/+3
|
* Remove FileLocator from PathAliases. Now it always produces canonicalized paths.Ned Batchelder2015-06-131-6/+5
|
* Change FileLocator from a class to module-level functionsNed Batchelder2015-06-131-42/+50
|
* Tweak up the last mergeNed Batchelder2015-06-071-0/+1
|
* Correct path normalization on Windows: the drive was not normalized ↵Ionel Cristian Mărieș2015-06-061-1/+1
| | | | | | | (different inputs like "c:\asdf" and "C:\asdf" did not return the same path). --HG-- branch : ionelmc/correct-path-normalization-on-windows-th-1433618255921
* Collect all the nudgy environment checks into coverage.envNed Batchelder2015-01-181-2/+3
|
* Move python source understanding into python.pyNed Batchelder2015-01-011-77/+1
|
* Don't use %r for filenames, on windows, the backslashes go nuts.Ned Batchelder2014-12-281-1/+1
|
* Further consolidation of code reading Python source.Ned Batchelder2014-12-281-7/+31
|