BjornFJohansson / pydna

Clone with Python! Data structures for double stranded DNA & simulation of homologous recombination, Gibson assembly, cut & paste cloning.
Other
166 stars 45 forks source link

Use UTF-8 when reading __init__.py. #45

Closed cbrueffer closed 6 years ago

cbrueffer commented 6 years ago

This change fixes an encoding error I encountered on macOS Python 3.6 while updating the pydna bioconda package:

Full build log: https://circleci.com/gh/bioconda/bioconda-recipes/2242

06:27:51 BIOCONDA ERROR STDOUT+STDERR:
+ source /tmp/workspace/miniconda/bin/activate /tmp/workspace/miniconda/conda-bld/pydna_1518445616469/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla
+ /tmp/workspace/miniconda/conda-bld/pydna_1518445616469/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/bin/python setup.py install --single-version-externally-managed --record=record.txt
Traceback (most recent call last):
  File "setup.py", line 7, in <module>
    for line in open('pydna/__init__.py'):
  File "/tmp/workspace/miniconda/conda-bld/pydna_1518445616469/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/lib/python3.6/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 470: ordinal not in range(128)
codecov[bot] commented 6 years ago

Codecov Report

Merging #45 into py3dev will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           py3dev      #45   +/-   ##
=======================================
  Coverage   47.11%   47.11%           
=======================================
  Files          24       24           
  Lines        3634     3634           
=======================================
  Hits         1712     1712           
  Misses       1922     1922

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 931ad67...651563b. Read the comment docs.

BjornFJohansson commented 6 years ago

Thanks for this pull request. This could probably be merged right away. I am curious as to why this does not happen on my own builds for Mac.

https://stackoverflow.com/questions/36303919/python-3-0-open-default-encoding