You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the issues of this repo and believe that this is not a duplicate.
OS version and name: This is a docker container, so the output of cat /proc/version is this: Linux version 5.4.0-1071-aws (buildd@lcy02-amd64-020) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04))
Pendulum version: 2.1.2
Issue
In a docker container with no timezone configuration (presumably), from_format errors out when passing in the timezone parameter. For example, this line from the docs: pendulum.from_format('1975-05-21 22', 'YYYY-MM-DD HH', tz='Europe/London') will spit out the error RuntimeError: Unable to find any timezone configuration. This same behavior happens when I try to run something like pendulum.now() with no arguments which makes sense because I'm assuming it's trying to get the local time but can't. In our docker container we strictly do not want anything to use local time when it's not needed which is why there is no timezone configuration and I feel like it's completely unnecessary here. If I pass in the tz parameter it shouldn't need to rely on local time at all. Looking at the source code, I'm pretty sure this is because now() is being used here: https://github.com/sdispater/pendulum/blob/f1df7dc3f838bd4ab1075ba25c8b6ce5d8141995/pendulum/__init__.py#L238. I'd love to use pendulum in our production server given the ease of managing timezones, but this behavior is completely blocking it and rendering it unusable right now.
The text was updated successfully, but these errors were encountered:
ayoung19
changed the title
from_format tries to find the local timezone configuration when that shouldn't be needed
breaking: from_format tries errors out when there is no local timezone configuration but timezone is passed in
Apr 14, 2022
ayoung19
changed the title
breaking: from_format tries errors out when there is no local timezone configuration but timezone is passed in
breaking: from_format errors out when there is no local timezone configuration but timezone is passed in
Apr 19, 2022
cat /proc/version
is this: Linux version 5.4.0-1071-aws (buildd@lcy02-amd64-020) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04))Issue
In a docker container with no timezone configuration (presumably),
from_format
errors out when passing in the timezone parameter. For example, this line from the docs:pendulum.from_format('1975-05-21 22', 'YYYY-MM-DD HH', tz='Europe/London')
will spit out the errorRuntimeError: Unable to find any timezone configuration
. This same behavior happens when I try to run something likependulum.now()
with no arguments which makes sense because I'm assuming it's trying to get the local time but can't. In our docker container we strictly do not want anything to use local time when it's not needed which is why there is no timezone configuration and I feel like it's completely unnecessary here. If I pass in thetz
parameter it shouldn't need to rely on local time at all. Looking at the source code, I'm pretty sure this is becausenow()
is being used here: https://github.com/sdispater/pendulum/blob/f1df7dc3f838bd4ab1075ba25c8b6ce5d8141995/pendulum/__init__.py#L238. I'd love to use pendulum in our production server given the ease of managing timezones, but this behavior is completely blocking it and rendering it unusable right now.The text was updated successfully, but these errors were encountered: