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

TextIOWrapper.seekable() always returns False #46535

Closed
netzhen mannequin opened this issue Mar 13, 2008 · 4 comments
Closed

TextIOWrapper.seekable() always returns False #46535

netzhen mannequin opened this issue Mar 13, 2008 · 4 comments
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@netzhen
Copy link
Mannequin

netzhen mannequin commented Mar 13, 2008

BPO 2282
Nosy @gvanrossum
Files
  • issue2282.diff: Fixes the seekable method and adds a test.
  • 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 2008-03-17.20:35:52.847>
    created_at = <Date 2008-03-13.04:32:29.745>
    labels = ['type-feature', 'library']
    title = 'TextIOWrapper.seekable() always returns False'
    updated_at = <Date 2008-03-17.20:35:52.846>
    user = 'https://bugs.python.org/netzhen'

    bugs.python.org fields:

    activity = <Date 2008-03-17.20:35:52.846>
    actor = 'ping'
    assignee = 'ping'
    closed = True
    closed_date = <Date 2008-03-17.20:35:52.847>
    closer = 'ping'
    components = ['Library (Lib)']
    creation = <Date 2008-03-13.04:32:29.745>
    creator = 'netzhen'
    dependencies = []
    files = ['9690']
    hgrepos = []
    issue_num = 2282
    keywords = ['patch']
    message_count = 4.0
    messages = ['63494', '63660', '63663', '63762']
    nosy_count = 4.0
    nosy_names = ['gvanrossum', 'ping', 'jeff.balogh', 'netzhen']
    pr_nums = []
    priority = 'high'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue2282'
    versions = ['Python 3.0']

    @netzhen
    Copy link
    Mannequin Author

    netzhen mannequin commented Mar 13, 2008

    The seekable() method of TextIOWrapper always returns False, for it
    does't override the seekable method of IOBase class in which just
    returns False. But, there is a method named _seekable(self) in
    TextIOWrapper(in io.py line 1211):
    def _seekable(self):
    return self._seekable
    which should be seekable(self), and _seekable method is overwrited by
    line 1190 in the __init__ method as a bool object:
    self._seekable = self._telling = self.buffer.seekable()

    @netzhen netzhen mannequin added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Mar 13, 2008
    @jeffbalogh
    Copy link
    Mannequin

    jeffbalogh mannequin commented Mar 17, 2008

    Attaching a patch that fixes this issue and adds a regression test.

    @gvanrossum
    Copy link
    Member

    Confirmed. Ping, since you're looking at io.py anyway, can you fix this
    too?

    @ping
    Copy link
    Mannequin

    ping mannequin commented Mar 17, 2008

    Patch committed.

    @ping ping mannequin closed this as completed Mar 17, 2008
    @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 type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant