Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dateutil/dateutil
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.7.0
Choose a base ref
...
head repository: dateutil/dateutil
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2.7.1
Choose a head ref

Commits on Mar 11, 2018

  1. Fix license trove classifier

    pganssle committed Mar 11, 2018

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4c4c7e9 View commit details

Commits on Mar 12, 2018

  1. Merge pull request #630 from pganssle/update_trove

    Fix license trove classifier
    pganssle authored Mar 12, 2018
    Copy the full SHA
    372783d View commit details
  2. Copy the full SHA
    5f2052f View commit details

Commits on Mar 13, 2018

  1. Merge pull request #636 from pganssle/decimal_conversion

    Catch non-ValueError exceptions in decimal
    pganssle authored Mar 13, 2018
    Copy the full SHA
    231c7e3 View commit details
  2. require UTC for UNTIL when DTSTART is timezone-aware

    related: #620
    related: #633
    ryanpetrello committed Mar 13, 2018
    1
    Copy the full SHA
    efba12d View commit details

Commits on Mar 14, 2018

  1. Merge pull request #634 from ryanpetrello/fix-633

    require UTC for UNTIL when DTSTART is timezone-aware
    pganssle authored Mar 14, 2018
    Copy the full SHA
    a09c9d6 View commit details

Commits on Mar 24, 2018

  1. Update license metadata

    pganssle committed Mar 24, 2018
    Copy the full SHA
    7ac48be View commit details
  2. Update gitignore

    pganssle committed Mar 24, 2018
    Copy the full SHA
    ce9f79a View commit details
  3. Merge pull request #644 from pganssle/housekeeping

    Update license and gitignore
    pganssle authored Mar 24, 2018
    Copy the full SHA
    3e06e86 View commit details
  4. Update tzdata to 2018d

    pganssle committed Mar 24, 2018
    Copy the full SHA
    c5316bf View commit details
  5. Update test for 2018d

    pganssle committed Mar 24, 2018
    Copy the full SHA
    4ef5212 View commit details
  6. Merge pull request #643 from pganssle/update_2018

    Update tzdata to 2018d
    pganssle authored Mar 24, 2018
    Copy the full SHA
    3b51c98 View commit details
  7. Add towncrier configuration

    pganssle committed Mar 24, 2018
    Copy the full SHA
    bf1a79f View commit details
  8. Copy the full SHA
    b499ef2 View commit details
  9. Merge pull request #645 from pganssle/towncrier

    Add towncrier for changelog management
    pganssle authored Mar 24, 2018
    Copy the full SHA
    5ee1b66 View commit details
  10. Copy the full SHA
    9838036 View commit details
  11. Merge pull request #646 from pganssle/add_changelog

    Add changelog entries for changes since 2.7.0
    pganssle authored Mar 24, 2018
    Copy the full SHA
    261e9d5 View commit details
  12. Copy the full SHA
    6c03246 View commit details
  13. Add changelog for 648

    pganssle committed Mar 24, 2018
    Copy the full SHA
    52d2f7c View commit details
  14. Merge pull request #648 from pganssle/setup_readme

    Add README.rst as long_description
    pganssle authored Mar 24, 2018
    Copy the full SHA
    5bdea8d View commit details
  15. Copy the full SHA
    c0ea860 View commit details
  16. Fix RST renderer for PyPI

    pganssle committed Mar 24, 2018
    Copy the full SHA
    df06183 View commit details
  17. Merge pull request #649 from pganssle/release_2.7.1

    Release 2.7.1
    pganssle authored Mar 24, 2018
    Copy the full SHA
    370a0fa View commit details
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -2,10 +2,16 @@
__pycache__/
*.py[cod]


# Build detritus
build/
dist/
.eggs
*.egg-info/

# Test detritus
.tox/
.pytest_cache/

# Autogenerated version information
dateutil/_version.py
28 changes: 27 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -27,6 +27,32 @@ If you would like to fix something in `dateutil` - improvements to documentatio

The most important thing to include in your pull request are *tests* - please write one or more tests to cover the behavior you intend your patch to improve. Ideally, tests would use only the public interface - try to get 100% difference coverage using only supported behavior of the API.

#### Changelog
To keep users abreast of the changes to the module and to give proper credit, `dateutil` maintains a changelog, which is managed by [towncrier](https://github.com/hawkowl/towncrier). To add a changelog entry, make a new file called `<issue_no>.<type>.rst`, where `<issue_no>` is the number of the PR you've just made (it's easiest to add the changelog *after* you've created the PR so you'll have this number), and `<type>` is one of the following types:

- `feature`: A new feature, (e.g. a new function, method, attribute, etc)
- `bugfix`: A fix to a bug
- `doc`: A change to the documentation
- `deprecation`: Used if deprecating a feature or dropping support for a Python version.
- `misc`: A change that has no interesting effect for end users, such as fixes to the test suite or CI.

PRs that include a feature or bugfix *and* a deprecation should create a separate entry for the deprecation.



> {description of changes}. Reported by @{reporter} (gh issue #{issue\_no}). Fixed by @{patch submitter} (gh pr #{pr\_no})
An example changelog entry might be:

**581.bugfix.rst**
```
Fixed issue where the tz.tzstr constructor would erroneously succeed if passed
an invalid value for tzstr. Reported by @pganssle (gh issue #259). Fixed by
@pablogsal (gh pr #581)
```

For bugs reported and fixed by the same person use "Reported and fixed by @{patch submitter}". It is not necessary to create a github issue just for the purpose of mentioning it in the changelog, if the PR *is* the report, mentioning the PR is enough.

## License

Starting December 1, 2017, all contributions will be assumed to be released under a dual license - the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0) and the [3-Clause BSD License](https://opensource.org/licenses/BSD-3-Clause) unless otherwise specified in the pull request.
@@ -71,4 +97,4 @@ zoneinfo database, some tests will fail. Apart from that, all tests should pass.
To easily test dateutil against all supported Python versions, you can use
[tox](https://tox.readthedocs.io/en/latest/).

All GitHub pull requests are automatically tested using travis and appveyor.
All GitHub pull requests are automatically tested using travis and appveyor.
71 changes: 48 additions & 23 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
Version 2.7.1 (2018-03-24)
===========================

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


Version 2.7.0
----------
=============
- 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)
@@ -147,7 +172,7 @@ Version 2.7.0
- Cleaned up various dead links in the documentation. (gh pr #602, #608, #618)

Version 2.6.1
-------------
=============
- 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.
@@ -179,7 +204,7 @@ Version 2.6.1
granularly.

Version 2.6.0
-------------
=============
- 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
@@ -244,7 +269,7 @@ Version 2.6.0


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)
@@ -254,13 +279,13 @@ Version 2.5.3
- Fixed incorrect version in documentation (gh issue #235, pr #243)

Version 2.5.2
-------------
=============
- Updated zoneinfo to 2016c
- Fixed parser bug where yearfirst and dayfirst parameters were not being
respected when no separator was present. (gh issue #81 and #217, pr #229)

Version 2.5.1
-------------
=============
- 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)
@@ -285,7 +310,7 @@ Version 2.5.1


Version 2.5.0
-------------
=============
- 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
@@ -375,7 +400,7 @@ Version 2.5.0


Version 2.4.2
-------------
=============
- 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.
@@ -388,7 +413,7 @@ Version 2.4.2


Version 2.4.1
-------------
=============

- Added explicit check for valid hours if AM/PM is specified in parser.
(gh pr #22, issue #21)
@@ -408,7 +433,7 @@ Version 2.4.1
- Updated zoneinfo to 2015a.

Version 2.4.0
-------------
=============

- Fix an issue with relativedelta and freezegun (lp:1374022)
- Fix tzinfo in windows for timezones without dst (lp:1010050, gh #2)
@@ -418,7 +443,7 @@ Version 2.4.0
including defusing some infinite loops (gh #4)

Version 2.3
-----------
===========

- Cleanup directory structure, moved test.py to dateutil/tests/test.py

@@ -434,7 +459,7 @@ Version 2.3
- New maintainer, together with new hosting: GitHub, Travis, Read-The-Docs

Version 2.2
-----------
===========

- Updated zoneinfo to 2013h

@@ -443,7 +468,7 @@ Version 2.2
- Bug with LANG=C fixed by Mike Gilbert

Version 2.1
-----------
===========

- New maintainer

@@ -455,7 +480,7 @@ Version 2.1


Version 2.0
-----------
===========

- Ported to Python 3, by Brian Jones. If you need dateutil for Python 2.X,
please continue using the 1.X series.
@@ -465,7 +490,7 @@ Version 2.0
details.

Version 1.5
-----------
===========

- As reported by Mathieu Bridon, rrules were matching the bysecond rules
incorrectly against byminute in some circumstances when the SECONDLY
@@ -480,13 +505,13 @@ Version 1.5


Version 1.4.1
-------------
=============

- Updated timezone information.


Version 1.4
-----------
===========

- Fixed another parser precision problem on conversion of decimal seconds
to microseconds, as reported by Erik Brown. Now these issues are gone
@@ -507,7 +532,7 @@ Version 1.4


Version 1.3
-----------
===========

- Fixed precision problem on conversion of decimal seconds to
microseconds, as reported by Skip Montanaro.
@@ -526,7 +551,7 @@ Version 1.3


Version 1.2
-----------
===========

- Now tzfile will round timezones to full-minutes if necessary,
since Python's datetime doesn't support sub-minute offsets.
@@ -539,7 +564,7 @@ Version 1.2


Version 1.1
-----------
===========

- Fixed rrule byyearday handling. Abramo Bagnara pointed out that
RFC2445 allows negative numbers.
@@ -553,7 +578,7 @@ Version 1.1


Version 1.0
-----------
===========

- Fixed parsing of XXhXXm formatted time after day/month/year
has been parsed.
@@ -562,7 +587,7 @@ Version 1.0


Version 0.9
-----------
===========

- Fixed pickling of timezone types, as reported by
Andreas Köhler.
@@ -591,7 +616,7 @@ Version 0.9


Version 0.5
-----------
===========

- Removed FREQ_ prefix from rrule frequency constants
WARNING: this breaks compatibility with previous versions.
Empty file added changelog.d/.gitignore
Empty file.
1 change: 1 addition & 0 deletions changelog.d/0633.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
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).
1 change: 1 addition & 0 deletions changelog.d/0634.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
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)
1 change: 1 addition & 0 deletions changelog.d/0643.data.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updated tzdata version to 2018d.
1 change: 1 addition & 0 deletions changelog.d/0644.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updated license metadata and trove classifiers (gh prs #630 and #644).
1 change: 1 addition & 0 deletions changelog.d/648.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added README contents to the setup.py metadata. (gh pr #648)
33 changes: 33 additions & 0 deletions changelog.d/template.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{% for section, _ in sections.items() %}
{% set underline = underlines[0] %}{% if section %}{{section}}
{{ underline * section|length }}{% set underline = underlines[1] %}

{% endif %}

{% if sections[section] %}
{% for category, val in definitions.items() if category in sections[section]%}
{{ definitions[category]['name'] }}
{{ underline * definitions[category]['name']|length }}

{% if definitions[category]['showcontent'] %}
{% for text, values in sections[section][category].items() %}
- {{ text }}
{% endfor %}

{% else %}
- {{ sections[section][category]['']|join(', ') }}

{% endif %}
{% if sections[section][category]|length == 0 %}
No significant changes.

{% else %}
{% endif %}

{% endfor %}
{% else %}
No significant changes.


{% endif %}
{% endfor %}
17 changes: 14 additions & 3 deletions dateutil/parser/_parser.py
Original file line number Diff line number Diff line change
@@ -836,7 +836,11 @@ def _parse(self, timestr, dayfirst=None, yearfirst=None, fuzzy=False,
def _parse_numeric_token(self, tokens, idx, info, ymd, res, fuzzy):
# Token is a number
value_repr = tokens[idx]
value = Decimal(value_repr)
try:
value = self._to_decimal(value_repr)
except Exception as e:
six.raise_from(ValueError('Unknown numeric token'), e)

len_li = len(value_repr)

len_l = len(tokens)
@@ -895,7 +899,7 @@ def _parse_numeric_token(self, tokens, idx, info, ymd, res, fuzzy):
elif idx + 2 < len_l and tokens[idx + 1] == ':':
# HH:MM[:SS[.ss]]
res.hour = int(value)
value = Decimal(tokens[idx + 2]) # TODO: try/except for this?
value = self._to_decimal(tokens[idx + 2]) # TODO: try/except for this?
(res.minute, res.second) = self._parse_min_sec(value)

if idx + 4 < len_l and tokens[idx + 3] == ':':
@@ -996,7 +1000,7 @@ def _find_hms_idx(self, idx, tokens, info, allow_jump):

def _assign_hms(self, res, value_repr, hms):
# See GH issue #427, fixing float rounding
value = Decimal(value_repr)
value = self._to_decimal(value_repr)

if hms == 0:
# Hour
@@ -1196,6 +1200,13 @@ def _assign_tzname(self, dt, tzname):

return dt

def _to_decimal(self, val):
try:
return Decimal(val)
except Exception as e:
msg = "Could not convert %s to decimal" % val
six.raise_from(ValueError(msg), e)


DEFAULTPARSER = parser()

Loading