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

Program crashes randomly and then never opens again even after reinstall #665

Closed
johnnyjmcivorv opened this issue Oct 13, 2019 · 6 comments

Comments

@johnnyjmcivorv
Copy link

I was using this program for a while -- I think under a previous version. But one day it crashed and would never open -- I tried reinstalling it but all that would happen is this and then it would close immediately.

https://i.imgur.com/FBEokfk.png

@worstje
Copy link
Contributor

worstje commented Oct 13, 2019

Your current screenshot was made while the program was still running but the terminal output was frozen, meaning that the actual cause of the crash is likely not showing. (As opposed to not existing whatsoever, which is possible but far more unlikely.)

If you run from the command line, what do you see? Steps to take:

  1. Open command line. (cmd)
  2. Switch to the directory containing manuskript: cd /d P:\ath\Containing\manuskript
    You can get the path by Shift-right clicking on the manuskript folder and selecting Copy as Path), and then pasting it in the command line.
  3. manuskript

If all is well, you should be able to see the actual cause of the crash without the window closing.

@johnnyjmcivorv
Copy link
Author

Ok i think i found it

Debug: Web rendering engine used: QWebView
Running manuskript version 0.10.0-with-PR660-dark-theme-fix.
Preferred translation: ['en-US'] (based on available ui languages)
Using the builtin translation.
Traceback (most recent call last):
File "manuskript\ui\welcome.py", line 86, in showEvent
File "manuskript\mainWindow.py", line 560, in loadProject
File "c:\python34\lib\encodings\cp437.py", line 19, in encode
UnicodeEncodeError: 'charmap' codec can't encode characters in position 70-73: character maps to

@gedakc
Copy link
Collaborator

gedakc commented Oct 13, 2019

What is the entire path / filename for the project?

Perhaps it has some non-ASCII characters in the project name?

The reason I ask is because line 560 in file "manuskript\mainWindow.py" is to print a message that the project does not exist with "print(...).format(project)". This can happen if the project was moved to a different folder, or was renamed.

def loadProject(self, project, loadFromFile=True):
"""Loads the project ``project``.
If ``loadFromFile`` is False, then it does not load datas from file.
It assumes that the datas have been populated in a different way."""
if loadFromFile and not os.path.exists(project):
print(self.tr("The file {} does not exist. Has it been moved or deleted?").format(project))
F.statusMessage(
self.tr("The file {} does not exist. Has it been moved or deleted?").format(project), importance=3)
return
if loadFromFile:
# Load empty settings
imp.reload(settings)
settings.initDefaultValues()
# Load data
self.loadEmptyDatas()
self.loadDatas(project)
self.makeConnections()
# Load settings
if settings.openIndexes and settings.openIndexes != [""]:
self.mainEditor.tabSplitter.restoreOpenIndexes(settings.openIndexes)
self.generateViewMenu()
self.mainEditor.sldCorkSizeFactor.setValue(settings.corkSizeFactor)
self.actSpellcheck.setChecked(settings.spellcheck)
self.toggleSpellcheck(settings.spellcheck)
self.updateMenuDict()
self.setDictionary()
iconSize = settings.viewSettings["Tree"]["iconSize"]
self.treeRedacOutline.setIconSize(QSize(iconSize, iconSize))
self.mainEditor.setFolderView(settings.folderView)
self.mainEditor.updateFolderViewButtons(settings.folderView)
self.mainEditor.tabSplitter.updateStyleSheet()
self.tabMain.setCurrentIndex(settings.lastTab)
self.mainEditor.updateCorkBackground()
if settings.viewMode == "simple":
self.setViewModeSimple()
else:
self.setViewModeFiction()
# Set autosave
self.saveTimer = QTimer()
self.saveTimer.setInterval(settings.autoSaveDelay * 60 * 1000)
self.saveTimer.setSingleShot(False)
self.saveTimer.timeout.connect(self.saveDatas)
if settings.autoSave:
self.saveTimer.start()
# Set autosave if no changes
self.saveTimerNoChanges = QTimer()
self.saveTimerNoChanges.setInterval(settings.autoSaveNoChangesDelay * 1000)
self.saveTimerNoChanges.setSingleShot(True)
self.mdlFlatData.dataChanged.connect(self.startTimerNoChanges)
self.mdlOutline.dataChanged.connect(self.startTimerNoChanges)
self.mdlCharacter.dataChanged.connect(self.startTimerNoChanges)
self.mdlPlots.dataChanged.connect(self.startTimerNoChanges)
self.mdlWorld.dataChanged.connect(self.startTimerNoChanges)
# self.mdlPersosInfos.dataChanged.connect(self.startTimerNoChanges)
self.mdlStatus.dataChanged.connect(self.startTimerNoChanges)
self.mdlLabels.dataChanged.connect(self.startTimerNoChanges)
self.saveTimerNoChanges.timeout.connect(self.saveDatas)
self.saveTimerNoChanges.stop()
# UI
for i in [self.actOpen, self.menuRecents]:
i.setEnabled(False)
for i in [self.actSave, self.actSaveAs, self.actCloseProject,
self.menuEdit, self.menuView, self.menuOrganize,
self.menuTools, self.menuHelp, self.actImport,
self.actCompile, self.actSettings]:
i.setEnabled(True)
# We force to emit even if it opens on the current tab
self.tabMain.currentChanged.emit(settings.lastTab)
# Make sure we can update the window title later.
self.currentProject = project
self.projectDirty = False
QSettings().setValue("lastProject", project)
# Add project name to Window's name
self.setWindowTitle(self.projectName() + " - " + self.tr("Manuskript"))
# Stuff
# self.checkPersosID() # Shouldn't be necessary any longer
# Show main Window
self.switchToProject()
def handleUnsavedChanges(self):
"""
There may be some currently unsaved changes, but the action the user triggered
will result in the project or application being closed. To save, or not to save?
Or just bail out entirely?
Sometimes it is best to just ask.
"""

EDIT: You might try opening the project directly from the command line with something like:

manuskript.exe C:\path-to-project\myprojectname.msk

@johnnyjmcivorv
Copy link
Author

C:\Users\Johnny\Downloads\manuskript-0.10.0-2-win32\manuskript\manuskript.exe

@johnnyjmcivorv
Copy link
Author

ok i did what you said -- opening the project directly and then selecting the .exe -- and NOW it opens

@gedakc
Copy link
Collaborator

gedakc commented Oct 13, 2019

That's the path to where you have the manuskript.exe executable.

I'm looking for the complete path to where your project file is stored.

EDIT: Good to hear that you can open the project. :-)

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

No branches or pull requests

4 participants