Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions third_party/py/rules_python.patch
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,24 @@ index 774c24d1..91e59f9b 100644
"3.13": "3.13.0",
}

diff --git a/python/private/python_bootstrap_template.txt b/python/private/python_bootstrap_template.txt
index 0f9c90b3..2a5e005a 100644
--- a/python/private/python_bootstrap_template.txt
+++ b/python/private/python_bootstrap_template.txt
@@ -52,8 +52,14 @@ def GetWindowsPathWithUNCPrefix(path):
# removed from common Win32 file and directory functions.
# Related doc: https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd#enable-long-paths-in-windows-10-version-1607-and-later
import platform
- if platform.win32_ver()[1] >= '10.0.14393':
- return path
+ try:
+ version = platform.win32_ver()[1]
+ except ValueError e:
+ if "invalid literal for int() with base 10" in str(e):
+ version = platform.win32_ver()[1]
+ finally:
+ if version >= '10.0.14393':
+ return path

# import sysconfig only now to maintain python 2.6 compatibility
import sysconfig