andhus / dirhash-python

Python module and CLI for hashing of file system directories based on the Dirhash Standard.
MIT License
51 stars 12 forks source link

Fix broken character #5

Closed bluenote10 closed 4 years ago

bluenote10 commented 4 years ago

The __init__.py currently contains a broken character (0xc2) at end of line 81, which means that the file has a broken encoding and cannot be imported directly. For instance if you try running python src/dirhash/__init__.py in the repository root, you get:

$ python src/dirhash/__init__.py
  File "src/dirhash/__init__.py", line 81
SyntaxError: Non-ASCII character '\xc2' in file src/dirhash/__init__.py on line 82, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

This issue is typically hidden by the fact that when you do pip install dirhash pip internally uses py_compile to compile a .pyc corresponding to the __init__.py, and py_compile ignores broken file encodings. However if you delete the .pyc from the site packages directory you'd also be unable to import dirhash, because it actually has to properly parse the .py file.

This issue is causing quite some trouble when using an automatic .pyc clean up strategy. Would it be possible to release a 0.2.1 version containing this fix?

codecov-commenter commented 4 years ago

Codecov Report

Merging #5 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master        #5   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines          195       195           
  Branches        27        32    +5     
=========================================
  Hits           195       195           
Impacted Files Coverage Δ
src/dirhash/__init__.py 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7979f55...347dc27. Read the comment docs.