-
Notifications
You must be signed in to change notification settings - Fork 466
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
feat: report file name of file that chardet fails to read #3524
Open
corneliusroemer
wants to merge
8
commits into
codespell-project:main
Choose a base branch
from
corneliusroemer:catch-chardet
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: report file name of file that chardet fails to read #3524
corneliusroemer
wants to merge
8
commits into
codespell-project:main
from
corneliusroemer:catch-chardet
Commits on Aug 18, 2024
-
feat: report file name of file that chardet fails to read
resolves codespell-project#3519 Tested and it works now, reporting the file name: ``` codespell --write-changes -i3 -C 5 -H -f -e --count -s --builtin clear,rare,names Failed to decode file ./pep_sphinx_extensions/tests/pep_lint/test_pep_number.py using detected encoding Windows-1254. Traceback (most recent call last): File "/Users/corneliusromer/micromamba/envs/codespell/bin/codespell", line 8, in <module> sys.exit(_script_main()) ^^^^^^^^^^^^^^ File "/Users/corneliusromer/code/codespell/codespell_lib/_codespell.py", line 1103, in _script_main return main(*sys.argv[1:]) ^^^^^^^^^^^^^^^^^^^ File "/Users/corneliusromer/code/codespell/codespell_lib/_codespell.py", line 1300, in main bad_count += parse_file( ^^^^^^^^^^^ File "/Users/corneliusromer/code/codespell/codespell_lib/_codespell.py", line 945, in parse_file lines, encoding = file_opener.open(filename) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/corneliusromer/code/codespell/codespell_lib/_codespell.py", line 232, in open return self.open_with_chardet(filename) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/corneliusromer/code/codespell/codespell_lib/_codespell.py", line 246, in open_with_chardet lines = self.get_lines(f) ^^^^^^^^^^^^^^^^^ File "/Users/corneliusromer/code/codespell/codespell_lib/_codespell.py", line 303, in get_lines lines = f.readlines() ^^^^^^^^^^^^^ File "/Users/corneliusromer/micromamba/envs/codespell/lib/python3.12/encodings/cp1254.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 1349: character maps to <undefined> ```
Configuration menu - View commit details
-
Copy full SHA for 7c3df9c - Browse repository at this point
Copy the full SHA 7c3df9cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6d27fef - Browse repository at this point
Copy the full SHA 6d27fefView commit details -
Alternative to address @DimitriPapadopoulos' concerns re too many cha…
…nges. We require the type info, otherwise mypy fails
Configuration menu - View commit details
-
Copy full SHA for f74ceda - Browse repository at this point
Copy the full SHA f74cedaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 53ce7ea - Browse repository at this point
Copy the full SHA 53ce7eaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 283d0cd - Browse repository at this point
Copy the full SHA 283d0cdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3159f71 - Browse repository at this point
Copy the full SHA 3159f71View commit details -
Configuration menu - View commit details
-
Copy full SHA for c01a2bd - Browse repository at this point
Copy the full SHA c01a2bdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5209c5f - Browse repository at this point
Copy the full SHA 5209c5fView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.