Skip to content

IsADirectoryError while getting local timezone #256

Description

@aczapszys

Maybe related to 6ee68b9

I'm seeing an error with this test.py:

import pendulum
pendulum.now()
Traceback (most recent call last):
  File "test.py", line 2, in <module>
    pendulum.now()
  File "/mnt/iscsi/10_web_cem_dev/work/axc/cem-one-times/env/lib64/python3.6/site-packages/pendulum/__init__.py", line 207, in now
    dt = _datetime.datetime.now(local_timezone())
  File "/mnt/iscsi/10_web_cem_dev/work/axc/cem-one-times/env/lib64/python3.6/site-packages/pendulum/tz/__init__.py", line 59, in local_timezone
    return get_local_timezone()
  File "/mnt/iscsi/10_web_cem_dev/work/axc/cem-one-times/env/lib64/python3.6/site-packages/pendulum/tz/local_timezone.py", line 31, in get_local_timezone
    tz = _get_system_timezone()
  File "/mnt/iscsi/10_web_cem_dev/work/axc/cem-one-times/env/lib64/python3.6/site-packages/pendulum/tz/local_timezone.py", line 59, in _get_system_timezone
    return _get_unix_timezone()
  File "/mnt/iscsi/10_web_cem_dev/work/axc/cem-one-times/env/lib64/python3.6/site-packages/pendulum/tz/local_timezone.py", line 210, in _get_unix_timezone
    return Timezone('/'.join(tzpath))
  File "/mnt/iscsi/10_web_cem_dev/work/axc/cem-one-times/env/lib64/python3.6/site-packages/pendulum/tz/timezone.py", line 30, in __init__
    tz = read(name, extend=extended)
  File "/mnt/iscsi/10_web_cem_dev/work/axc/cem-one-times/env/lib64/python3.6/site-packages/pendulum/tz/zoneinfo/__init__.py", line 9, in read
    return Reader(extend=extend).read_for(name)
  File "/mnt/iscsi/10_web_cem_dev/work/axc/cem-one-times/env/lib64/python3.6/site-packages/pendulum/tz/zoneinfo/reader.py", line 52, in read_for
    return self.read(file_path)
  File "/mnt/iscsi/10_web_cem_dev/work/axc/cem-one-times/env/lib64/python3.6/site-packages/pendulum/tz/zoneinfo/reader.py", line 63, in read
    with open(file_path, 'rb') as fd:
IsADirectoryError: [Errno 21] Is a directory: '/mnt/iscsi/10_web_cem_dev/work/axc/cem-one-times/env/lib64/python3.6/site-packages/pytzdata/zoneinfo/Pacific'

This is the content of my /etc/sysconfig/clock:

ZONE="US/Pacific"

I think it should be trying to read env/lib64/python3.6/site-packages/pytzdata/zoneinfo/US/Pacific

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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