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

utils.py: Workaround TypeError with Python 2.7.13 in Windows #12085

Merged
merged 1 commit into from
Feb 11, 2017
Merged

utils.py: Workaround TypeError with Python 2.7.13 in Windows #12085

merged 1 commit into from
Feb 11, 2017

Conversation

wiiaboo
Copy link
Contributor

@wiiaboo wiiaboo commented Feb 11, 2017

In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:

  • I am the original author of this code and I am willing to release it under Unlicense

What is the purpose of your pull request?

  • Bug fix

Fixes #11540
More exactly it's a workaround, not a fix, but people shouldn't be forced to use a months old version just because of a TypeError in a LoadLibrary that isn't even relevant in Windows.

Also recommend using Python2 for the official builds, since using 3.4.4 (more than a year old) is probably one of the bigger reasons why this error is so prevalent in Windows lately.

@yan12125
Copy link
Collaborator

Thanks for opening this. How many Python versions have you tested?

@wiiaboo
Copy link
Contributor Author

wiiaboo commented Feb 11, 2017

Well, the TypeError only triggers with Windows, so I tested with 2.7.12 (clean install), which triggered the OSError and carried on fine, and 2.7.13 (clean install), which triggers the TypeError and also carried on fine.

@yan12125
Copy link
Collaborator

It's less likely to break existing codes than the str() approach, so I guess it's safe to merge it. Could you add some comments for TypeError?

Fixes #11540

Tested with Windows Python 2.7.12 and 2.7.13.
@wiiaboo
Copy link
Contributor Author

wiiaboo commented Feb 11, 2017

Ran py -2 --version before to make sure it was using the right versions each time, too; then tested running youtube-dl with py -2 -m youtube_dl.

@wiiaboo
Copy link
Contributor Author

wiiaboo commented Feb 11, 2017

Should I open a issue asking for the official builds to switch to using Python 2 instead of 3.4.4?

@wiiaboo
Copy link
Contributor Author

wiiaboo commented Feb 11, 2017

The fix would only need to be more involved were LoadLibrary be needed for a Windows lib, but this is the only use of it in Youtube-DL.

@dstftw
Copy link
Collaborator

dstftw commented Feb 11, 2017

Official builds won't switch to python 2 since this brings encoding issues. Actually switch to python 3 from python 2 has taken place due to this.

@wiiaboo
Copy link
Contributor Author

wiiaboo commented Feb 11, 2017

So the only fix for official builds with SSL errors is to use --no-check-certificate? How's #10014 proceeding?

@dstftw
Copy link
Collaborator

dstftw commented Feb 11, 2017

Most of the SSL errors reported are due to expired certificates in system store removing which fixes the problem.

@wiiaboo
Copy link
Contributor Author

wiiaboo commented Feb 11, 2017

There's no expired certificates on my system store and I can consistently reproduce the SSL errors with 3.4.4.

If there were issues with expired certificates wouldn't the error also happen with every other Python version?

@yan12125 yan12125 merged commit f391545 into ytdl-org:master Feb 11, 2017
yan12125 pushed a commit that referenced this pull request Feb 11, 2017
@yan12125
Copy link
Collaborator

I can consistently reproduce the SSL errors with 3.4.4

There are tons of reasons leading to SSL failures; that's why I propose http://bugs.python.org/issue28182

@wiiaboo wiiaboo deleted the python2 branch February 11, 2017 21:11
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.

Downloads fail on Windows with Python 2.7.13
3 participants