-
Notifications
You must be signed in to change notification settings - Fork 246
Fix urlretrieve issue on python2 #332
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
Conversation
I'm not involved with kivy-ios, but it would probably be helpful to explain why you are moving certain files to another location. Also, catching all exceptions from |
The file moves are because this diff is build on top of #331 (required to even get to the point where this bug is triggered), and so those parts will go away if and when #331 is is merged (and can be ignored for now). The bug being addressed is the code path that leads to the upstream bug in python-future, which is getting invoked here. I see no easy fix unless upstream accepts PythonCharmers/python-future#423 That being said, I should mark this a work in progress, at least for now |
@hackalog ah, but if it's such a specific known issue then you should definitely just catch |
Those suggestions are all legit. I had originally thought a drop-in one line replacement of requests for urlretrieve would do the trick, but FTP reared its ugly head. Let me work this up into a less heavy-handed form. |
that looks like a nice combination 😄 I like how it looks like now |
Yes, thanks for the feedback @Jonast . As far as crude workarounds go, it's looking almost forgivable now. :) |
FancyUrlopener.urlretrieve was failing on redirect, but in an insidious way, because of a bug in the python-future module: PythonCharmers/python-future#425 Replace with the requests module for the time being.
1aa517b
to
e7ec5d3
Compare
try: | ||
from pbxproj import XcodeProject | ||
from pbxproj.pbxextensions.ProjectFiles import FileOptions | ||
except ImportError: | ||
print("ERROR: pbxproj requirements is missing") | ||
print("ERROR: Python requirements are missing") |
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 changing this? Should i just say "missing pbxproj" instead?
The rest is good, but i don't understand this
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.
Ah, an interim version of the fix added the requests import here, so there were 2 packages being imported (learnleapfly@999dc68#diff-c3327fdae2ebcc6a34dc5a9d23ae9ffd) I neglected to change it back (sort of figuring more things might end up in requirements.txt before long)
@tito would you like me to change that Python->pbxproj string back, or does this look good to merge? |
Occasionally, when calling
urlretrieve()
on a url, a strange error is seen (#322) about a missingreadinto
. I think this is a bug in python-future (PythonCharmers/python-future#423) on Python 2. In the meantime, my workaround is to require and use therequests
module in kivy-ios in this failure case.While here, incorporate @Jonast's retry idea proposed in kivy/python-for-android#1574