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

Logger plugin crashes with "TypeError: 'NoneType' object is not subscriptable" #776

Closed
cbspidi opened this issue Jun 16, 2023 · 5 comments · Fixed by #777
Closed

Logger plugin crashes with "TypeError: 'NoneType' object is not subscriptable" #776

cbspidi opened this issue Jun 16, 2023 · 5 comments · Fixed by #777
Labels

Comments

@cbspidi
Copy link

cbspidi commented Jun 16, 2023

Starting the "terminator" without the config file gives the same results.

Fill out as many of these fields as you can

Describe the bug
The logger plugin does not work with the new gnome-terminal (tested it on ubuntu 23.04 and on the rolling release of Arch), the plugin crashes with "TypeError: 'NoneType'"

To Reproduce
Start the logger, select the destination file, produce a terminal output (example: ps -Af), and stop the logger. The logger will fail to stop and no content is written to the output file.

Expected behavior
Termina output is written to output file

Screenshots

Error log from debug mode:
Window::on_window_state_changed: fullscreen=False, maximised=False
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/terminatorlib/plugins/logger.py", line 61, in save
    self.write_content(terminal, last_saved_row, last_saved_col, row, col)
  File "/usr/lib/python3.11/site-packages/terminatorlib/plugins/logger.py", line 48, in write_content
    fd.write(content[:-1])
             ~~~~~~~^^^^^
TypeError: 'NoneType' object is not subscriptable

Desktop (please complete the following information):

  • Linux Ubuntu
  • Version 23.04
  • Display Technology: Tested on both Wayland and X11 (ubuntu 23.04 wayland and arch was on X11)
@mattrose
Copy link
Member

Can you tell me what version of vte you're running?

you should be able to just run dpkg -L | grep vte

I have a feeling that it's related to this:

Note: since 0.68, passing a non-None array parameter is deprecated. Starting with 0.72, passing a non-None array parameter will make this function itself return None.

Unfortunately I can't make any sense of this sentence.

@mattrose mattrose added the question Further information is requested label Jun 17, 2023
@cbspidi
Copy link
Author

cbspidi commented Jun 17, 2023

Hi @mattrose ,
Im running vte 0.72.2-1,

#Arch:
$ pacman -Q | grep  vte           
vte-common 0.72.2-1
vte3 0.72.2-1

#Ubuntu23.04:
sudo dpkg -l | grep vte
ii  gir1.2-vte-2.91:amd64                      0.72.0-1 
ii  libvte-2.91-0:amd64                        0.72.0-1 
ii  libvte-2.91-common                         0.72.0-1 

@mattrose
Copy link
Member

It definitely works with vte 0.70. I can't figure out what I need to change to make my call compatible with the newer version, so I've opened https://gitlab.gnome.org/GNOME/vte/-/issues/2633

@mattrose mattrose added vte and removed question Further information is requested labels Jun 17, 2023
@mattrose
Copy link
Member

Vte.Terminal().get_text_range erroneously returns None as of vte 0.72 basically as a bug in the introspection attributes, see the vte bug details. There is a new, undocumented call get_text_range_format that does work in 0.72, so I'll plug that method call in to the plugin for now. Patch incoming

@mattrose
Copy link
Member

I still need to test that patch on an older vte, but it should work there as well as on 0.72 and newer.

@mattrose mattrose changed the title Logger plugin crashes with "TypeError: 'NoneType' object is not subscriptable" on gnome-terminal 3.48.1-1 Logger plugin crashes with "TypeError: 'NoneType' object is not subscriptable" Jun 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants