Skip to content

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

Description

@jjakob

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'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions