8000 `str(Path(...))` can raise `TypeError` · Issue #134 · jaraco/zipp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
str(Path(...)) can raise TypeError #134
Open
@barneygale

Description

@barneygale

Downstream issue: python/cpython#100609

str(zipp.Path(...)) currently raises TypeError if the ZipFile object is initialised with a fileobj rather than a path. Given that object.__str__() doesn't raise, I think it's a bug that zipp.Path.__str__() does.

(Other zipp.Path attributes like filename, name and parent have the same behaviour, but they're not attributes of object, so it's less of an issue)

There's at least two possible solutions:

  1. Use a ":fileobj:" prefix for fileobj-backed zip files
  2. Use self.at with no prefix in all cases

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

      0