Skip to content

Conversation

@pganssle
Copy link
Owner

@pganssle pganssle commented Apr 26, 2020

This will hopefully prevent any attempt to specify zoneinfo files outside of TZPATH.

This also makes the distinction between ZoneInfoNotFoundError, which is for missing keys and a plain ValueError, which is used for a key that we reject as invalid.

Right now I am not enforcing that the key be considered valid when passed to ZoneInfo.from_file(..., key=key) because that key is not used to look up any files (it's just the name for the zone), but maybe we should?

Fixes #44.

Maybe @tiran - would you be willing to take a look at this, since it is one of the only "security" things in PEP 615?

This will hopefully prevent any attempt to specify zoneinfo files
outside of TZPATH.
ZoneInfo constructors may raise ValueError if the input is an invalid
key (e.g. if it is invalid for security reasons) and
ZoneInfoNotFoundError if it is a theoretically acceptable key that does
not exist on the file system.
@pganssle pganssle merged commit ded22b8 into master Apr 28, 2020
@pganssle pganssle mentioned this pull request Apr 29, 2020
3 tasks
@pganssle pganssle deleted the relative_paths branch May 21, 2020 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enforce that all inputs are relative directories

2 participants