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

failing with Gio::Error #17

Open
dja001 opened this issue Aug 23, 2023 · 2 comments
Open

failing with Gio::Error #17

dja001 opened this issue Aug 23, 2023 · 2 comments

Comments

@dja001
Copy link
Contributor

dja001 commented Aug 23, 2023

Hi @dmitry-t,

I am encountering a new problem with the extension. I am unsure if its related to a new version of inkscape or my linux distro. When I try to run the extension on any file, I get an obscur Gio::Error and the error message that I am pasting below.

The weird thing is that if I try to run the failing conversion command from a small local python script:

import subprocess
cmd = ['inkscape', 'intro.svg', '--export-area-page', '--export-type', 'pdf', '--export-filename', '    test_intro.pdf']
subprocess.run(cmd, check=True)

There is no problem and the conversion runs like charm.

Versions:
inkscape-export-layers v3.3.2
Inkscape 1.3 from PPA
Linux Mint cinnamon 20.2 Uma

Error traceback:
Note that towards the bottom, there is also an error with the way the traceback is handled but that is not the primary problem that concerns me here.

terminate called after throwing an instance of 'Gio::Error'
/usr/lib/python3/dist-packages/apport/report.py:13: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import fnmatch, glob, traceback, errno, sys, atexit, imp, stat
Traceback (most recent call last):
  File "export_layers.py", line 269, in _convert_svg
    subprocess.check_call(command)
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['inkscape', '/tmp/tmp-inkscapeo58wewy6/intro.svg', '--export-area-page', '--export-dpi=200', '--export-type', 'pdf', '--export-filename', '/home/dominik/Documents/presentation_08_AMS_radar_talk/figures/intro.pdf']' died with <Signals.SIGABRT: 6>.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "export_layers.py", line 304, in <module>
    LayerExport().run(output=False)
  File "/usr/share/inkscape/extensions/inkex/base.py", line 250, in run
    self.save_raw(self.effect())
  File "export_layers.py", line 106, in effect
    if not self.convert_svg_to_pdf(svg_file, output_dir,
  File "export_layers.py", line 253, in convert_svg_to_pdf
    return self._convert_svg(svg_file, output_dir, prefix, 'pdf')
  File "export_layers.py", line 271, in _convert_svg
    raise Exception(
Exception: Failed to convert /tmp/tmp-inkscapeo58wewy6/intro.svg to /home/dominik/Documents/presentation_08_AMS_radar_talk/figures/intro.pdf.
Command '['inkscape', '/tmp/tmp-inkscapeo58wewy6/intro.svg', '--export-area-page', '--export-dpi=200', '--export-type', 'pdf', '--export-filename', '/home/dominik/Documents/presentation_08_AMS_radar_talk/figures/intro.pdf']' died with <Signals.SIGABRT: 6>.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "export_layers.py", line 307, in <module>
    inkex.errormsg(traceback.format_exc(e))
  File "/usr/lib/python3.8/traceback.py", line 167, in format_exc
    return "".join(format_exception(*sys.exc_info(), limit=limit, chain=chain))
  File "/usr/lib/python3.8/traceback.py", line 120, in format_exception
    return list(TracebackException(
  File "/usr/lib/python3.8/traceback.py", line 493, in __init__
    context = TracebackException(
  File "/usr/lib/python3.8/traceback.py", line 508, in __init__
    self.stack = StackSummary.extract(
  File "/usr/lib/python3.8/traceback.py", line 340, in extract
    if limit >= 0:
TypeError: '>=' not supported between instances of 'Exception' and 'int'

I can run further tests if that can help you finding the problem.

Thanks!

@VasilySotnikov
Copy link

I'd like to add that I encounter exactly the same issue with the same error messages.

VasilySotnikov pushed a commit to VasilySotnikov/inkscape-export-layers that referenced this issue Oct 2, 2023
This is a temporary fix.

This issue will be fixed upstream by
https://gitlab.com/inkscape/inkscape/-/merge_requests/5664
once it makes its way to the release.
@VasilySotnikov
Copy link

After some googling I found a related issue in inkscape's gitlab and figured out a way to make it work for me through a very simple hack (see the pull request).

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