Skip to content
This repository was archived by the owner on Dec 27, 2021. It is now read-only.
This repository was archived by the owner on Dec 27, 2021. It is now read-only.

Problem with names that can't be encoded in latin-1 #1

@soult

Description

@soult
Traceback (most recent call last):
  File "/app/dpd/models.py", line 70, in _get_shipping_label_paketomat
    pb.create_recipient(recipient)
  File "/app/.heroku/python/lib/python3.7/site-packages/paketomat/__init__.py", line 111, in create_recipient
    req = self._sess.post("http://web.paketomat.at/kundenstamm/ajax/doSave.php", data=self._encode_body(body))
  File "/app/.heroku/python/lib/python3.7/site-packages/paketomat/__init__.py", line 58, in _encode_body
    return [(str(x[0]).encode("iso8859-1"), str(x[1]).encode("iso8859-1")) for x in body.items()]
  File "/app/.heroku/python/lib/python3.7/site-packages/paketomat/__init__.py", line 58, in <listcomp>
    return [(str(x[0]).encode("iso8859-1"), str(x[1]).encode("iso8859-1")) for x in body.items()]
UnicodeEncodeError: 'latin-1' codec can't encode character '\u0161' in position 5: ordinal not in range(256)```

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions