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

Tools\Scripts\md5sum.py doesn't work in Python 3.x #66105

Closed
torrin mannequin opened this issue Jul 2, 2014 · 8 comments
Closed

Tools\Scripts\md5sum.py doesn't work in Python 3.x #66105

torrin mannequin opened this issue Jul 2, 2014 · 8 comments
Assignees
Labels
easy type-bug An unexpected behavior, bug, or error

Comments

@torrin
Copy link
Mannequin

torrin mannequin commented Jul 2, 2014

BPO 21906
Nosy @bitdancer, @berkerpeksag, @zware, @MojoVampire
Files
  • md5sum.diff
  • issue21906.diff
  • issue21906_v2.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/berkerpeksag'
    closed_at = <Date 2014-07-11.17:46:16.803>
    created_at = <Date 2014-07-02.15:38:52.202>
    labels = ['easy', 'type-bug']
    title = "Tools\\Scripts\\md5sum.py doesn't work in Python 3.x"
    updated_at = <Date 2014-07-11.18:31:29.286>
    user = 'https://bugs.python.org/torrin'

    bugs.python.org fields:

    activity = <Date 2014-07-11.18:31:29.286>
    actor = 'python-dev'
    assignee = 'berker.peksag'
    closed = True
    closed_date = <Date 2014-07-11.17:46:16.803>
    closer = 'berker.peksag'
    components = ['Demos and Tools']
    creation = <Date 2014-07-02.15:38:52.202>
    creator = 'torrin'
    dependencies = []
    files = ['35837', '35844', '35849']
    hgrepos = []
    issue_num = 21906
    keywords = ['patch', 'easy']
    message_count = 8.0
    messages = ['222109', '222110', '222116', '222150', '222218', '222273', '222769', '222776']
    nosy_count = 7.0
    nosy_names = ['r.david.murray', 'SilentGhost', 'python-dev', 'berker.peksag', 'zach.ware', 'josh.r', 'torrin']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue21906'
    versions = ['Python 3.4', 'Python 3.5']

    @torrin
    Copy link
    Mannequin Author

    torrin mannequin commented Jul 2, 2014

    md5sum.py uses at least 1 undefined object in Python 3.4.1. I only tried this on Windows. I have no idea if it is a problem on any other OS.

    C:\>C:\Python27\python.exe --version
    Python 2.7.6

    C:\>C:\Python34\python.exe --version
    Python 3.4.1

    C:\>C:\Python34\python.exe C:\Python34\Tools\Scripts\md5sum.py C:\Python34\python.exe
    Traceback (most recent call last):
      File "C:\Python34\Tools\Scripts\md5sum.py", line 90, in <module>
        sys.exit(main(sys.argv[1:], sys.stdout))
      File "C:\Python34\Tools\Scripts\md5sum.py", line 87, in main
        return sum(args, out)
      File "C:\Python34\Tools\Scripts\md5sum.py", line 27, in sum
        if files and isinstance(files[-1], file):
    NameError: name 'file' is not defined

    Here is why . . .

    C:\>C:\Python27\python.exe -c "print(file)"
    <type 'file'>

    C:\>C:\Python34\python.exe -c "print(file)"
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    NameError: name 'file' is not defined

    So "file" is defined in 2.7.6 but not in 3.4.1.

    @SilentGhost
    Copy link
    Mannequin

    SilentGhost mannequin commented Jul 2, 2014

    I guess it's only the evidence that it isn't being used.

    @SilentGhost SilentGhost mannequin changed the title Tools\Scripts\md5sum.py doesn't work in Python 3.4.1 on Windows 7 64bit. Tools\Scripts\md5sum.py doesn't work in Python 3.x Jul 2, 2014
    @bitdancer
    Copy link
    Member

    Well, at least one person *tried* to use it :)

    This is not a windows only problem, I can reproduce it on linux. Obviously we don't have tests for this tool.

    @bitdancer bitdancer added the easy label Jul 2, 2014
    @berkerpeksag
    Copy link
    Member

    Here's a path with tests.

    @berkerpeksag berkerpeksag added the type-bug An unexpected behavior, bug, or error label Jul 3, 2014
    @zware
    Copy link
    Member

    zware commented Jul 3, 2014

    Hmmm, I was just reloading the page to post a patch I'd worked up, and lo and behold there's already one here! Here's mine anyway; you can use any parts of it that you like, Berker. There are a couple of not-quite-related changes in test_tools that might be better split into a separate issue, but they're in there anyway.

    @berkerpeksag
    Copy link
    Member

    Thanks Zachary! Here's a combined patch.

    @berkerpeksag
    Copy link
    Member

    Thanks for the patch, Zachary.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 11, 2014

    New changeset eafe4007c999 by Berker Peksag in branch '3.4':
    Issue bpo-21906: Make Tools/scripts/md5sum.py work in Python 3.
    http://hg.python.org/cpython/rev/eafe4007c999

    New changeset e1913d2780d7 by Berker Peksag in branch 'default':
    Issue bpo-21906: Merge from 3.4.
    http://hg.python.org/cpython/rev/e1913d2780d7

    @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
    easy type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants