From f62a118a3ab98ed17eb577f57fdb152c6ebdd25c 2013-08-07 22:45:38 From: Jonathan Frederic Date: 2013-08-07 22:45:38 Subject: [PATCH] Merge pull request #3943 from jdfreder/nbconvert_reveal_winfix nbconvert: Serve post-processor Windows fix --- diff --git a/IPython/nbconvert/post_processors/serve.py b/IPython/nbconvert/post_processors/serve.py index de16380..6d9b5fb 100644 --- a/IPython/nbconvert/post_processors/serve.py +++ b/IPython/nbconvert/post_processors/serve.py @@ -41,7 +41,8 @@ class ServePostProcessor(PostProcessorBase): try: dirname, filename = os.path.split(input) - os.chdir(dirname) + if dirname: + os.chdir(dirname) httpd = HTTPServer(('127.0.0.1', 8000), SimpleHTTPRequestHandler) sa = httpd.socket.getsockname() url = "http://" + sa[0] + ":" + str(sa[1]) + "/" + filename