Skip to content
This repository has been archived by the owner on Jun 16, 2020. It is now read-only.

Exception occurs on RHEL 6.6 #5

Closed
kaushalmodi opened this issue Jun 28, 2018 · 5 comments
Closed

Exception occurs on RHEL 6.6 #5

kaushalmodi opened this issue Jun 28, 2018 · 5 comments
Labels
bug Something isn't working

Comments

@kaushalmodi
Copy link

Hello,

My OS is RHEL 6.6.

pip3 install --user termtosvg worked fine, but when I ran the application using termtosvg, I got this exception:

km²~/.local/:bin> termtosvg                                                                                                                   06/28 1:18pm
Recording started, enter "exit" command or Control-D to end
Traceback (most recent call last):
  File "/home/kmodi/.local/lib/python3.7/site-packages/Xlib/display.py", line 224, in __getattr__
    function = self.display_extension_methods[attr]
KeyError: 'ge_add_event_data'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/kmodi/.local/bin/termtosvg", line 11, in <module>
    sys.exit(main())
  File "/home/kmodi/.local/lib/python3.7/site-packages/termtosvg/__main__.py", line 172, in main
    columns, lines, system_theme = term.get_configuration(output_fileno)
  File "/home/kmodi/.local/lib/python3.7/site-packages/termtosvg/term.py", line 340, in get_configuration
    xresources_str = _get_xresources()
  File "/home/kmodi/.local/lib/python3.7/site-packages/termtosvg/term.py", line 361, in _get_xresources
    d = display.Display()
  File "/home/kmodi/.local/lib/python3.7/site-packages/Xlib/display.py", line 127, in __init__
    mod.init(self, info)
  File "/home/kmodi/.local/lib/python3.7/site-packages/Xlib/ext/xinput.py", line 652, in init
    disp.ge_add_event_data(info.major_opcode, device_event, DeviceEventData)
  File "/home/kmodi/.local/lib/python3.7/site-packages/Xlib/display.py", line 227, in __getattr__
    raise AttributeError(attr)
AttributeError: ge_add_event_data

Probably my OS is too old?

@nbedos
Copy link
Owner

nbedos commented Jun 28, 2018

Hi, thanks for reporting the issue!

Even if your OS is old, termtosvg should not crash this way. I've asked the folks over at Xlib about it (python-xlib/python-xlib#117). Could you please watch the issue and provide them with more info about your setup if needed?

In the meantime you can bypass the call that makes termtosvg crash by supplying the theme option: termtosvg --theme zenburn

@kaushalmodi
Copy link
Author

Could you please watch the issue and provide them with more info about your setup if needed?

Will do. Thanks.

In the meantime you can bypass the call that makes termtosvg crash by supplying the theme option: termtosvg --theme zenburn

Sorry. I still get the exact same backtrace.

km²~/.local/:bin> ./termtosvg --theme zenburn       
Recording started, enter "exit" command or Control-D to end
Traceback (most recent call last):
  File "/home/kmodi/.local/lib/python3.7/site-packages/Xlib/display.py", line 224, in __getattr__
    function = self.display_extension_methods[attr]
KeyError: 'ge_add_event_data'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./termtosvg", line 11, in <module>
    sys.exit(main())
  File "/home/kmodi/.local/lib/python3.7/site-packages/termtosvg/__main__.py", line 172, in main
    columns, lines, system_theme = term.get_configuration(output_fileno)
  File "/home/kmodi/.local/lib/python3.7/site-packages/termtosvg/term.py", line 340, in get_configuration
    xresources_str = _get_xresources()
  File "/home/kmodi/.local/lib/python3.7/site-packages/termtosvg/term.py", line 361, in _get_xresources
    d = display.Display()
  File "/home/kmodi/.local/lib/python3.7/site-packages/Xlib/display.py", line 127, in __init__
    mod.init(self, info)
  File "/home/kmodi/.local/lib/python3.7/site-packages/Xlib/ext/xinput.py", line 652, in init
    disp.ge_add_event_data(info.major_opcode, device_event, DeviceEventData)
  File "/home/kmodi/.local/lib/python3.7/site-packages/Xlib/display.py", line 227, in __getattr__
    raise AttributeError(attr)
AttributeError: ge_add_event_data

@nbedos
Copy link
Owner

nbedos commented Jun 28, 2018

Oops, I did not think this through, sorry!

I thought getting color information from the Xserver would be useful but it may not be such a great idea after all. We'll see what the Xlib devs say about the crash. I will probably make the calls to Xlib optional, or maybe remove them completely, depending on the solution chosen to implement the font option (#3).

@nbedos
Copy link
Owner

nbedos commented Jul 1, 2018

Hi,

I've modified termtosvg so that is uses a basic configuration file instead of Xresources. This means no more dependency on Xlib and no more crash for you, hopefully!

I have not released this version to the production pypi server yet, but you can dowload it from the test server:

pip install --extra-index-url https://test.pypi.org/simple/ 'termtosvg>=0.3.0rc0'

The updated README is available here: https://github.com/nbedos/termtosvg/tree/release/0.3.0

@kaushalmodi
Copy link
Author

@nbedos This works great now. Thanks! I'll close this issue there as the ball's in the court of python-xlib now.

@nbedos nbedos added the bug Something isn't working label Jul 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants