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

Main program does not load (FileNotFound error) - filename path too long > 260 chars #313

Open
OlsonAC1 opened this Issue Feb 7, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@OlsonAC1
Copy link

commented Feb 7, 2018

Program suddenly stopped being able to load. Here is the CMD output:

Debug:
Web rendering engine used: QWebView
Running manuskript version 0.6.0.
Note: No translator found or loaded for locale en_US.
Loading: C:/Users/olsonac1.2CE12909PS/Google Drive/Hobbies/Stories/Story Manuskript/Keenan Story.msk
Detected file format version: 1. Zip: False.
Traceback (most recent call last):
File "manuskript\ui\welcome.py", line 68, in showEvent
File "manuskript\mainWindow.py", line 517, in loadProject
File "manuskript\mainWindow.py", line 742, in loadDatas
File "manuskript\loadSave.py", line 66, in loadProject
File "manuskript\load_save\version_1.py", line 656, in loadProject
FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/olsonac1.2CE12
909PS/Google Drive/Hobbies/Stories/Story Manuskript\Keenan Story\outline\1-JM
Turned-Keenan-s_age_revealed\0-Finish_Marty-s_investigation\0-JM_adjusting
to_vampirism_and_living_at_Lucas-_place-_and_Marty_investigation_becoming_releva
nt-.md'

The "file not found" is in fact there. For context, this project was the last one opened in the program and I did not edit the files outside the program.

Here is the info for that MSK's settings.txt in case it's relevant:

{
"autoSave": true,
"autoSaveDelay": 1,
"autoSaveNoChanges": true,
"autoSaveNoChangesDelay": 5,
"corkBackground": {
"color": "#926239",
"image": ""
},
"corkSizeFactor": 71,
"corkStyle": "new",
"defaultTextType": "md",
"dict": "en_US",
"dontShowDeleteWarning": false,
"folderView": "cork",
"frequencyAnalyzer": {
"phraseMax": 5,
"phraseMin": 2,
"wordExclude": "a, and, or",
"wordMin": 1
},
"fullScreenTheme": "newtheme",
"lastTab": 6,
"openIndexes": [
0,
[
"25"
],
null
],
"outlineViewColumns": [
0,
8,
9,
7,
11
],
"revisions": {
"keep": true,
"rules": {
"2592000": 8640.0,
"3600": 60.0,
"600": 6.0,
"86400": 360.0,
"null": 60480.0
},
"smartremove": true
},
"saveOnQuit": true,
"saveToZip": false,
"spellcheck": true,
"textEditor": {
"background": "#fff",
"backgroundTransparent": false,
"cursorNotBlinking": false,
"cursorWidth": 1,
"font": "MS Shell Dlg 2,10,-1,5,50,0,0,0,0,0",
"fontColor": "#000",
"indent": true,
"lineSpacing": 100,
"marginsLR": 0,
"marginsTB": 0,
"maxWidth": 0,
"misspelled": "#F00",
"spacingAbove": 5,
"spacingBelow": 5,
"tabWidth": 20,
"textAlignment": 0
},
"viewMode": "fiction",
"viewSettings": {
"Cork": {
"Background": "Nothing",
"Border": "Nothing",
"Corner": "Label",
"Icon": "Nothing",
"Text": "Nothing"
},
"Outline": {
"Background": "Nothing",
"Icon": "POV",
"Text": "Nothing"
},
"Tree": {
"Background": "Nothing",
"Icon": "Nothing",
"InfoFolder": "Count",
"InfoText": "WC",
"Text": "Compile",
"iconSize": 24
}
}
}

@gedakc

This comment has been minimized.

Copy link
Collaborator

commented Feb 7, 2018

Thank you @OlsonAC1 for reporting this issue and providing the console output.

I believe the issue is that the filename path is too long (the one in the console log is 265 characters long). This issue is mentioned in Python Issue18199 - Windows: support path longer than 260 bytes using "\?" prefix.

You might try removing the max path limitation in Windows. However this might not resolve the issue because the PyInstaller package for Windows is built using Python 3.4.4 and the link mentions using Python 3.6+. The reason we use Python 3.4.4 in the Windows PyInstaller package is to maintain compatibility with Windows XP. Of course you could also consider installing Python 3.6+ to Run Manuskript from Source Code on Windows.

Another work-around would be to shorten the path length. This might be accomplished by either renaming/shortening some of the directory names in the path above the project .msk file and directory. Alternatively you might copy all the project files/directories higher up in the directory hierarchy.

Please let us know what you choose to do and if it works.

@OlsonAC1

This comment has been minimized.

Copy link
Author

commented Feb 7, 2018

I renamed the file to a shorter name and that worked, though I don't know why. I forgot to mention that I tried reinstalling the files to start fresh but that didn't help.

@gedakc

This comment has been minimized.

Copy link
Collaborator

commented Feb 7, 2018

I renamed the file to a shorter name and that worked, though I don't know why

The issue arises due to a maximum path limitation of 260 characters in Windows.

Thanks for reporting that a shorter name worked. There do appear to be some code work-arounds, but I'm not sure if we can implement these and still retain compatibility with Windows XP.

@gedakc

This comment has been minimized.

Copy link
Collaborator

commented Feb 7, 2018

I found another interesting link regarding maximum path lengths in Windows:

Why does the 260 character path length limit exist in Windows?

Some of the answers indicate that Windows does not apply extended path work-arounds to all Windows API functions. Hence it might be best to keep folder (chapter) and file (text) name paths short to avoid the 260 character maximum length.

EDIT: This issue is specific to the Windows operating system.

@gedakc gedakc added bug windows labels Feb 7, 2018

@gedakc gedakc changed the title Main program does not load (Incorrect FileNotFound error) Main program does not load (FileNotFound error) - filename path too long > 260 chars Feb 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.