#13622: Python Bindings: traceback in datetime.timestamp()
--------------------------------------+------------------------------
Reporter: rcrdnalor | Owner: rcrdnalor
Type: Bug Report - General | Status: assigned
Priority: minor | Milestone: 31.1
Component: Bindings - Python | Version: v31-fixes
Severity: medium | Keywords: Python timestamp
Ticket locked: 0 |
--------------------------------------+------------------------------
Using Python3.6, the following sequence works:
{{{
$ python3
Python 3.6.9 (default, Apr 18 2020, 01:56:04)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from MythTV import datetime
>>> t = datetime.now()
>>> t.timestamp()
1590160731.214045
}}}
In contrast, on Python3.8, this gives an error:
{{{
$ python3
Python 3.8.2 (default, Apr 27 2020, 15:53:34)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from MythTV import datetime
>>> t = datetime.now()
>>> t.timestamp()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/local-admin/MythTV/mythservices/MythTV/utility/dt.py", line
483, in timestamp
return ((utc_naive - utc_epoch).total_seconds())
TypeError: can't subtract offset-naive and offset-aware datetimes
}}}
Error reported on the MythTV forum:
https://forum.mythtv.org/viewtopic.php?f=6&t=3793
--
Ticket URL: <https://code.mythtv.org/trac/ticket/13622>
MythTV <http://www.mythtv.org>
MythTV Media Center
--------------------------------------+------------------------------
Reporter: rcrdnalor | Owner: rcrdnalor
Type: Bug Report - General | Status: assigned
Priority: minor | Milestone: 31.1
Component: Bindings - Python | Version: v31-fixes
Severity: medium | Keywords: Python timestamp
Ticket locked: 0 |
--------------------------------------+------------------------------
Using Python3.6, the following sequence works:
{{{
$ python3
Python 3.6.9 (default, Apr 18 2020, 01:56:04)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from MythTV import datetime
>>> t = datetime.now()
>>> t.timestamp()
1590160731.214045
}}}
In contrast, on Python3.8, this gives an error:
{{{
$ python3
Python 3.8.2 (default, Apr 27 2020, 15:53:34)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from MythTV import datetime
>>> t = datetime.now()
>>> t.timestamp()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/local-admin/MythTV/mythservices/MythTV/utility/dt.py", line
483, in timestamp
return ((utc_naive - utc_epoch).total_seconds())
TypeError: can't subtract offset-naive and offset-aware datetimes
}}}
Error reported on the MythTV forum:
https://forum.mythtv.org/viewtopic.php?f=6&t=3793
--
Ticket URL: <https://code.mythtv.org/trac/ticket/13622>
MythTV <http://www.mythtv.org>
MythTV Media Center