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

Normalize input path in zip isdir #83

Merged
merged 3 commits into from
Dec 2, 2019
Merged

Normalize input path in zip isdir #83

merged 3 commits into from
Dec 2, 2019

Conversation

belldandyxtq
Copy link
Member

The isdir simply forwards the input to stat and relies on stat
to normalize the input path.
To align with the behavior of os.path.isdir, False is returned when
the given file or directory does not exist.

@belldandyxtq belldandyxtq added cat:test test or ci related issue cat:feature Implementation that introduces new interfaces. labels Nov 20, 2019
@belldandyxtq belldandyxtq removed the cat:test test or ci related issue label Nov 20, 2019
The `isdir` simply forwards the input to `stat` and relies on `stat`
to normalize the input path.
To align with the behavior of `os.path.isdir`, False is returned when
the given file or directory does not exist.
@belldandyxtq belldandyxtq changed the title [WIP] Normalize input path in zip isdir Normalize input path in zip isdir Dec 2, 2019
Copy link
Member

@kuenishi kuenishi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although the underlying code does the same thing, official API has to be used. I would suggest using ZipInfo.is_dir() and make current implementation special workaround for Python < 3.6 which does not have is_dir().

@kuenishi kuenishi merged commit 7d571a7 into master Dec 2, 2019
@kuenishi kuenishi deleted the normalize_path_isdir branch December 2, 2019 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat:feature Implementation that introduces new interfaces.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants