Skip to content
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

codespell fails with uncaught exception on empty files #2194

Closed
DimitriPapadopoulos opened this issue Dec 11, 2021 · 0 comments · Fixed by #2195
Closed

codespell fails with uncaught exception on empty files #2194

DimitriPapadopoulos opened this issue Dec 11, 2021 · 0 comments · Fixed by #2195

Comments

@DimitriPapadopoulos
Copy link
Collaborator

$ mkdir -p foo
$ touch foo/bar.sql
$ cd foo
$ 
$ codespell
Traceback (most recent call last):
  File "/home/username/.local/bin/codespell", line 11, in <module>
    load_entry_point('codespell', 'console_scripts', 'codespell')()
  File "/my/path/codespell/codespell_lib/_codespell.py", line 754, in _script_main
    return main(*sys.argv[1:])
  File "/my/path/codespell/codespell_lib/_codespell.py", line 905, in main
    bad_count += parse_file(
  File "/my/path/codespell/codespell_lib/_codespell.py", line 642, in parse_file
    lines, encoding = file_opener.open(filename)
  File "/my/path/codespell/codespell_lib/_codespell.py", line 174, in open
    return self.open_with_internal(filename)
  File "/my/path/codespell/codespell_lib/_codespell.py", line 223, in open_with_internal
    raise Exception('Unknown encoding: %s' % filename)
Exception: Unknown encoding
$ 
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 a pull request may close this issue.

1 participant