Skip to content

Commit

Permalink
Merge pull request jupyter#502 from srinivasreddy/ipython_10053
Browse files Browse the repository at this point in the history
decode a string containing unicode chars to unicode
  • Loading branch information
Michael Pacer authored Jan 3, 2017
2 parents 4b2a3a2 + 0b56d42 commit 8967fa2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion nbconvert/exporters/exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,12 @@ def from_filename(self, filename, resources=None, **kw):
Ignored
"""

# Convert full filename string to unicode
# In python 2.7.x if filename comes as unicode string,
# just skip converting it.
if isinstance(filename, str):
filename = py3compat.str_to_unicode(filename)

# Pull the metadata from the filesystem.
if resources is None:
resources = ResourcesDict()
Expand Down
4 changes: 2 additions & 2 deletions nbconvert/exporters/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import os
import sys

from ipython_genutils.py3compat import which, cast_bytes_py2
from ipython_genutils.py3compat import which, cast_bytes_py2, getcwd
from traitlets import Integer, List, Bool, Instance, Unicode
from testpath.tempdir import TemporaryWorkingDirectory
from .latex import LatexExporter
Expand Down Expand Up @@ -165,7 +165,7 @@ def from_notebook_node(self, nb, resources=None, **kw):
if resources and resources.get('metadata', {}).get('path'):
self.texinputs = resources['metadata']['path']
else:
self.texinputs = os.getcwd()
self.texinputs = getcwd()

self._captured_outputs = []
with TemporaryWorkingDirectory():
Expand Down

0 comments on commit 8967fa2

Please sign in to comment.