Skip to content

Cast not changes runtype type #802

Description

@alex-eri

If name set as string and longname not set there is exception in this part of code TypeError: can't concat str to bytes

name.longname = detail.encode('utf-8') + cast(bytes, name.filename)

In CPython cast do nothing

https://github.com/python/cpython/blob/1af025dd2206eecee3ee6242f2a7cdb67173fb97/Lib/typing.py#L2369-L2377

I suggest remove union types BytesOrStr as bytes always used in input params.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions