Skip to content
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

TypeError: Argument must be bytes or unicode, got 'bool' #333

Open
jjakob opened this issue May 24, 2023 · 1 comment
Open

TypeError: Argument must be bytes or unicode, got 'bool' #333

jjakob opened this issue May 24, 2023 · 1 comment

Comments

@jjakob
Copy link

jjakob commented May 24, 2023

The code that calls qrcode is:
https://github.com/juga0/opgpcard/blob/47f62b1d6ceed1eeb58eeddaf2975a5910645a8b/opgpcard/qrsvg.py#L38

qrcode version 7.4.2
lxml version 4.9.2

Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.11/opgpcard", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.11/site-packages/opgpcard/cli.py", line 95, in main
    gen_opgpcard(args)
  File "/usr/lib/python3.11/site-packages/opgpcard/opgpcard.py", line 188, in gen_opgpcard
    qrsvg.gen_qr_svgimage(vcard, qr_path)
  File "/usr/lib/python3.11/site-packages/opgpcard/qrsvg.py", line 38, in gen_qr_svgimage
    img = qr.make_image(fit=True)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/qrcode/main.py", line 365, in make_image
    im = image_factory(
         ^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/qrcode/image/svg.py", line 145, in __init__
    super().__init__(*args, **kwargs)
  File "/usr/lib/python3.11/site-packages/qrcode/image/svg.py", line 27, in __init__
    super().__init__(*args, **kwargs)
  File "/usr/lib/python3.11/site-packages/qrcode/image/base.py", line 139, in __init__
    super().__init__(*args, **kwargs)
  File "/usr/lib/python3.11/site-packages/qrcode/image/base.py", line 30, in __init__
    self._img = self.new_image(**kwargs)
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/qrcode/image/svg.py", line 63, in new_image
    return self._svg(**kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/qrcode/image/svg.py", line 151, in _svg
    return super()._svg(viewBox=viewBox, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/qrcode/image/svg.py", line 96, in _svg
    svg = super()._svg(tag=tag, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/qrcode/image/svg.py", line 69, in _svg
    return ET.Element(
           ^^^^^^^^^^^
  File "src/lxml/etree.pyx", line 3042, in lxml.etree.Element
  File "src/lxml/apihelpers.pxi", line 131, in lxml.etree._makeElement
  File "src/lxml/apihelpers.pxi", line 119, in lxml.etree._makeElement
  File "src/lxml/apihelpers.pxi", line 318, in lxml.etree._initNodeAttributes
  File "src/lxml/apihelpers.pxi", line 335, in lxml.etree._addAttributeToNode
  File "src/lxml/apihelpers.pxi", line 1539, in lxml.etree._utf8
TypeError: Argument must be bytes or unicode, got 'bool'
@razvanioan
Copy link

razvanioan commented Dec 18, 2024

having the same issue
was working fine in 7.3.1 with lxml 5.1.0 in python 3.11.9

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

No branches or pull requests

2 participants