-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -430,7 +430,7 @@ def _set_starting_position(self): | |
|
||
if self.config.location: | ||
try: | ||
location_str = u'{}'.format(self.config.location) | ||
location_str = u'{}'.format(str(self.config.location)) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
douglascamata
Author
Member
|
||
location = (self._get_pos_by_name(location_str.replace(" ", ""))) | ||
self.position = location | ||
self.api.set_position(*self.position) | ||
|
1 comment
on commit 4555466
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me! thanks
@douglascamata
With this str() code will crash on non unicode string (you can try to set
location: "Москва"
):UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-4: ordinal not in range(128)
Without str() it is working both for non unicode and unicode strings. Why we need it?