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

decode output of lsb_release as utf-8 #144

Merged
merged 1 commit into from
Nov 1, 2016
Merged

Conversation

xsuchy
Copy link
Contributor

@xsuchy xsuchy commented Oct 14, 2016

This helps for non-US languages, which otherwise traceback.
Fixes #140

This helps for non-US languages, which otherwise traceback.
Fixes python-distro#140
@xsuchy
Copy link
Contributor Author

xsuchy commented Oct 14, 2016

I tested this and it works in both python2 and python3.

@nir0s
Copy link
Collaborator

nir0s commented Oct 20, 2016

Can we actually add a test for that?

@xsuchy
Copy link
Contributor Author

xsuchy commented Oct 21, 2016

Unfortunately I'm not able to run your tests. It hard assume python2.6, while I have python2.7. When I run tox I get:

$ tox
GLOB sdist-make: /home/msuchy/projects/distro/setup.py
flake8 inst-nodeps: /home/msuchy/projects/distro/.tox/dist/distro-1.0.0.zip
flake8 installed: alabaster==0.7.9,Babel==2.3.4,configparser==3.5.0,cov-core==1.15.0,coverage==4.2,distro==1.0.0,docutils==0.12,enum34==1.1.6,extras==1.0.0,fixtures==3.0.0,flake8==3.0.4,imagesize==0.7.1,Jinja2==2.8,linecache2==1.0.0,MarkupSafe==0.23,mccabe==0.5.2,nose==1.3.7,nose-cov==1.6,pbr==1.10.0,pycodestyle==2.0.0,pyflakes==1.2.3,Pygments==2.1.3,python-mimeparse==1.6.0,pytz==2016.7,six==1.10.0,snowballstemmer==1.2.1,Sphinx==1.4.8,testtools==2.2.0,traceback2==1.4.0,unittest2==1.1.0
flake8 runtests: PYTHONHASHSEED='2006173811'
flake8 runtests: commands[0] | flake8 distro.py
py26 create: /home/msuchy/projects/distro/.tox/py26
ERROR: InterpreterNotFound: python2.6

If you want to test it yourself, then

mv /usr/bin/lsb_release /usr/bin/lsb_release.bak
echo <<EOF > /usr/bin/lsb_release
#!/usr/bin/bash
echo žížíá
exit 7
EOF
chmod a+x /usr/bin/lsb_release

and try to import distro module.

@nir0s nir0s merged commit 008ffc2 into python-distro:master Nov 1, 2016
@dstufft
Copy link

dstufft commented Nov 3, 2016

Would it be possible to get a release with this fix in it?

@nir0s
Copy link
Collaborator

nir0s commented Nov 3, 2016

Released 1.0.1

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

Successfully merging this pull request may close these issues.

3 participants