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

io.FileIO.readall() is not 64-bit safe on Windows #60571

Closed
vstinner opened this issue Oct 30, 2012 · 4 comments
Closed

io.FileIO.readall() is not 64-bit safe on Windows #60571

vstinner opened this issue Oct 30, 2012 · 4 comments
Labels
stdlib Python modules in the Lib dir

Comments

@vstinner
Copy link
Member

BPO 16367
Nosy @pitrou, @vstinner
Files
  • fileio_readall.patch
  • 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 2013-01-03.02:43:49.831>
    created_at = <Date 2012-10-30.23:43:07.376>
    labels = ['library']
    title = 'io.FileIO.readall() is not 64-bit safe on Windows'
    updated_at = <Date 2013-01-03.02:43:49.829>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2013-01-03.02:43:49.829>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2013-01-03.02:43:49.831>
    closer = 'vstinner'
    components = ['Library (Lib)']
    creation = <Date 2012-10-30.23:43:07.376>
    creator = 'vstinner'
    dependencies = []
    files = ['27802']
    hgrepos = []
    issue_num = 16367
    keywords = ['patch']
    message_count = 4.0
    messages = ['174244', '174360', '178904', '178905']
    nosy_count = 3.0
    nosy_names = ['pitrou', 'vstinner', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue16367'
    versions = ['Python 2.7', 'Python 3.2', 'Python 3.3', 'Python 3.4']

    @vstinner
    Copy link
    Member Author

    The changeset 374dc910db33 fixed FileIO.readinto(), FileIO.write() and os.write() on Windows for issues bpo-9015, bpo-9611, but FileIO.readall() was not fixed and it has a similar bug.

    It uses "int n;" to store the result of read(), so FileIO.readall() may also fail to read a file longer than 2 GB on other platforms.

    Attached patch should fix both issues.

    @vstinner vstinner added the stdlib Python modules in the Lib dir label Oct 30, 2012
    @pitrou
    Copy link
    Member

    pitrou commented Oct 31, 2012

    Looks ok to me. Perhaps we could add a bigmem test for that (in test_fileio)?

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jan 3, 2013

    New changeset 9aba9ad6c15b by Victor Stinner in branch '3.2':
    Issue bpo-16367: Fix FileIO.readall() on Windows for files larger than 2 GB
    http://hg.python.org/cpython/rev/9aba9ad6c15b

    New changeset 5f96e4619ceb by Victor Stinner in branch '3.3':
    (Merge 3.2) Issue bpo-16367: Fix FileIO.readall() on Windows for files larger than 2 GB.
    http://hg.python.org/cpython/rev/5f96e4619ceb

    New changeset d81d4b3059e4 by Victor Stinner in branch 'default':
    (Merge 3.3) Issue bpo-16367: Fix FileIO.readall() on Windows for files larger than 2 GB.
    http://hg.python.org/cpython/rev/d81d4b3059e4

    New changeset f26c91bf61bf by Victor Stinner in branch '2.7':
    Issue bpo-16367: Fix FileIO.readall() on Windows for files larger than 2 GB
    http://hg.python.org/cpython/rev/f26c91bf61bf

    @vstinner
    Copy link
    Member Author

    vstinner commented Jan 3, 2013

    Perhaps we could add a bigmem test for that (in test_fileio)?

    Well, I'm too lazy to write such test. Instead of leaving the issue open for weeks, I prefer to commit my patch with no new test (sorry!).

    @vstinner vstinner closed this as completed Jan 3, 2013
    @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
    stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants