-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
fixed redirection for download liblzma #2452
Conversation
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.
Thanks for the PR 🙏
But maybe then this would impact another package that doesn't handle it with Chrome.
I'm thinking maybe we should take another approach.
Either make this easily overridable per recipe, or hacking it around in liblzma recipe only.
Also what was the exact error you got with liblzma at Python level, was it a OSError
or something else?
How about when we do it with curl
what is returned (just for debugging purpose)
pythonforandroid/recipe.py
Outdated
@@ -213,7 +213,9 @@ def report_hook(index, blksize, size): | |||
while True: | |||
try: | |||
# jqueryui.com returns a 403 w/ the default user agent | |||
url_opener.addheaders = [('User-agent', 'Mozilla/5.0')] | |||
# url_opener.addheaders = [('User-agent', 'Mozilla/5.0')] |
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 would we keep this line commented rather than completely removing it?
```
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"Segoe UI Emoji";
panose-1:2 11 5 2 4 2 4 2 2 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
code
{mso-style-priority:99;
font-family:"Courier New";}
pre
{mso-style-priority:99;
mso-style-link:"HTML Vorformatiert Zchn";
margin:0cm;
font-size:10.0pt;
font-family:"Courier New";}
span.HTMLVorformatiertZchn
{mso-style-name:"HTML Vorformatiert Zchn";
mso-style-priority:99;
mso-style-link:"HTML Vorformatiert";
font-family:"Courier New";}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
-->
```
The html of the Internet page is returned because the redirection does not work. Subsequently, unzip is not possible. The line url_opener.addheaders = [('User-agent', 'Mozilla/5.0')] is new in the develop branch compared to the master branch. It works with the master branch. The comment can of course be omitted.
|
Setting the user agent to |
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.
Yeah let's give it a try.
Thanks @tshirtman for the review
liblzma was no longer loaded correctly. redirection not considered.