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

internal error on write while reading #50094

Closed
dsm001 mannequin opened this issue Apr 25, 2009 · 3 comments
Closed

internal error on write while reading #50094

dsm001 mannequin opened this issue Apr 25, 2009 · 3 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@dsm001
Copy link
Mannequin

dsm001 mannequin commented Apr 25, 2009

BPO 5844
Nosy @pitrou, @benjaminp
Files
  • write_while_reading_test.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 2009-05-14.22:02:14.074>
    created_at = <Date 2009-04-25.22:45:24.018>
    labels = ['interpreter-core', 'type-bug']
    title = 'internal error on write while reading'
    updated_at = <Date 2009-05-14.22:02:14.072>
    user = 'https://bugs.python.org/dsm001'

    bugs.python.org fields:

    activity = <Date 2009-05-14.22:02:14.072>
    actor = 'benjamin.peterson'
    assignee = 'none'
    closed = True
    closed_date = <Date 2009-05-14.22:02:14.074>
    closer = 'benjamin.peterson'
    components = ['Interpreter Core']
    creation = <Date 2009-04-25.22:45:24.018>
    creator = 'dsm001'
    dependencies = []
    files = ['13785']
    hgrepos = []
    issue_num = 5844
    keywords = ['patch']
    message_count = 3.0
    messages = ['86562', '86567', '87773']
    nosy_count = 3.0
    nosy_names = ['pitrou', 'dsm001', 'benjamin.peterson']
    pr_nums = []
    priority = 'critical'
    resolution = 'fixed'
    stage = 'needs patch'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue5844'
    versions = ['Python 3.1']

    @dsm001
    Copy link
    Mannequin Author

    dsm001 mannequin commented Apr 25, 2009

    Inspired by http://bugs.python.org/issue1653416 , I tried writing to a
    file opened for reading in 3.1 trunk, and found:

    Python 3.1a2+ (py3k:71900M, Apr 25 2009, 16:12:31) 
    [GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> fp = open('/etc/passwd')
    >>> fp.write('test')
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    SystemError: null argument to internal routine
    >>> print('test',file=fp)        
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    SystemError: null argument to internal routine

    but binary mode gives:

    >>> fp = open('/etc/passwd','rb')
    >>> fp.write(b'test')
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    io.UnsupportedOperation: write
    >>> print(b'test',file=fp)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    io.UnsupportedOperation: write

    @dsm001 dsm001 mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Apr 25, 2009
    @devdanzin devdanzin mannequin added the type-bug An unexpected behavior, bug, or error label Apr 25, 2009
    @dsm001
    Copy link
    Mannequin Author

    dsm001 mannequin commented Apr 25, 2009

    Added tests to py3k/Lib/test/test_file.py. Patch against py3k trunk @
    r71904.

    @benjaminp
    Copy link
    Contributor

    Fixed in r72649.

    @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
    interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant