Skip to content

Commit

Permalink
Unicode bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Roth committed Jun 17, 2017
1 parent 124aa3f commit 8e4ba31
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/lokilogger.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import traceback
from helpers import removeNonAsciiDrop

__version__ = '0.21.1'
__version__ = '0.22.0'

# Logger Class -----------------------------------------------------------------
class LokiLogger():
Expand Down
17 changes: 10 additions & 7 deletions loki.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,9 @@ def scan_path(self, path):
# Skip marker
skipIt = False

# if 1 > 0:
# # test
# walk_error(OSError(2, u"[Error 3] System nie może odnaleźć określonej ścieżki", 'foo'))
# Unicode error test
#if 1 > 0:
# walk_error(OSError("[Error 3] No such file or directory"))

# User defined excludes
for skip in self.fullExcludes:
Expand Down Expand Up @@ -1223,10 +1223,13 @@ def updateLoki(sigsOnly):


def walk_error(err):
if "Error 3" in unicode(err):
logger.log('ERROR', unicode(err))
if args.debug:
traceback.print_exc()
try:
if "Error 3" in str(err):
logger.log('ERROR', removeNonAsciiDrop(str(err)))
elif args.debug:
print "Directory walk error"
except UnicodeError, e:
print "Unicode decode error in walk error message"


# CTRL+C Handler --------------------------------------------------------------
Expand Down

0 comments on commit 8e4ba31

Please sign in to comment.