Skip to content

Fix handling files with unicode names or contents #661

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 28, 2025

Conversation

Swatinem
Copy link
Contributor

This adds the git ls-files which instructs git to output files separated by \0, and otherwise output filenames verbatim without any special encoding.

The second fix is related to enforcing utf-8 encoding when reading in file contents in order to produce "file fixes".


Fixes #489, fixes codecov/codecov-action#1550, fixes codecov/codecov-action#1539

@Swatinem Swatinem self-assigned this Mar 17, 2025
Copy link

codecov bot commented Mar 17, 2025

❌ 5 Tests Failed:

Tests completed Failed Passed Skipped
3600 5 3595 0
View the top 3 failed test(s) by shortest run time
api.temp.calculator.test_calculator::test_divide
Stack Traces | 0.001s run time
def
                test_divide():
                > assert Calculator.divide(1, 2) == 0.5
                E assert 1.0 == 0.5
                E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
                E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
                .../temp/calculator/test_calculator.py:30: AssertionError
api.temp.calculator.test_calculator::test_divide
Stack Traces | 0.001s run time
def
                test_divide():
                > assert Calculator.divide(1, 2) == 0.5
                E assert 1.0 == 0.5
                E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
                E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
                .../temp/calculator/test_calculator.py:30: AssertionError
api.temp.calculator.test_calculator::test_divide
Stack Traces | 0.001s run time
def
                test_divide():
                > assert Calculator.divide(1, 2) == 0.5
                E assert 1.0 == 0.5
                E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
                E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
                .../temp/calculator/test_calculator.py:30: AssertionError

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Copy link

github-actions bot commented Mar 17, 2025

✅ All tests successful. No failed tests were found.

📣 Thoughts on this report? Let Codecov know! | Powered by Codecov

@Swatinem Swatinem mentioned this pull request Mar 25, 2025
This adds the `git ls-files` which instructs git to output files separated by `\0`, and otherwise output filenames verbatim without any special encoding.

The second fix is related to enforcing `utf-8` encoding when reading in file contents in order to produce "file fixes".
@Swatinem Swatinem force-pushed the swatinem/test-unicode-files branch from 3f90e14 to 64550f7 Compare March 27, 2025 07:51
@Swatinem Swatinem merged commit 1c24461 into main Mar 28, 2025
22 of 23 checks passed
@Swatinem Swatinem deleted the swatinem/test-unicode-files branch March 28, 2025 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed work with non-ASCII file names FileNotFoundError for non-ASCII file names action fails to process non-ASCII Go source file on Windows
2 participants