getwindowsversion().major doesn't work with Python 2.6 #285

Closed
opened 2026-02-20 22:59:57 -05:00 by deekerman · 0 comments
Owner

Originally created by @Jamesc359 on GitHub (Aug 18, 2012).

Using named tuples needlessly breaks compatibility with versions of python <= 2.6

Changing line 313 from:
if sys.platform == 'win32' and sys.getwindowsversion().major >= 5:

To:
if sys.platform == 'win32' and sys.getwindowsversion()[0] >= 5:

fixes the issue.

youtube-dl --version
2012.02.27
python --version
Python 2.6.1
Windows Vista 64Bit

Originally created by @Jamesc359 on GitHub (Aug 18, 2012). Using named tuples needlessly breaks compatibility with versions of python <= 2.6 Changing line 313 from: if sys.platform == 'win32' and sys.getwindowsversion().major >= 5: To: if sys.platform == 'win32' and sys.getwindowsversion()[0] >= 5: fixes the issue. youtube-dl --version 2012.02.27 python --version Python 2.6.1 Windows Vista 64Bit
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl-ytdl-org#285
No description provided.