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

traceback when exiting on read-only file system #85365

Closed
zbysz mannequin opened this issue Jul 2, 2020 · 7 comments
Closed

traceback when exiting on read-only file system #85365

zbysz mannequin opened this issue Jul 2, 2020 · 7 comments
Labels
3.8 only security fixes 3.9 only security fixes 3.10 only security fixes stdlib Python modules in the Lib dir

Comments

@zbysz
Copy link
Mannequin

zbysz mannequin commented Jul 2, 2020

BPO 41193
Nosy @vstinner, @miss-islington
PRs
  • bpo-41193: Ignore OSError in readline write_history() #21279
  • [3.9] bpo-41193: Ignore OSError in readline write_history() (GH-21279) #21280
  • [3.8] bpo-41193: Ignore OSError in readline write_history() (GH-21279) #21281
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2020-07-02.11:07:04.104>
    created_at = <Date 2020-07-02.09:13:51.247>
    labels = ['3.8', 'library', '3.9', '3.10']
    title = 'traceback when exiting on read-only file system'
    updated_at = <Date 2020-07-02.12:13:19.269>
    user = 'https://bugs.python.org/zbysz'

    bugs.python.org fields:

    activity = <Date 2020-07-02.12:13:19.269>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-07-02.11:07:04.104>
    closer = 'vstinner'
    components = ['Library (Lib)']
    creation = <Date 2020-07-02.09:13:51.247>
    creator = 'zbysz'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 41193
    keywords = ['patch']
    message_count = 7.0
    messages = ['372832', '372840', '372845', '372846', '372847', '372848', '372849']
    nosy_count = 4.0
    nosy_names = ['vstinner', 'zbysz', 'asottile', 'miss-islington']
    pr_nums = ['21279', '21280', '21281']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue41193'
    versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

    @zbysz
    Copy link
    Mannequin Author

    zbysz mannequin commented Jul 2, 2020

    [Originally reported as https://bugzilla.redhat.com/show_bug.cgi?id=1852941.]

    $ 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. If a user is running with the file system in ro mode,
    they almost certainly are aware of the fact, since this is done either
    on purpose or as a result of disk corruption, and the traceback from
    python is not useful. Suppression of PermissionError was added in b249966.

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

    @zbysz zbysz mannequin added 3.8 only security fixes 3.9 only security fixes 3.10 only security fixes labels Jul 2, 2020
    @vstinner
    Copy link
    Member

    vstinner commented Jul 2, 2020

    New changeset 0ab917e by Victor Stinner in branch 'master':
    bpo-41193: Ignore OSError in readline write_history() (GH-21279)
    0ab917e

    @miss-islington
    Copy link
    Contributor

    New changeset 53d2b71 by Miss Islington (bot) in branch '3.8':
    bpo-41193: Ignore OSError in readline write_history() (GH-21279)
    53d2b71

    @miss-islington
    Copy link
    Contributor

    New changeset 0b4c87e by Miss Islington (bot) in branch '3.9':
    bpo-41193: Ignore OSError in readline write_history() (GH-21279)
    0b4c87e

    @vstinner
    Copy link
    Member

    vstinner commented Jul 2, 2020

    Thanks Zbyszek for your bug report. It's now fixed in 3.8, 3.9 and master branches.

    @vstinner vstinner added the stdlib Python modules in the Lib dir label Jul 2, 2020
    @vstinner vstinner closed this as completed Jul 2, 2020
    @vstinner vstinner added the stdlib Python modules in the Lib dir label Jul 2, 2020
    @vstinner vstinner closed this as completed Jul 2, 2020
    @zbysz
    Copy link
    Mannequin Author

    zbysz mannequin commented Jul 2, 2020

    Wow, that was quick. Thanks!

    @vstinner
    Copy link
    Member

    vstinner commented Jul 2, 2020

    Well, two errors were already ignored (bpo-19891). I just made the "except" more generic. I don't think that we can do anything more useless than ignoring the error if the filesystem is read-only. I don't think that a warning would be useful.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes 3.9 only security fixes 3.10 only security fixes stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants