zestsoftware / zest.releaser

Python software releasing made easy and repeatable
https://zestreleaser.readthedocs.io
GNU General Public License v2.0
198 stars 62 forks source link

Fix for #297: bytes+int problem on python 3 when detecting encodings #298

Closed reinout closed 5 years ago

reinout commented 5 years ago

I added a test that demonstrates the #297 problem. I get this expected traceback locally:

Traceback (most recent call last):
  File "/home/reinout/.pyenv/versions/3.7.1/lib/python3.7/doctest.py", line 1329, in __run
    compileflags, 1), test.globs)
  File "<doctest utils.txt[211]>", line 1, in <module>
    contents, encoding = utils.read_text_file(example_filename)
  File "/home/reinout/opensource/zest.releaser/zest/releaser/utils.py", line 163, in read_text_file
    coding += data[pos]
TypeError: can't concat int to bytes

Work in progress.

reinout commented 5 years ago

Yeah. I finally got the tests to properly fail. Here python2 works and the python3 builds fail: https://travis-ci.org/zestsoftware/zest.releaser/builds/459720701

With the fix included, it works on both 2 and 3: https://travis-ci.org/zestsoftware/zest.releaser/builds/459732293

mauritsvanrees commented 5 years ago

I have released this in 6.15.3. Thanks!

reinout commented 5 years ago

:-)