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

test_urllib2 shouldn't use is operator for comparing strings #55083

Closed
Trundle mannequin opened this issue Jan 9, 2011 · 6 comments
Closed

test_urllib2 shouldn't use is operator for comparing strings #55083

Trundle mannequin opened this issue Jan 9, 2011 · 6 comments
Assignees
Labels
tests Tests in the Lib/test dir

Comments

@Trundle
Copy link
Mannequin

Trundle mannequin commented Jan 9, 2011

BPO 10874
Nosy @orsenthil, @pitrou, @merwok, @Trundle, @ambv
Files
  • test_urllib2.patch
  • test_urllib2.diff
  • 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 = 'https://github.com/orsenthil'
    closed_at = <Date 2011-01-14.20:30:26.942>
    created_at = <Date 2011-01-09.16:52:41.383>
    labels = ['tests']
    title = "test_urllib2 shouldn't use is operator for comparing strings"
    updated_at = <Date 2011-01-14.20:30:26.940>
    user = 'https://github.com/Trundle'

    bugs.python.org fields:

    activity = <Date 2011-01-14.20:30:26.940>
    actor = 'pitrou'
    assignee = 'orsenthil'
    closed = True
    closed_date = <Date 2011-01-14.20:30:26.942>
    closer = 'pitrou'
    components = ['Tests']
    creation = <Date 2011-01-09.16:52:41.383>
    creator = 'Trundle'
    dependencies = []
    files = ['20324', '20326']
    hgrepos = []
    issue_num = 10874
    keywords = ['patch']
    message_count = 6.0
    messages = ['125846', '125848', '125849', '125850', '126132', '126298']
    nosy_count = 6.0
    nosy_names = ['orsenthil', 'pitrou', 'eric.araujo', 'Trundle', 'SilentGhost', 'lukasz.langa']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue10874'
    versions = ['Python 3.1', 'Python 2.7', 'Python 3.2']

    @Trundle
    Copy link
    Mannequin Author

    Trundle mannequin commented Jan 9, 2011

    See the attached patch (applies to 2.7 and 3.2).

    @Trundle Trundle mannequin added the tests Tests in the Lib/test dir label Jan 9, 2011
    @SilentGhost
    Copy link
    Mannequin

    SilentGhost mannequin commented Jan 9, 2011

    Shouldn't that be:

    self.assertIs(req.type == "ftp", ftp)

    ?

    @merwok
    Copy link
    Member

    merwok commented Jan 9, 2011

    Actually, this block of tests may be outdated. Reading the comment above the list of (URIs, is_ftp) doubles makes you see that it was testing the automatic use of FTP in some file: URIs, a very dubious behavior that is now removed or deprecated. Senthil, I think a little cleanup is needed.

    @ambv
    Copy link
    Contributor

    ambv commented Jan 9, 2011

    Committed for py3k in r87895. Yup, could have been assertIs as well. The reason for the change is that "is" failed on PyPy.

    This should be backported to Python 2.7 as well.

    @SilentGhost
    Copy link
    Mannequin

    SilentGhost mannequin commented Jan 12, 2011

    Committed for 2.7 in r87964, for 3.1 in r87965.

    @pitrou
    Copy link
    Member

    pitrou commented Jan 14, 2011

    Łukasz, please close issues when they are fixed.

    @pitrou pitrou closed this as completed Jan 14, 2011
    @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
    tests Tests in the Lib/test dir
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants