adamzap / landslide

Generate HTML5 slideshows from markdown, ReST, or textile
Apache License 2.0
2.09k stars 369 forks source link

Error: path is on mount 'c:', start on mount 'D:' #217

Open Pit-Storm opened 5 years ago

Pit-Storm commented 5 years ago

I'm using Anaconda3 on Windows 10. It's installed on Drive C. My .md file is on Drive D and the Destination should got to drive D. I have an .cfg-file to configure the rendering. Landslide ver 1.1.6

The cfg contains: [landslide] source = D:\\git-repos\mueller.pet\workshop-git-docker\02_workshop.md destination = D:\\git-repos\mueller.pet\workshop-git-docker\02_workshop.html relative = False linenos = table

I tried relative paths and paths with / instead \. Same error.

When I run the landslide command with name-of-cfg.cfg it show the following error:

Error: path is on mount 'c:', start on mount 'D:' With Debug output it is: Traceback (most recent call last): File "c:\users\mueller.pet\appdata\local\continuum\anaconda3\envs\landslide\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\users\mueller.pet\appdata\local\continuum\anaconda3\envs\landslide\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\mueller.pet\AppData\Local\Continuum\anaconda3\envs\landslide\Scripts\landslide.exe\__main__.py", line 9, in <module> File "c:\users\mueller.pet\appdata\local\continuum\anaconda3\envs\landslide\lib\site-packages\landslide\main.py", line 169, in main run(input_file, options) File "c:\users\mueller.pet\appdata\local\continuum\anaconda3\envs\landslide\lib\site-packages\landslide\main.py", line 160, in run generator.Generator(input_file, **options.__dict__).execute() File "c:\users\mueller.pet\appdata\local\continuum\anaconda3\envs\landslide\lib\site-packages\landslide\generator.py", line 208, in execute self.write_and_log() File "c:\users\mueller.pet\appdata\local\continuum\anaconda3\envs\landslide\lib\site-packages\landslide\generator.py", line 221, in write_and_log self.write() File "c:\users\mueller.pet\appdata\local\continuum\anaconda3\envs\landslide\lib\site-packages\landslide\generator.py", line 545, in write html = self.render() File "c:\users\mueller.pet\appdata\local\continuum\anaconda3\envs\landslide\lib\site-packages\landslide\generator.py", line 502, in render context = self.get_template_vars(slides) File "c:\users\mueller.pet\appdata\local\continuum\anaconda3\envs\landslide\lib\site-packages\landslide\generator.py", line 418, in get_template_vars 'css': self.get_css(), 'js': self.get_js(), File "c:\users\mueller.pet\appdata\local\continuum\anaconda3\envs\landslide\lib\site-packages\landslide\generator.py", line 314, in get_css 'path_url': utils.get_path_url(print_css, self.relative), File "c:\users\mueller.pet\appdata\local\continuum\anaconda3\envs\landslide\lib\site-packages\landslide\utils.py", line 12, in get_path_url return os.path.relpath(path) File "c:\users\mueller.pet\appdata\local\continuum\anaconda3\envs\landslide\lib\ntpath.py", line 562, in relpath path_drive, start_drive)) ValueError: path is on mount 'c:', start on mount 'D:'

How to solve this?

Pit-Storm commented 5 years ago

Referring to this discussion: https://bugs.python.org/issue7195

Meybe os.relpath() ist not the correct function to use when there are absolute paths. Espacially in windows context when you change over drives from python installation to data folders. But which one is the right one?

Pit-Storm commented 5 years ago

A local workaround could be:

This is really tweaky, but it works locally for every user individually