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

"raw" attribute of buffered IO objects is assignable #54959

Closed
pitrou opened this issue Dec 21, 2010 · 6 comments
Closed

"raw" attribute of buffered IO objects is assignable #54959

pitrou opened this issue Dec 21, 2010 · 6 comments
Labels
stdlib Python modules in the Lib dir topic-IO type-bug An unexpected behavior, bug, or error

Comments

@pitrou
Copy link
Member

pitrou commented Dec 21, 2010

BPO 10750
Nosy @amauryfa, @pitrou, @benjaminp
Files
  • io_roattrs.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 2010-12-21.21:27:11.586>
    created_at = <Date 2010-12-21.20:21:55.814>
    labels = ['type-bug', 'library', 'expert-IO']
    title = '"raw" attribute of buffered IO objects is assignable'
    updated_at = <Date 2010-12-21.21:27:11.585>
    user = 'https://github.com/pitrou'

    bugs.python.org fields:

    activity = <Date 2010-12-21.21:27:11.585>
    actor = 'pitrou'
    assignee = 'none'
    closed = True
    closed_date = <Date 2010-12-21.21:27:11.586>
    closer = 'pitrou'
    components = ['Library (Lib)', 'IO']
    creation = <Date 2010-12-21.20:21:55.814>
    creator = 'pitrou'
    dependencies = []
    files = ['20132']
    hgrepos = []
    issue_num = 10750
    keywords = ['patch']
    message_count = 6.0
    messages = ['124451', '124452', '124454', '124455', '124456', '124458']
    nosy_count = 3.0
    nosy_names = ['amaury.forgeotdarc', 'pitrou', 'benjamin.peterson']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue10750'
    versions = ['Python 3.1', 'Python 2.7', 'Python 3.2']

    @pitrou
    Copy link
    Member Author

    pitrou commented Dec 21, 2010

    This really looks backwards:

    >>> f = open("LICENSE", "rb")
    >>> f.name = "bar"
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    AttributeError: attribute 'name' of '_io.BufferedReader' objects is not writable
    >>> f.raw = None
    __main__:1: ResourceWarning: unclosed file <_io.FileIO name='LICENSE' mode='rb'>
    >>>

    @pitrou pitrou added stdlib Python modules in the Lib dir topic-IO type-bug An unexpected behavior, bug, or error labels Dec 21, 2010
    @pitrou
    Copy link
    Member Author

    pitrou commented Dec 21, 2010

    Here is a patch.

    @benjaminp
    Copy link
    Contributor

    2010/12/21 Antoine Pitrou <report@bugs.python.org>:

    Antoine Pitrou <pitrou@free.fr> added the comment:

    Here is a patch.

    I assume you can put test_readonly_attributes in CommonBufferTests?

    @pitrou
    Copy link
    Member Author

    pitrou commented Dec 21, 2010

    Le mardi 21 décembre 2010 à 20:36 +0000, Benjamin Peterson a écrit :

    Benjamin Peterson <benjamin@python.org> added the comment:

    2010/12/21 Antoine Pitrou <report@bugs.python.org>:
    >
    > Antoine Pitrou <pitrou@free.fr> added the comment:
    >
    > Here is a patch.

    I assume you can put test_readonly_attributes in CommonBufferTests?

    That's where it is :)

    @benjaminp
    Copy link
    Contributor

    Ah, I see. LGTM then.

    @pitrou
    Copy link
    Member Author

    pitrou commented Dec 21, 2010

    Thank you, committed in r87427 (3.2), r87428 (3.1) and r87429 (2.7).

    @pitrou pitrou closed this as completed Dec 21, 2010
    @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

    2 participants