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

Unicode error when trying to acces resource.url #46

Closed
ynnk opened this Issue Aug 25, 2014 · 3 comments

Comments

3 participants
@ynnk

ynnk commented Aug 25, 2014

Resource let's say 'wiki_pages fails' to return url property when wiki.title contains french accents.
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 6: ordinal not in range(128)

  • wiki.query_one is utf8 encoded
  • wiki.title is unicode encoded

ex:

'{0}'.format(u"Une suite de caractères en français")

UnicodeEncodeError Traceback (most recent call last)
in ()
----> 1 '{0}'.format(u"Une suite de caractères en français")

patch in my version using

@property
def internal_id(self):
    return self.title.encode('utf8')

but query_one could also be unicode.

@maxtepkeev maxtepkeev added the bug label Sep 2, 2014

@maxtepkeev maxtepkeev self-assigned this Sep 2, 2014

maxtepkeev added a commit that referenced this issue Sep 2, 2014

@maxtepkeev

This comment has been minimized.

Owner

maxtepkeev commented Sep 2, 2014

Fixed in e6b5604. Will be part of the next release.

Thanks for reporting this!

@maxtepkeev maxtepkeev closed this Sep 2, 2014

@Boldie

This comment has been minimized.

Boldie commented Oct 21, 2015

I have version 1.4.0 installed and I still have a similar bug when doing the following line (the string was loaded from another redmine installation via get before):

rmTo.wiki_page.create(text= 'h1. test', project_id= 'project', title=u'Kompatibilit\xe4t')

I got this error:

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/redmine/managers.py", line 172, in create
    url = '{0}{1}'.format(self.redmine.url, formatter.format(self.resource_class.query_create, **fields))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 31: ordinal not in range(128)
@maxtepkeev

This comment has been minimized.

Owner

maxtepkeev commented Oct 22, 2015

Actually it's not a similar issue, can you please open a separate issue for that. I'll have a look at it at the weekends.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment