Fedora Account System
Red Hat Associate
Red Hat Customer
When running ipython from the command line, sys.path does not include the empty string for the current working directory: $ ipython In [1]: import sys In [2]: sys.path Out[2]: ['/usr/lib64/python314.zip', '/usr/lib64/python3.14', '/usr/lib64/python3.14/lib-dynload', '/usr/local/lib64/python3.14/site-packages', '/usr/lib64/python3.14/site-packages', '/usr/lib/python3.14/site-packages'] This is different from the behavior in Fedora 40 and what I think is expected. For example, running the default python REPL: $ python >>> import sys >>> sys.path ['', '/usr/lib64/python314.zip', '/usr/lib64/python3.14', '/usr/lib64/python3.14/lib-dynload', '/usr/local/lib64/python3.14/site-packages', '/usr/lib64/python3.14/site-packages', '/usr/lib/python3.14/site-packages'] Reproducible: Always Steps to Reproduce: 1. Run ipython 2. import sys 3. print(sys.path) Actual Results: ['/usr/lib64/python314.zip', '/usr/lib64/python3.14', '/usr/lib64/python3.14/lib-dynload', '/usr/local/lib64/python3.14/site-packages', '/usr/lib64/python3.14/site-packages', '/usr/lib/python3.14/site-packages'] Expected Results: ['', '/usr/lib64/python314.zip', '/usr/lib64/python3.14', '/usr/lib64/python3.14/lib-dynload', '/usr/local/lib64/python3.14/site-packages', '/usr/lib64/python3.14/site-packages', '/usr/lib/python3.14/site-packages']
Thank you for the report. I now see the root cause of this. We actually don't have to go that far, because it works as expected in Fedora 43 with ipython 8.37.0, but it does not work in Fedora 44 with ipython 9.9.0. The different behavior is caused by: https://github.com/ipython/ipython/commit/bb8b2bab0f68088b15a4da0cd7ec6e6bfcafd6c9 (released first in 9.7.0), where ipython got the ability to respect sys.flags.safe_path/-P/PYTHONSAFEPATH and "-P" is exactly what we have in generated /usr/bin/ipython: #! /usr/bin/python3 -P import sys from IPython import start_ipython if __name__ == '__main__': if sys.argv[0].endswith('.exe'): sys.argv[0] = sys.argv[0][:-4] sys.exit(start_ipython()) I believe having the CWD in sys.path is the correct thing here, so we have to find a way to bring it back. But there is one problem. The "-P" is there since this change has been implemented in Fedora 37: https://fedoraproject.org/wiki/Changes/PythonSafePath, and when I remove it from the shebang above, it adds '' (empty string representing CWD, good) as well as '/usr/bin' (not so good, that's what the Fedora change wanted to avoid) into sys.path. I'll discuss that with IPython developers and my colleagues, and we'll see.
Upstream report: https://github.com/ipython/ipython/issues/15214
I've created both upstream and downstream PRs. Could you please help me test it https://src.fedoraproject.org/rpms/ipython/pull-request/113 ?
Hi, how should I test the downstream PR? Is there an easy way to do that with dnf?
There is a rawhide scratch build as a part of the pull request: https://koji.fedoraproject.org/koji/taskinfo?taskID=146615143. And you can install the result via: dnf install https://kojipkgs.fedoraproject.org//work/tasks/5500/146615500/python3-ipython-9.14.1-2.fc45.noarch.rpm But it's for rawhide. Can you test it for rawhide, or should I open a new PR for F44 so you can test it on your system?
I fired up a VM with Fedora rawhide and verified that the default ipython doesn't include the current working directory, but after removing it and installing your update via: > dnf install https://kojipkgs.fedoraproject.org//work/tasks/5500/146615500/python3-ipython-9.14.1-2.fc45.noarch.rpm it does correctly include the current workign directory.
Thank you. I'm going to release this fix on top of the latest upstream release also for F44 so feel free to test the update once available.
FEDORA-2026-a3452cda6b (ipython-9.14.1-2.fc45) has been submitted as an update to Fedora 45. https://bodhi.fedoraproject.org/updates/FEDORA-2026-a3452cda6b
FEDORA-2026-a3452cda6b (ipython-9.14.1-2.fc45) has been pushed to the Fedora 45 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2026-8eacaf03b4 (ipython-9.14.1-2.fc44) has been submitted as an update to Fedora 44. https://bodhi.fedoraproject.org/updates/FEDORA-2026-8eacaf03b4
FEDORA-2026-8eacaf03b4 has been pushed to the Fedora 44 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-8eacaf03b4` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-8eacaf03b4 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2026-8eacaf03b4 (ipython-9.14.1-2.fc44) has been pushed to the Fedora 44 stable repository. If problem still persists, please make note of it in this bug report.