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

Relative import iri2uri #163

Merged
merged 1 commit into from Apr 16, 2020
Merged

Relative import iri2uri #163

merged 1 commit into from Apr 16, 2020

Conversation

@eshokrgozar
Copy link
Contributor

@eshokrgozar eshokrgozar commented Apr 16, 2020

When using IronPython 2.7, importing httplib2 can raise an ImportError. It seems like a bug in IronPython but switching iri2uri's import to a relative import solves the issue and will still work in other python implementations.

I've put together a simplified example of the structure that can cause the import error in IronPython in code_structure.zip. It seems that under certain circumstances, once a relative import has been executed, the following absolute import does not search the local directory.

@codecov
Copy link

@codecov codecov bot commented Apr 16, 2020

Codecov Report

Merging #163 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #163   +/-   ##
=======================================
  Coverage   75.68%   75.68%           
=======================================
  Files           8        8           
  Lines        2616     2616           
=======================================
  Hits         1980     1980           
  Misses        636      636           
Impacted Files Coverage Δ
python2/httplib2/__init__.py 82.99% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 067b3f2...fa0c4d2. Read the comment docs.

@temoto
Copy link
Member

@temoto temoto commented Apr 16, 2020

  • What is SG-16899? Seems irrelevant here.
  • There is wrong #1 issue link in commit message.

Update: sorry, of course python3 already has it written as relative import.

@eshokrgozar
Copy link
Contributor Author

@eshokrgozar eshokrgozar commented Apr 16, 2020

I'm sorry. The SG-16899 reference and #1 were used for the commit on our own fork. Submitting a PR from that master branch carried the same info.

@temoto
Copy link
Member

@temoto temoto commented Apr 16, 2020

Please remove that if you want your commit merged intact. Otherwise I'd change commit message.

Fixes an ImportError when using IronPython 2.7
@eshokrgozar
Copy link
Contributor Author

@eshokrgozar eshokrgozar commented Apr 16, 2020

Done

@temoto temoto merged commit fa0c4d2 into httplib2:master Apr 16, 2020
3 checks passed
@temoto
Copy link
Member

@temoto temoto commented Apr 16, 2020

Thank you very much.

@temoto
Copy link
Member

@temoto temoto commented Apr 22, 2020

Released in 0.17.3

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

Successfully merging this pull request may close these issues.

None yet

2 participants