From 3b6b86521b6617ee45d06a06adf533c46bb570d0 Mon Sep 17 00:00:00 2001 From: guantion Date: Sat, 29 Feb 2020 10:46:19 +0800 Subject: fix log and breakpoint miss hit on win os --- python3/vdebug/log.py | 4 +++- python3/vdebug/util.py | 3 ++- 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): -- cgit v1.2.3