Bug 2216115

Summary: [abrt] terminator: feed(): terminal.py:1697:feed:AttributeError: 'bytes' object has no attribute 'encode'
Product: [Fedora] Fedora Reporter: Gael <gael>
Component: terminatorAssignee: Dominic Hopf <dmaphy>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 38CC: dmaphy, gael, mattrose
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/ec8dbc0ef5c6146917c25280dc5b7ff636483a7
Whiteboard: abrt_hash:b9b55f15b0cdae8c5f20268607e205957d7190ab;VARIANT_ID=workstation;
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: os_info
none
File: environ
none
File: mountinfo
none
File: open_fds
none
File: namespaces
none
File: backtrace
none
File: cpuinfo none

Description Gael 2023-06-20 07:28:09 UTC
Description of problem:
dropping url from Firefox into the terminator window

Version-Release number of selected component:
terminator-2.1.3-1.fc38

Additional info:
reporter:       libreport-2.17.10
kernel:         6.3.5-200.fc38.x86_64
cmdline:        /usr/bin/python3 -sP /usr/bin/terminator
cgroup:         0::/user.slice/user-1000.slice/user/app.slice/app-gnome-terminator-20970.scope
uid:            1000
reason:         terminal.py:1697:feed:AttributeError: 'bytes' object has no attribute 'encode'
executable:     /usr/bin/terminator
type:           Python3
package:        terminator-2.1.3-1.fc38
runlevel:       N 5
exception_type: AttributeError
crash_function: feed
interpreter:    python3-3.11.3-2.fc38.x86_64
comment:        dropping url from Firefox into the terminator window

Truncated backtrace:
terminal.py:1697:feed:AttributeError: 'bytes' object has no attribute 'encode'

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/terminatorlib/terminal.py", line 1264, in on_drag_data_received
    term.feed(txt.encode())
  File "/usr/lib/python3.11/site-packages/terminatorlib/terminal.py", line 1697, in feed
    self.vte.feed_child(text.encode())
                        ^^^^^^^^^^^
AttributeError: 'bytes' object has no attribute 'encode'

Local variables in innermost frame:
self: <terminal.Terminal object at 0x7fc19799ef00 (terminatorlib+terminal+Terminal at 0x556220177950)>
text: b'file:///home/gael/T%C3%A9l%C3%A9chargements/manifest(1).m3u8'

Potential duplicate: bug 2180891

Comment 1 Gael 2023-06-20 07:28:12 UTC
Created attachment 1971661 [details]
File: os_info

Comment 2 Gael 2023-06-20 07:28:13 UTC
Created attachment 1971662 [details]
File: environ

Comment 3 Gael 2023-06-20 07:28:15 UTC
Created attachment 1971663 [details]
File: mountinfo

Comment 4 Gael 2023-06-20 07:28:16 UTC
Created attachment 1971664 [details]
File: open_fds

Comment 5 Gael 2023-06-20 07:28:18 UTC
Created attachment 1971665 [details]
File: namespaces

Comment 6 Gael 2023-06-20 07:28:19 UTC
Created attachment 1971666 [details]
File: backtrace

Comment 7 Gael 2023-06-20 07:28:21 UTC
Created attachment 1971667 [details]
File: cpuinfo

Comment 8 Davide Repetto 2023-07-01 17:12:19 UTC
Crash happens while dragging an icon to the terminal.

Upstream is already fixed.


reporter:       libreport-2.17.10
kernel:         6.3.8-200.fc38.x86_64
cmdline:        /usr/bin/python3 -sP /usr/bin/terminator --layout=ReD
cgroup:         0::/user.slice/user-1000.slice/session-2.scope
uid:            1000
reason:         terminal.py:1697:feed:AttributeError: 'bytes' object has no attribute 'encode'
executable:     /usr/bin/terminator
type:           Python3
package:        terminator-2.1.3-1.fc38
runlevel:       N 5
exception_type: AttributeError
crash_function: feed
interpreter:    python3-3.11.4-1.fc38.x86_64

Comment 9 Davide Repetto 2023-07-02 08:01:41 UTC
Crash happens while dragging an icon to the terminal.
Upstream is already fixed.

The following is a very quick workaround while waiting for the upstream mods to trickle in:

$ sudo sed -i 's/self.vte.feed_child(text.encode())/self.vte.feed_child(text)/' /usr/lib/python3.11/site-packages/terminatorlib/terminal.p


reporter:       libreport-2.17.11
kernel:         6.3.8-200.fc38.x86_64
cmdline:        /usr/bin/python3 -sP /usr/bin/terminator --layout=ReD
cgroup:         0::/user.slice/user-1000.slice/session-2.scope
uid:            1000
reason:         terminal.py:1697:feed:AttributeError: 'bytes' object has no attribute 'encode'
executable:     /usr/bin/terminator
type:           Python3
package:        terminator-2.1.3-1.fc38
runlevel:       N 5
exception_type: AttributeError
crash_function: feed
interpreter:    python3-3.11.4-1.fc38.x86_64