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

IsADirectoryError in datetime.py #829

Open
2 tasks done
darkfeline opened this issue May 26, 2024 · 0 comments
Open
2 tasks done

IsADirectoryError in datetime.py #829

darkfeline opened this issue May 26, 2024 · 0 comments

Comments

@darkfeline
Copy link

  • 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)

@darkfeline darkfeline changed the title IsADirectory error in datetime.py IsADirectoryError in datetime.py May 26, 2024
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

No branches or pull requests

1 participant