Skip to content

Importing svg2tikz in Pyzo causes exception, works fine in the terminal #911

Closed
@ysalmon

Description

@ysalmon

Hi, I stumbled upon a failure with svg2tikz master in Pyzo : xyz2tex/svg2tikz#144

Setting up en venv with the bare minimum to have svg2tikz code from their master branch, and creating a shell in Pyzo to use that venv, causes

>>> import svg2tikz
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/tmp/v2/lib/python3.10/site-packages/svg2tikz/__init__.py", line 1, in <module>
    from .tikz_export import convert_file, convert_svg
  File "/tmp/v2/lib/python3.10/site-packages/svg2tikz/tikz_export.py", line 383, in <module>
    class TikZPathExporter(inkex.Effect, inkex.EffectExtension):
  File "/tmp/v2/lib/python3.10/site-packages/svg2tikz/tikz_export.py", line 1340, in TikZPathExporter
    def run(self, args=None, output=sys.stdout.buffer):
AttributeError: 'FileWrapper' object has no attribute 'buffer'

Opening a terminal and doing

. /tmp/v2/bin/activate
python
import svg2tikz

gives no error.

However, their latest release, which of course predates their master, does not exhibit this problem in pyzo.

I suspect a strange interaction between the two…

Metadata

Metadata

Assignees

No one assigned

    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