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

readline fails on nonblocking, unbuffered io.FileIO objects #58066

Closed
anacrolix mannequin opened this issue Jan 25, 2012 · 2 comments
Closed

readline fails on nonblocking, unbuffered io.FileIO objects #58066

anacrolix mannequin opened this issue Jan 25, 2012 · 2 comments
Labels
stdlib Python modules in the Lib dir topic-IO type-bug An unexpected behavior, bug, or error

Comments

@anacrolix
Copy link
Mannequin

anacrolix mannequin commented Jan 25, 2012

BPO 13858
Nosy @anacrolix
Superseder
  • bpo-13322: The io module doesn't support non-blocking files
  • 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 2012-01-25.08:22:32.059>
    created_at = <Date 2012-01-25.05:13:47.771>
    labels = ['type-bug', 'library', 'expert-IO']
    title = 'readline fails on nonblocking, unbuffered io.FileIO objects'
    updated_at = <Date 2012-01-25.08:22:32.050>
    user = 'https://github.com/anacrolix'

    bugs.python.org fields:

    activity = <Date 2012-01-25.08:22:32.050>
    actor = 'neologix'
    assignee = 'none'
    closed = True
    closed_date = <Date 2012-01-25.08:22:32.059>
    closer = 'neologix'
    components = ['Library (Lib)', 'IO']
    creation = <Date 2012-01-25.05:13:47.771>
    creator = 'anacrolix'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 13858
    keywords = []
    message_count = 2.0
    messages = ['151933', '151935']
    nosy_count = 2.0
    nosy_names = ['anacrolix', 'neologix']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '13322'
    type = 'behavior'
    url = 'https://bugs.python.org/issue13858'
    versions = ['Python 3.3']

    @anacrolix
    Copy link
    Mannequin Author

    anacrolix mannequin commented Jan 25, 2012

    _io._IOBase.readline doesn't seem to like _io.FileIO.read returning None, which occurs when it's unbuffered and nonblocking. (Modules/_io/fileio.c:745 in trunk). Can this be handled some other way?

    $ python3.3
    Python 3.3.0a0 (default:fb0f4fe8123e+, Jan 24 2012, 11:21:36) 
    [GCC 4.6.2] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import os, io
    >>> r, w = os.pipe2(os.O_NONBLOCK)
    >>> f = io.open(r, 'rb', 0)
    >>> f.readline()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    OSError: read() should have returned a bytes object, not 'NoneType'

    @anacrolix anacrolix mannequin added stdlib Python modules in the Lib dir topic-IO type-bug An unexpected behavior, bug, or error labels Jan 25, 2012
    @neologix
    Copy link
    Mannequin

    neologix mannequin commented Jan 25, 2012

    Can this be handled some other way?

    Yeah, that's an hairy issue.
    See bpo-13322 for the details.

    @neologix neologix mannequin closed this as completed Jan 25, 2012
    @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 topic-IO type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    0 participants