Fix debugging with Python2 on Windows with non-English locale (PY-17409)

Standart normcase() function doesn't change case for non-English letters, so we should do it manually.
This commit is contained in:
Elizaveta Shashkova
2015-12-23 16:56:08 +03:00
parent 515d45f5d6
commit 0cc76b24ce
+11 -1
View File
@@ -42,6 +42,7 @@
from pydevd_constants import * #@UnusedWildImport
from _pydev_filesystem_encoding import getfilesystemencoding
import os.path
import sys
import traceback
@@ -72,6 +73,15 @@ PATHS_FROM_ECLIPSE_TO_PYTHON = []
normcase = os_normcase # May be rebound on set_ide_os
def norm_case(filename):
filename = os_normcase(filename)
if IS_PY3K:
return filename
enc = getfilesystemencoding()
return filename.decode(enc).lower().encode(enc)
def set_ide_os(os):
'''
We need to set the IDE os because the host where the code is running may be
@@ -82,7 +92,7 @@ def set_ide_os(os):
if os == 'UNIX':
normcase = lambda f:f #Change to no-op if the client side is on unix/mac.
else:
normcase = os_normcase
normcase = norm_case
# After setting the ide OS, apply the normcase to the existing paths.