-
-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Py3 upgrade and Pacer Refactoring #171
Merged
Changes from 12 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
378c78e
lots of changes to bring into line for Python 3.6 using six and other…
voutilad 796a5f5
found a possible fix for the unicode issue in py3. bit of a hack...bu…
voutilad 617d04f
added python 3.5 and 3.6 to travis file.
voutilad 761faee
turning off Debug in the title case test.
voutilad a531132
refixing the requirements to be exact versions for now. put a py2/3 c…
voutilad e002d20
set requests to new version that works locally. fixed an issue with t…
voutilad 53675ad
refactored cookie creation so be a bit more explicit in setting a coo…
voutilad 12cc908
bumped requests version back down to same version as CL for now.
voutilad 7674402
cleaned up setup.py and moved some test requirements out of base requ…
voutilad 40c77d1
relaxing error condition for logins
voutilad 4719f01
attempt to refactor PACER login to use central auth service while sti…
voutilad 679dd0d
slimming down the tests to focus on key functionality vs. breadth of …
voutilad 6d87ad5
changes to README.rst, minor tweaks related to code review.
voutilad f36106d
segregated python2 and python3 specific regex due to issues with unic…
voutilad 72a6e34
Merge branch 'master' into py3
voutilad 450ee17
added new exception class to distinguish bad pacer credentials, chang…
voutilad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
import six | ||
from math import ceil | ||
|
||
from dateutil.parser import _timelex, parser, parserinfo | ||
|
@@ -108,11 +109,11 @@ def parse_dates(s, debug=False, sane_start=datetime.datetime(1750, 1, 1), | |
|
||
# Ditch unicode (_timelex() flips out on unicode if the system has | ||
# cStringIO installed -- the default) | ||
if isinstance(s, unicode): | ||
s = s.encode('ascii', 'ignore') | ||
#if isinstance(s, six.text_type): | ||
# s = s.encode('ascii', 'ignore') | ||
|
||
# Fix misspellings | ||
for i, j in MISSPELLINGS.iteritems(): | ||
for i, j in six.iteritems(MISSPELLINGS): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't we just do |
||
s = s.replace(i, j) | ||
|
||
|
||
|
@@ -127,7 +128,7 @@ def parse_dates(s, debug=False, sane_start=datetime.datetime(1750, 1, 1), | |
hit_default_day_and_month = (d.month == DEFAULT.month and d.day == DEFAULT.day) | ||
if not any([hit_default_year, hit_default_day_and_month]): | ||
if debug: | ||
print "Item %s parsed as: %s" % (item, d) | ||
print("Item %s parsed as: %s" % (item, d)) | ||
if sane_start < d < sane_end: | ||
dates.append(d) | ||
except OverflowError: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to remember...but I believe it was doing nothing but cause problems since Py3 works fine with unicode and Py2 does better. I couldn't figure out the point of forcing things to ASCII as it didn't seem to impact the tests. Either I'm missing something or it's legacy stuff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. This code isn't used often, so we can leave this and uncomment it if needed.