lincolnloop / python-qrcode

Python QR Code image generator
https://pypi.python.org/pypi/qrcode
Other
4.39k stars 673 forks source link

ScriptTest::test_factory test failure (7.4.2) with "No such file" #355

Closed nieder closed 6 days ago

nieder commented 7 months ago

on macOS running python3.10:

____________________________________________________________________________ ScriptTest.test_factory _____________________________________________________________________________

self = <qrcode.tests.test_script.ScriptTest testMethod=test_factory>, mock_stdout = <MagicMock name='stdout' id='4446436128'>

    @mock.patch("sys.stdout")
    def test_factory(self, mock_stdout):
>       main("testtext --factory svg".split())

qrcode/tests/test_script.py:64: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
qrcode/console_scripts.py:139: in main
    img.save(sys.stdout.buffer)
qrcode/image/svg.py:57: in save
    self._write(stream)
qrcode/image/svg.py:112: in _write
    ET.ElementTree(self._img).write(stream, encoding="UTF-8", xml_declaration=True)
src/lxml/etree.pyx:2075: in lxml.etree._ElementTree.write
    ???
src/lxml/serializer.pxi:747: in lxml.etree._tofilelike
    ???
src/lxml/serializer.pxi:815: in lxml.etree._create_output_buffer
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   FileNotFoundError: [Errno 2] No such file or directory

src/lxml/serializer.pxi:805: FileNotFoundError
============================================================================ short test summary info =============================================================================
FAILED qrcode/tests/test_script.py::ScriptTest::test_factory - FileNotFoundError: [Errno 2] No such file or directory

The test failure also happens python3.8 but works on python3.7. All other tests pass.

I have pypng-0.20231004.0 and pil-py-9.5.0. ETA: I have lxml-4.9.3 installed for all 3 python versions.