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

Fix get_metadata to handle unicode strings #575

Merged
merged 2 commits into from Oct 29, 2013

Conversation

Projects
None yet
2 participants
@brutasse
Contributor

brutasse commented Oct 21, 2013

get_metadata was failing with non-ascii author fields on Python 2. This
brings Python 3's unicode behaviour: all strings are unicode without having to
prefix them with u''s.

This works with every python version >= 2.6.

To reproduce the issue, run with the current version of fpm (and python 2.X as the default python):

fpm -s python -t deb django-push

The get_metadata task fails with a UnicodeDecodeError. My patch fixes it.

brutasse added some commits Oct 21, 2013

Fix get_metadata to handle unicode strings
get_metadata was failing with non-ascii `author` fields on Python 2. This
brings Python 3's unicode behaviour: all strings are unicode without having to
prefix them with `u''`s.

This works with every python version >= 2.6.
@brutasse

This comment has been minimized.

Contributor

brutasse commented Oct 21, 2013

After testing this patch on an ubuntu box I ran into issues and ended up with an alternative approach. I just work around the author issue, which appears to be the only place where there is interpolation with something that can be either a bytestring or a unicode string.

Tested on Archlinux (python 2 and python 3) and that ubuntu box (python 2).

jordansissel added a commit that referenced this pull request Oct 29, 2013

Merge pull request #575 from brutasse/fix/unicode
Fix get_metadata to handle unicode strings

@jordansissel jordansissel merged commit 35ecac0 into jordansissel:master Oct 29, 2013

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Oct 29, 2013

Thanks for improving FPM!

prof-milki pushed a commit to prof-milki/xpm that referenced this pull request Dec 18, 2014

jls
Merge pull request jordansissel#575 from brutasse/fix/unicode
Fix get_metadata to handle unicode strings

prof-milki pushed a commit to prof-milki/xpm that referenced this pull request Dec 27, 2014

Merge pull request jordansissel#575 from brutasse/fix/unicode
Fix get_metadata to handle unicode strings

jordansissel added a commit that referenced this pull request Apr 24, 2015

Merge pull request #575 from brutasse/fix/unicode
Fix get_metadata to handle unicode strings

jordansissel added a commit that referenced this pull request Jun 20, 2016

Merge pull request #575 from brutasse/fix/unicode
Fix get_metadata to handle unicode strings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment