Open ronpandolfi opened 3 years ago
Modifying this default minimum datetime to the lowest possible timestamp value datetime(1970, 1, 1, tzinfo=LOCAL_TIMEZONE)
would fix this issue.
That's too bad, using ADA_LOVELACE_BIRTHDAY
was a nice touch of @JulReinhardt's.
Is it generically the case that time.localtime(timestamp + time.timezone).tm_isdst
just doesn't work on historical times, times before 1970?
I'm getting different behaviors on different environments. On 3.8.1
, time.localtime(-1)
breaks; on 3.9.2
it works.
Edit: added patch number to versions, fyi
Interesting. I guess our options are:
(2) would be unsatisfying but if no one finds time for (1) in the near future it’s fair to consider it.
@ronpandolfi I haven't had time to circle back to this yet. Do you have time to submit a PR? To put in writing what we agreed on the call, I'm fine with (2) for expedience but we should open a GitHub issue to track down the underlying problem. I suspect we are misusing an API. If times-before-1970 actually broke between Python releases I am sure it would be a Big Deal.
I had hoped to get to this myself, but it's not going to happen this week.
I have just seen this error for the first time use python 3.9.5, trying to run on Windows 10.
I am unable to start bluesky-widgets-demo because of it. I tried changing the default date to a time after the unix epoch so that it wasn't negative:
ADA_LOVELACE_BIRTHDAY = datetime(1970, 1, 2, tzinfo=LOCAL_TIMEZONE)
But then I get another error and still can't start the application:
QLayout: Attempting to add QLayout "" to QtSearchInput "", which already has a layout
c:\users\sissy_user\bluesky\bluesky-widgets\bluesky_widgets\models\search.py:128: PytzUsageWarning: The zone attribute is specific to pytz's interface; please migrate to a new time zone provider. For more details on how to do so, see https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html
timezone = tzlocal.get_localzone().zone
Traceback (most recent call last):
File "c:\users\sissy_user\bluesky\bluesky-widgets\bluesky_widgets\qt\threading.py", line 117, in run
self.returned.emit(result)
File "c:\users\sissy_user\bluesky\bluesky-widgets\bluesky_widgets\qt\threading.py", line 66, in __getattr__
return getattr(self._signals, name)
RuntimeError: wrapped C/C++ object of type WorkerBaseSignals has been deleted
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\sissy_user\bluesky\bluesky-widgets\bluesky_widgets\qt\threading.py", line 119, in run
self.errored.emit(exc)
File "c:\users\sissy_user\bluesky\bluesky-widgets\bluesky_widgets\qt\threading.py", line 66, in __getattr__
return getattr(self._signals, name)
RuntimeError: wrapped C/C++ object of type WorkerBaseSignals has been deleted
Is this a red herring? I am not really sure where to look the error message doesn't tell me much that I understand. @ronpandolfi in the original error report you mention that you only see this cause a crash in certain debugging modes. How do I find out what mode I am in?
I'm receiving the following error. Qt is able to recover from this normally, however (as a side effect) this causes a hard crash in certain debugging modes.
I've confirmed that datetime.utcoffset() is failing because timestamp is a negative value. Is
ADA_LOVELACE_BIRTHDAY
too far back? Here is a glimpse at the contents of thedatetime
var:@ihumphrey