Bug 1852941 - python3 prints traceback when exiting on read-only file system
Summary: python3 prints traceback when exiting on read-only file system
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: python3.9
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-07-01 16:07 UTC by Zbigniew Jędrzejewski-Szmek
Modified: 2020-07-02 18:21 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-07-02 09:58:13 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Zbigniew Jędrzejewski-Szmek 2020-07-01 16:07:22 UTC
Description of problem:
$ touch ~/foo
touch: cannot touch '/home/fedora/foo': Read-only file system
$ python
Python 3.9.0b3 (default, Jun 10 2020, 00:00:00) 
[GCC 10.1.1 20200507 (Red Hat 10.1.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> ^D
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib64/python3.9/site.py", line 462, in write_history
    readline.write_history_file(history)
OSError: [Errno 30] Read-only file system

Looking at /usr/lib64/python3.9/site.py, it already silently skips
PermissionError. It should handle EROFS the same.

Version-Release number of selected component (if applicable):
python3-3.9.0~b3-1.fc33.x86_64

Comment 1 Miro Hrončok 2020-07-01 16:47:42 UTC
Do I assume correctly that this is not a regression of 3.9?

Would you please report this upstream?

See also https://bugs.python.org/issue15833

Comment 2 Zbigniew Jędrzejewski-Szmek 2020-07-02 09:15:03 UTC
https://bugs.python.org/issue41193

Comment 3 Victor Stinner 2020-07-02 09:58:13 UTC
> https://bugs.python.org/issue41193

I proposed a fix upstream: https://github.com/python/cpython/pull/21279 If it's merged, it will be part of the next Python 3.9 release.

I don't think that we need to backport it earlier in Fedora. We can wait until the Fedora package will be rebased to the newer Python 3.9 version. So I close the issue as UPSTREAM.

Thanks for your bug report Zbigniew Jędrzejewski-Szmek!

In the meanwhile, you can safely ignore the error. You may be able to workaround the issue by overriding the HOME directory by setting HOME environment variable: use a temporary directory which can be modified.


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