Skip to content

UnicodeDecodeError on upload or register #235

@ghost

Description

When running the upload or register commands for Wheel packages containing a filename with non US characters on Python 2.7.12, a UnicodeDecodeError exception is raised here: https://github.com/pypa/twine/blob/master/twine/wheel.py#L69

ZipFile.namelist returns a list of strings and can't be compared to 'METADATA' which is a unicode literal.

Typecasting to string makes it work for Python 2.7.x and doesn't appear to cause regressions on Python 3.x

tuples = [x.split('/') for x in names if str('METADATA') in x]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions