Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with saving as directory #589

Closed
eternalsage opened this issue May 29, 2019 · 2 comments
Closed

Issue with saving as directory #589

eternalsage opened this issue May 29, 2019 · 2 comments

Comments

@eternalsage
Copy link

eternalsage commented May 29, 2019

Working on Windows 10, have laid out my outline and copied in the relevant information from my previous google docs version, then realized I had forgotten to change to directory mode ("save to single file" was still clicked on). When I clicked this off and hit save it crashed.

It has now crashed numerous times. I'm not sure if it is a bug, an installation issue, or even just a file problem. BTW I thought it might be because of the length of file/folder names and the depth of files, but I moved the files to the base of a different drive and it seems to die in the same place. The output from commandline is below.

C:\Users\Jason\manuskript-0.9.0-win32>manuskript.exe
Debug: Web rendering engine used: QWebView
Running manuskript version 0.9.0.
Note: No translator found or loaded from system locale for locale en_US.
Loading: E:/Drive/Manuskript/VERS_BaseRules.msk
Detected file format version: 1. Zip: True.
Project E:/Drive/Manuskript/VERS_BaseRules.msk loaded.
Traceback (most recent call last):
  File "manuskript\mainWindow.py", line 765, in saveDatas
  File "manuskript\loadSave.py", line 21, in saveProject
  File "manuskript\load_save\version_1.py", line 382, in saveProject
FileNotFoundError: [Errno 2] No such file or directory: 'E:/Drive/Manuskript\\VERS_BaseRules\\outline\\1-Book_I_-_Player_Rules\\1-Chapter_II_-_Character_Rules\\7-Abilities_and_Equipment_-_Overview\\1-Abilities_-Optional-\\5-Understanding_Manifestations_Properties_and_Effects\\0-Understanding_Manifestations-_Properties-_and_Effects.md'

C:\Users\Jason\manuskript-0.9.0-win32>
@worstje
Copy link
Contributor

worstje commented May 29, 2019

It is indeed the length of the filename nesting that is breaking you up. If you count how long that path is, you'll see it is 270 characters long. The MAX_PATH constant (which is an ancient constraint that Windows still abides by unless applications specifically mark themselves compatible) ends at 260... which means that your path runs into a problem.

I ran into the same problem myself a couple of months ago; you can check issue #517 for more information. There is a workaround listed in it that may work well enough for you, but that solution could potentially negatively affect the workings of other applications on your machine. (It probably won't, but changing MAX_PATH on your system is like changing the constant that defines gravity on earth; most programs are simply not prepared to deal the subtleties that follow from it.)

We may have to look into a more program-centric way to work around this issue on Windows at some point, because the workarounds we know of are not ideal.

Edit: I figure I might as well sum up the workarounds.

  1. Adjust the MAX_PATH limit for your entire system in the way the Python installer offers to do, but can also be done separately from Python. But as I said above: this can negatively impact the functionality of other programs who expect the default behaviour established in the past 30+ years.

  2. Move the path and/or adjust the various title in your project to be shorter to free up more room in the places you need it to. For example, if you move your project to E:\VERS_Baserules.msk as opposed to E:\Drive\Manuskript\VERS_Baserules.msk you'd save 17 characters that you could then use in your text or folder titles. Naming your project VB.msk would cut out 12 more characters.

Workarounds like these are not pretty and definitely not ideal, but they are solutions you can use to work around the problem right this second.

Edit the Second: I totally forgot the most obvious thing you can do that is perhaps the neatest...

  1. ... which is to install Python 3.6+ or above, and run Manuskript from source. See this link for more information.

Note that you specifically want Python 3.6 or later, because that version has the builtin switch that says 'we support the longer MAX_PATH'. The official Manuskript release for Windows is released with Python 3.4 because that is the last version of Python that supports Windows XP, and that is at present still a platform we garget.

The 'advantage' of this third option is that you can very easily update to the latest version of Manuskript to test out features or bugfixes because you are running directly from the development branch. (Of course, works in progress could also introduce new bugs, but that shouldn't typically happen.)

@eternalsage
Copy link
Author

Thank you, I will look into these options. I had a feeling it was something like this, however. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants