Skip to content

IsADirectoryError in datetime.py #829

Open
@darkfeline

Description

@darkfeline
  • I am on the latest Pendulum version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • OS version and name: Arch Linux
  • Pendulum version: 3.0.0

Issue

  File "/home/ionasal/.local/share/python-venv/flexget/lib/python3.12/site-packages/flexget/utils/template.py", line 49, in extra_vars
    'now': CoercingDateTime.now(),
           │                └ <classmethod(<function DateTime.now at 0x76ec8339e5c0>)>
           └ <class 'flexget.utils.template.CoercingDateTime'>
  File "/home/ionasal/.local/share/python-venv/flexget/lib/python3.12/site-packages/pendulum/datetime.py", line 165, in now
    dt = datetime.datetime.now(local_timezone())
         │        │        │   └ <function local_timezone at 0x76ec8339d3a0>
         │        │        └ <method 'now' of 'datetime.datetime' objects>
         │        └ <class 'datetime.datetime'>
         └ <module 'datetime' from '/usr/lib/python3.12/datetime.py'>
  File "/home/ionasal/.local/share/python-venv/flexget/lib/python3.12/site-packages/pendulum/tz/__init__.py", line 51, in local_timezone
    return get_local_timezone()
           └ <function get_local_timezone at 0x76ec8336fc40>
  File "/home/ionasal/.local/share/python-venv/flexget/lib/python3.12/site-packages/pendulum/tz/local_timezone.py", line 33, in get_local_timezone
    tz = _get_system_timezone()
         └ <function _get_system_timezone at 0x76ec8339d080>
  File "/home/ionasal/.local/share/python-venv/flexget/lib/python3.12/site-packages/pendulum/tz/local_timezone.py", line 61, in _get_system_timezone
    return _get_unix_timezone()
           └ <function _get_unix_timezone at 0x76ec8339d260>
  File "/home/ionasal/.local/share/python-venv/flexget/lib/python3.12/site-packages/pendulum/tz/local_timezone.py", line 232, in _get_unix_timezone
    return Timezone(os.path.join(*tzpath_parts))
           │        │  │    │     └ ['Pacific']
           │        │  │    └ <function join at 0x76ec85918ae0>
           │        │  └ <module 'posixpath' (frozen)>
           │        └ <module 'os' (frozen)>
           └ <class 'pendulum.tz.timezone.Timezone'>
  File "/home/ionasal/.local/share/python-venv/flexget/lib/python3.12/site-packages/pendulum/tz/timezone.py", line 65, in __new__
    return super().__new__(cls, key)  # type: ignore[call-arg]
                           │    └ 'Pacific'
                           └ <class 'pendulum.tz.timezone.Timezone'>
  File "/usr/lib/python3.12/zoneinfo/_common.py", line 12, in load_tzdata
    return resources.files(package_name).joinpath(resource_name).open("rb")
           │         │     │                      └ 'Pacific'
           │         │     └ 'tzdata.zoneinfo'
           │         └ <function files at 0x76ec848ec360>
           └ <module 'importlib.resources' from '/usr/lib/python3.12/importlib/resources/__init__.py'>
  File "/usr/lib/python3.12/pathlib.py", line 1013, in open
    return io.open(self, mode, buffering, encoding, errors, newline)
           │  │    │     │     │          │         │       └ None
           │  │    │     │     │          │         └ None
           │  │    │     │     │          └ None
           │  │    │     │     └ -1
           │  │    │     └ 'rb'
           │  │    └ PosixPath('/home/ionasal/.local/share/python-venv/flexget/lib/python3.12/site-packages/tzdata/zoneinfo/Pacific')
           │  └ <built-in function open>
           └ <module 'io' (frozen)>
IsADirectoryError: [Errno 21] Is a directory: '/home/ionasal/.local/share/python-venv/flexget/lib/python3.12/site-packages/tzdata/zoneinfo/Pacific'

Seems to be an unfixed case of #256 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions