wolever / parameterized

Parameterized testing with any Python test framework
Other
833 stars 105 forks source link

Non-ASCII characters in README.rst #85

Closed moubctez closed 4 years ago

moubctez commented 4 years ago

Building fails with Python 3.6 (UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 6553: ordinal not in range(128)) because there are non-ASCII characters in README.rst.

This patch fixes the problem

--- README.rst.orig 2019-11-29 09:37:57.000000000 +0000
+++ README.rst
@@ -237,14 +237,14 @@ __ https://travis-ci.org/wolever/paramet
      - no**
      - no**
    * - py.test fixtures
-     - no†
-     - no†
-     - no†
-     - no†
-     - no†
-     - no†
-     - no†
-     - no†
+     - no
+     - no
+     - no
+     - no
+     - no
+     - no
+     - no
+     - no
    * - | unittest
        | (``@parameterized.expand``)
      - yes
@@ -270,7 +270,7 @@ __ https://travis-ci.org/wolever/paramet

 \*\*: py.test 4 is not yet supported (but coming!) in `issue #34`__

-†: py.test fixture support is documented in `issue #81`__
+: py.test fixture support is documented in `issue #81`__

 __ https://github.com/wolever/parameterized/issues/71
 __ https://github.com/wolever/parameterized/issues/34
sliwinski-milosz commented 4 years ago

I bumped into the same problem. Below the way to reproduce the issue:

  1. Firstly you may have to unset LANG environment variable - as if it is set to something that handles UTF8 characters, then you will not be able to reproduce the issue:
    unset LANG
  2. Then clone parameterized master branch and try to build it:
    python setup.py build

    Result:

    $ python -V
    Python 3.6.9
    $ unset LANG
    $ python setup.py build
    Traceback (most recent call last):
    File "setup.py", line 11, in <module>
    long_description = open("README.rst", "U").read()
    File "/Users/xxx/.virtualenvs/parameterized/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 0xe2 in position 5997: ordinal not in range(128)

    I am NOT able to reproduce that issue on Python:

    • 2.7.17
    • 3.7.5
    • 3.8.0

Also the workaround for the issue is to set LANG environment variable:

  1. On mac:
    export LANG=en_US.UTF-8
  2. On Ubuntu:
    export LANG=C.UTF-8
wolever commented 4 years ago

Fixed in 0.7.3!

sliwinski-milosz commented 4 years ago

Thanks @wolever, I just double checked on v0.7.3 and I am NOT able to reproduce the issue anymore! :) Thank you!