mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
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:
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user