Note I am trying to get a str object as a response.
When that code is executed the following error raises:
Traceback (most recent call last):
File "qr_snippet.py", line 9, in <module>
qr_img.save(text)
File "/home/nestor/.venv/dcpt38/lib/python3.8/site-packages/qrcode/image/svg.py", line 42, in save
self._write(stream)
File "/home/nestor/.venv/dcpt38/lib/python3.8/site-packages/qrcode/image/svg.py", line 89, in _write
ET.ElementTree(self._img).write(stream, encoding="UTF-8",
File "/usr/lib/python3.8/xml/etree/ElementTree.py", line 772, in write
serialize(write, self._root, qnames, namespaces,
File "/usr/lib/python3.8/xml/etree/ElementTree.py", line 937, in _serialize_xml
_serialize_xml(write, e, qnames, None,
File "/usr/lib/python3.8/xml/etree/ElementTree.py", line 931, in _serialize_xml
write(" %s=\"%s\"" % (qnames[k], v))
TypeError: string argument expected, got 'bytes'
In
Python 3.8.5
I have the following issue:Having the following code snippet:
Note I am trying to get a
str
object as a response.When that code is executed the following error raises: