Skip to content

Conversation

@wojcikstefan
Copy link
Member

@wojcikstefan wojcikstefan commented Feb 22, 2017

Prior to this PR, formatting the exception message would fail:

In [1]: from mongoengine.fields import URLField

In [2]: URLField().validate(u'http://привет.com')
---------------------------------------------------------------------------
UnicodeEncodeError                        Traceback (most recent call last)
<ipython-input-2-023c2c193da6> in <module>()
----> 1 URLField().validate(u'http://привет.com')

/Users/wojcikstefan/Repos/temp/mongoengine/mongoengine/fields.py in validate(self, value)
    145         # Then check full URL
    146         if not self.url_regex.match(value):
--> 147             self.error('Invalid URL: {}'.format(value))
    148             return
    149

UnicodeEncodeError: 'ascii' codec can't encode characters in position 7-12: ordinal not in range(128)

@wojcikstefan wojcikstefan merged commit 3f31666 into master Feb 24, 2017
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.

2 participants