summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorguantion <guantion@bd.dev>2020-02-29 10:46:19 +0800
committerguantion <guantion@bd.dev>2020-02-29 10:46:19 +0800
commit3b6b86521b6617ee45d06a06adf533c46bb570d0 (patch)
treebb3e72e3b8d7e29fab2edcca3c5d5ed4a4548108
parent016679bc2edb9300d84e69c44dfa6bd9a13de1eb (diff)
downloadvdebug-3b6b86521b6617ee45d06a06adf533c46bb570d0.zip
fix log and breakpoint miss hit on win os
-rw-r--r--python3/vdebug/log.py4
-rw-r--r--python3/vdebug/util.py3
2 files changed, 5 insertions, 2 deletions
diff --git a/python3/vdebug/log.py b/python3/vdebug/log.py
index 5dadea3..7db9a5f 100644
--- a/python3/vdebug/log.py
+++ b/python3/vdebug/log.py
@@ -81,7 +81,7 @@ class FileLogger(Logger):
def __open(self):
try:
- self.f = open(self.filename, 'w')
+ self.f = open(self.filename, 'w', encoding='utf-8')
except IOError as e:
raise error.LogError("Invalid file name '%s' for log file: %s"
% (self.filename, e))
@@ -104,6 +104,8 @@ class Log:
loggers = {}
+
+
def __init__(self, string, level=Logger.INFO):
Log.log(string, level)
diff --git a/python3/vdebug/util.py b/python3/vdebug/util.py
index 4332e7e..09bf48f 100644
--- a/python3/vdebug/util.py
+++ b/python3/vdebug/util.py
@@ -278,7 +278,8 @@ class FilePath:
return self.local
def as_remote(self):
- return self.remote
+ # on win os backslash will cost breakpoint miss hit
+ return self.remote.replace('\\', '/') if self.is_win else self.remote
@staticmethod
def _findSeparator(path):