Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
py27 support for check
  • Loading branch information
da2x committed Sep 9, 2015
1 parent 643be7b commit f15f871
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions nikola/plugins/command/check.py
Expand Up @@ -323,8 +323,9 @@ def analyze(self, fname, find_sources=False, check_remote=False):
target_filename = os.path.abspath(
os.path.join(self.site.config['OUTPUT_FOLDER'], unquote(target.lstrip('/'))))
else: # Relative path
unquoted_target = unquote(target).encode('utf-8') if sys.version_info.major >= 3 else unquote(target).decode('utf-8')
target_filename = os.path.abspath(
os.path.join(os.path.dirname(filename), unquote(target)))
os.path.join(os.path.dirname(filename).encode('utf-8'), unquoted_target))

elif url_type in ('full_path', 'absolute'):
if url_type == 'absolute':
Expand All @@ -343,7 +344,7 @@ def analyze(self, fname, find_sources=False, check_remote=False):

elif target_filename not in self.existing_targets:
if os.path.exists(target_filename):
self.logger.notice("Good link {0} => {1}".format(target, target_filename))
self.logger.notice(u"Good link {0} => {1}".format(target, target_filename))
self.existing_targets.add(target_filename)
else:
rv = True
Expand All @@ -353,7 +354,7 @@ def analyze(self, fname, find_sources=False, check_remote=False):
self.logger.warn("\n".join(deps[filename]))
self.logger.warn("===============================\n")
except Exception as exc:
self.logger.error("Error with: {0} {1}".format(filename, exc))
self.logger.error(u"Error with: {0} {1}".format(filename, exc))
return rv

def scan_links(self, find_sources=False, check_remote=False):
Expand Down

0 comments on commit f15f871

Please sign in to comment.