{"action":"closed","issue":{"url":"https://api.github.com/repos/bebraw/pypandoc/issues/54","labels_url":"https://api.github.com/repos/bebraw/pypandoc/issues/54/labels{/name}","comments_url":"https://api.github.com/repos/bebraw/pypandoc/issues/54/comments","events_url":"https://api.github.com/repos/bebraw/pypandoc/issues/54/events","html_url":"https://github.com/bebraw/pypandoc/issues/54","id":80196462,"number":54,"title":"pypandoc fails with: ValueError: stat: path too long for Windows","user":{"login":"MissingNoIOI","id":5873106,"avatar_url":"https://avatars.githubusercontent.com/u/5873106?v=3","gravatar_id":"","url":"https://api.github.com/users/MissingNoIOI","html_url":"https://github.com/MissingNoIOI","followers_url":"https://api.github.com/users/MissingNoIOI/followers","following_url":"https://api.github.com/users/MissingNoIOI/following{/other_user}","gists_url":"https://api.github.com/users/MissingNoIOI/gists{/gist_id}","starred_url":"https://api.github.com/users/MissingNoIOI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MissingNoIOI/subscriptions","organizations_url":"https://api.github.com/users/MissingNoIOI/orgs","repos_url":"https://api.github.com/users/MissingNoIOI/repos","events_url":"https://api.github.com/users/MissingNoIOI/events{/privacy}","received_events_url":"https://api.github.com/users/MissingNoIOI/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-24T15:59:21Z","updated_at":"2015-05-27T14:29:50Z","closed_at":"2015-05-27T14:29:50Z","body":"Hi, \r\nI wrote a small script using pypandoc, by passing it a preformatted string, and it works like a charm on Linux, but when I tried it on Windows it fails with the following Traceback:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \".\\PycharmProjects\\reddit2ebook\\reddit2ebook\\main.py\", line 101, in <module>\r\n    main()\r\n  File \".\\PycharmProjects\\reddit2ebook\\reddit2ebook\\main.py\", line 45, in main\r\n    create_ebook(text, directory, bookname)\r\n  File \".\\PycharmProjects\\reddit2\r\nebook\\reddit2ebook\\main.py\", line 96, in create_ebook\r\n    outputfile=directory + ebook_name + '.epub')\r\n  File \"C:\\Python34\\lib\\site-packages\\pypandoc.py\", line 94, in convert\r\n    outputfile=outputfile, filters=filters)\r\n  File \"C:\\Python34\\lib\\site-packages\\pypandoc.py\", line 99, in _convert\r\n    source, format = reader(source, format, encoding=encoding)\r\n  File \"C:\\Python34\\lib\\site-packages\\pypandoc.py\", line 140, in _read_file\r\n    path = os.path.exists(source)\r\n  File \"C:\\Python34\\lib\\genericpath.py\", line 19, in exists\r\n    os.stat(path)\r\nValueError: stat: path too long for Windows\r\n```\r\n\r\nIt seems that _read_file  tries to call os.path.exists() with the source to check if its a the path to a valid file or a string containing formatted text. While this works on *nix Systems, it fails on Windows due to the limit of 255 characters per path, which most texts easily surpass.\r\n\r\nFor now I could fix it by including:\r\n\r\n```\r\n    except ValueError:\r\n        path = ''\r\n```\r\nin line 142 after the try catch block"}}