Skip to content

Timezone file not found at /usr/local/lib/python3.6/site-packages/pytzdata/zoneinfo/ #531

@mayugene

Description

@mayugene

In some special cases, for example, in a docker image which contains python environment "https://github.com/rappdw/docker-java-python", the method _get_unix_timezone in '/pendulum/tz/local_timezone.py' will result in an error like Timezone file not found at /usr/local/lib/python3.6/site-packages/pytzdata/zoneinfo/.
When "etc/timezone" exists, it may contains the tzinfo like "Asia/shanghai" where the first letter of shanghai is not capitalized, but the file names in /usr/local/lib/python3.6/site-packages/pytzdata/zoneinfo/ are all in the title case.
Because the part for reading "etc/timezone" is just before the part of reading "/etc/localtime", _get_unix_timezone will go to find a file like "Asia/shanghai" and the bug will come up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions