Bug 2247091 - ptpython errors on startup
Summary: ptpython errors on startup
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: ptpython
Version: 39
Hardware: Unspecified
OS: Linux
unspecified
urgent
Target Milestone: ---
Assignee: Carl George 🤠
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-10-30 16:05 UTC by Seirdy
Modified: 2023-11-10 01:45 UTC (History)
3 users (show)

Fixed In Version: ptpython-3.0.23-1.fc39
Clone Of:
Environment:
Last Closed: 2023-11-10 01:45:25 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Seirdy 2023-10-30 16:05:54 UTC
ptpython on Fedora 39 fails to start, with the following error:

```
 Traceback (most recent call last):
  File "/usr/bin/ptpython", line 8, in <module>
    sys.exit(run())
             ^^^^^
  File "/usr/lib/python3.12/site-packages/ptpython/entry_points/run_ptpython.py", line 206, in run
    embed(
  File "/usr/lib/python3.12/site-packages/ptpython/repl.py", line 713, in embed
    repl = PythonRepl(
           ^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/ptpython/repl.py", line 78, in __init__
    super().__init__(*a, **kw)
  File "/usr/lib/python3.12/site-packages/ptpython/python_input.py", line 375, in __init__
    self.ptpython_layout = PtPythonLayout(
                           ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/ptpython/layout.py", line 665, in __init__
    signature_toolbar(python_input),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/ptpython/layout.py", line 298, in signature_toolbar
    HasSignature(python_input) &
  File "/usr/lib/python3.12/site-packages/prompt_toolkit/filters/base.py", line 40, in __and__
    if other in self._and_cache:
                ^^^^^^^^^^^^^^^
AttributeError: 'HasSignature' object has no attribute '_and_cache'
```

Reproducible: Always

Steps to Reproduce:
1. Launch `/usr/bin/ptpython`



Appears to have been fixed in https://github.com/prompt-toolkit/ptpython/commit/1b7652d3f2fd35ea96789df60063516503811e68.

`@music:fedora.im` on Matrix claims that upgrading the package to 3.0.23 should fix the issue.

Comment 1 Ben Beasley 2023-10-30 16:14:29 UTC
I just did a quick experiment to check my claim, which was based on reading source code.

$ mock -r fedora-39-x86_64 --clean
$ mock -r fedora-39-x86_64 -i ptpython
$ mock -r fedora-39-x86_64 --chroot 'ptpython'
(same traceback reported above)

In a checkout of the rawhide branch from dist-git:
$ fedpkg --release f39 mockbuild
$ mock -r fedora-39-x86_64 --clean
$ mock -r fedora-39-x86_64 -i results_ptpython/3.0.23/1.fc39/ptpython3-3.0.23-1.fc39.noarch.rpm
$ mock -r fedora-39-x86_64 --chroot 'ptpython'
Warning: Input is not a terminal (fd=0).
$ mock -r fedora-39-x86_64 --shell
# ptpython
(expected interactive session)

So it looks like updating to 3.0.23 should indeed be a fix.

Comment 2 Fedora Update System 2023-11-01 20:05:50 UTC
FEDORA-2023-399d0c5963 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-399d0c5963

Comment 3 Fedora Update System 2023-11-02 01:49:02 UTC
FEDORA-2023-399d0c5963 has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-399d0c5963`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-399d0c5963

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 4 Fedora Update System 2023-11-10 01:45:25 UTC
FEDORA-2023-399d0c5963 has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.