Skip to content

Cast not changes runtype type #802

@alex-eri

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.

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