Skip to content

hasattr(open,'newlines') example gives incorrect results from PEP0278 #52808

Closed

Description

@adamnelson
BPO 8562
Nosy @birkenfeld

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-08-02.19:50:25.970>
created_at = <Date 2010-04-28.19:45:38.696>
labels = ['type-bug', 'OS-windows', 'docs']
title = "hasattr(open,'newlines') example gives incorrect results from  PEP0278"
updated_at = <Date 2010-08-02.19:50:25.969>
user = 'https://bugs.python.org/adamnelson'

bugs.python.org fields:

activity = <Date 2010-08-02.19:50:25.969>
actor = 'georg.brandl'
assignee = 'docs@python'
closed = True
closed_date = <Date 2010-08-02.19:50:25.970>
closer = 'georg.brandl'
components = ['Documentation', 'Windows']
creation = <Date 2010-04-28.19:45:38.696>
creator = 'adamnelson'
dependencies = []
files = []
hgrepos = []
issue_num = 8562
keywords = []
message_count = 2.0
messages = ['104454', '112530']
nosy_count = 5.0
nosy_names = ['georg.brandl', 'docs@python', 'adamnelson', 'Matt.Wartell', 'David.Antliff']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue8562'
versions = ['Python 2.6']

Activity

  1. adamnelson commented on Apr 28, 2010

    adamnelsonmannequin
    MannequinAuthor

    This bug from the Ubuntu list is being moved here:

    https://bugs.launchpad.net/ubuntu/+source/python-defaults/+bug/570737

    Newlines support is enabled on Ubuntu but the example from:

    http://www.python.org/dev/peps/pep-0278/

    Does not give the correct results (of True):

        if hasattr(open, 'newlines'):
                print 'We have universal newline support'

    I don't know if this is a documentation problem or whether there is another attr that matters here.

  2. birkenfeld commented on Aug 2, 2010

    @birkenfeld
    Member

    Fixed in r83556.

  3. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-windowsdocsDocumentation in the Doc dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions