Skip to content
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

Patch backports configparser too #147

Merged
merged 1 commit into from
Mar 21, 2019
Merged

Conversation

KevinHock
Copy link
Collaborator

@KevinHock KevinHock commented Mar 21, 2019

🐛 Patch backports configparser too

We previously 🐒 patched configparser with EfficientParsingError to fix #136, however this did not patch the backports version present on Python 2.

The configparser README says If you’d like to use the backport on Python 2 and the built-in version on Python 3, then use the invocation that we were using, i.e. import configparser. However this doesn't work when monkey-patching, so I did the more explicit from backports import configparser.

We previously patched configparser with
`EfficientParsingError`, however this did
not patch the backports version present on
Python 2.
@KevinHock KevinHock requested a review from domanchi March 21, 2019 22:18
@KevinHock KevinHock merged commit 5d02f86 into master Mar 21, 2019
@KevinHock KevinHock deleted the fix_ini_perf_on_python_2 branch March 24, 2019 22:47
@KevinHock
Copy link
Collaborator Author

Hi @jaraco, just curious, why is it necessary to do a from style import here?

@jaraco
Copy link

jaraco commented May 14, 2019

It’s just that the backport exists as backports.configparser and that’s the only way to reliably get the backport, because if you import configparser, you’ll get the stdlib version of present or the backport otherwise.
Did that answer the question?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Slow performance when scanning a non ini file with millions of lines
2 participants