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

version 1.0.2: UnicodeDecodeError ('ascii' codec can't decode byte 0xc3 in position 46: ordinal not in range(128)) #2

Closed
maxamillion opened this issue Feb 25, 2016 · 5 comments

Comments

@maxamillion
Copy link

yamllint 1.0.2 from pypi fails nose tests on python 3.5

======================================================================
ERROR: Failure: UnicodeDecodeError ('ascii' codec can't decode byte 0xc3 in position 46: ordinal not in range(128))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/nose/failure.py", line 39, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File "/usr/lib/python3.5/site-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python3.5/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python3.5/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/usr/lib64/python3.5/imp.py", line 234, in load_module
    return load_source(name, filename, file)
  File "/usr/lib64/python3.5/imp.py", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 693, in _load
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 662, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/builddir/build/BUILD/yamllint-1.0.2/tests/test_spec_examples.py", line 184, in <module>
    _gen_test(f.read(), conf))
  File "/usr/lib64/python3.5/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 46: ordinal not in range(128)

----------------------------------------------------------------------
Ran 133 tests in 4.938s

FAILED (errors=1)

This happened in a koji scratch build: http://koji.fedoraproject.org/koji/taskinfo?taskID=13121566

@adrienverge
Copy link
Owner

That's strange, because it doesn't happen on Travis build for Python 3.5 (that runs nose tests).

I will try to reproduce.

@adrienverge
Copy link
Owner

Unable to reproduce :(

  1. Downloaded yamllint.spec from https://maxamillion.fedorapeople.org/yamllint.spec
  2. Changed 0.7.2 to 1.0.2.
  3. Ran rpmbuild -ba yamllint.spec (and also LANG=en_US.UTF-8 LC_CTYPE= rpmbuild -ba yamllint.spec, like on Koji): there is no error.
----------------------------------------------------------------------
Ran 132 tests in 6.166s

...

Wrote: /home/adrien/rpmbuild/SRPMS/yamllint-1.0.2-1.fc23.src.rpm
Wrote: /home/adrien/rpmbuild/RPMS/noarch/yamllint-1.0.2-1.fc23.noarch.rpm

...

+ exit 0

@adrienverge
Copy link
Owner

I suspect the problem may come from some file in tests/yaml-1.2-spec-examples.

Could you try the branch fix-build-on-Koji? (You'll have to create the tar archive manually, though.)

@maxamillion
Copy link
Author

That branch worked, thanks! 👍

@adrienverge
Copy link
Owner

Great!

I released version 1.0.3 on pypi so you can use it on Koji.

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

No branches or pull requests

2 participants