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

When I run install.bat in Windows, I run into an error message like this: #805

Closed
vkbo opened this issue Jun 10, 2021 · 4 comments
Closed
Assignees
Labels
bug Issue: Something isn't working installation Issue: Problem when installing
Milestone

Comments

@vkbo
Copy link
Owner

vkbo commented Jun 10, 2021

This issue has been transferred from a different thread.
Originally posted by @singlebunglemrbungle in #481 (comment)


When I run install.bat in Windows, I run into an error message like this:

UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 40: illegal multibyte sequence

Expected Action:

  • Create novelWriting.exe
  • Create desktop shortcut

What happened:
I guess successful running of setup.py results in creating novelWritng.exe, but it does not.
And there is no desktop shortcut.

Fortunately, the program itself can be executed by running novelWriter.pyw nonetheless.

Source of the problem:
My windows locale is set to Korea, I guess unspecified encoding making the error.


Here's more latter part of the log from install.bat.

Windows Install
===============

C:\app\novelWriter>windows_install.bat

Looking for Python
Python 3.9.5
Python found. OK.
setup.py found. OK.

Requirement already satisfied: pywin32 in c:\users\gone\appdata\roaming\python\python39\site-packages (300)
Requirement already satisfied: pyqt5>=5.2.1 in c:\users\gone\appdata\roaming\python\python39\site-packages (from -r requirements.txt (line 1)) (5.15.4)
Requirement already satisfied: lxml>=4.2.0 in c:\users\gone\appdata\roaming\python\python39\site-packages (from -r requirements.txt (line 2)) (4.6.3)
Requirement already satisfied: pyenchant>=3.0.0 in c:\users\gone\appdata\roaming\python\python39\site-packages (from -r requirements.txt (line 3)) (3.2.0)
Requirement already satisfied: PyQt5-Qt5>=5.15 in c:\users\gone\appdata\roaming\python\python39\site-packages (from pyqt5>=5.2.1->-r requirements.txt (line 1)) (5.15.2)
Requirement already satisfied: PyQt5-sip<13,>=12.8 in c:\users\gone\appdata\roaming\python\python39\site-packages (from pyqt5>=5.2.1->-r requirements.txt (line 1)) (12.9.0)

Windows Install
===============

Traceback (most recent call last):
  File "C:\app\novelWriter\setup.py", line 1236, in <module>
    winInstall()
  File "C:\app\novelWriter\setup.py", line 842, in winInstall
    numVers, hexVers = extractVersion()
  File "C:\app\novelWriter\setup.py", line 54, in extractVersion
    for aLine in inFile:
UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 40: illegal multibyte sequence
Press any key to continue . . .

C:\app\novelWriter>

And here is a screenshot from the directory.
image

@vkbo
Copy link
Owner Author

vkbo commented Jun 10, 2021

Hi @singlebunglemrbungle,

All the script does is generate an icon on your desktop, your start menu, and add some registry keys so you can also double click a project file in your file explorer. The icons just launch the novelWriter.pyw file, which you also can du manually, as you discovered. There are no exe files generated.

Anyway, this seems to be an encoding issue. It looks like it tries to open the file as cp949 encoding instead of utf-8. This seems to be an issue with Windows. I found this discussion about it.

Could you please try to change line 53 in setup.py from:

with open(initFile, mode="r") as inFile:

to this:

with open(initFile, mode="r", encoding="utf8") as inFile:

and see if that fixes the issue? If it does, I can make a patch.

I'm not a Windows user, so I don't test this very often. I mainly work with Linux.

@vkbo vkbo self-assigned this Jun 10, 2021
@vkbo vkbo added the bug Issue: Something isn't working label Jun 10, 2021
@vkbo vkbo added this to Triage in Bug Tracker 1.x via automation Jun 10, 2021
@vkbo vkbo added the installation Issue: Problem when installing label Jun 10, 2021
@vkbo vkbo moved this from Triage to High Priority in Bug Tracker 1.x Jun 10, 2021
@vkbo vkbo added this to the Release 1.3.3 milestone Jun 10, 2021
@vkbo
Copy link
Owner Author

vkbo commented Jun 10, 2021

I could not reproduce your issue on a Windows virtual machine, but I made a fix anyway and merged it into main. I think it should resolve the issue. If will be released with version 1.3.3, which I can do this weekend I expect.

@singlebunglemrbungle
Copy link

Yes, I did what you said, and it works flawlessly. Thank you for the time you took to fix somewhat unimportant thing.

@vkbo
Copy link
Owner Author

vkbo commented Jun 11, 2021

Great! That means the fix I merged yesterday should work too.

It's not an unimportant thing when the setup script doesn't work. Thank you for reporting it!

@vkbo vkbo closed this as completed Jun 11, 2021
Bug Tracker 1.x automation moved this from High Priority to Closed Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue: Something isn't working installation Issue: Problem when installing
Projects
No open projects
Bug Tracker 1.x
  
Closed
Development

No branches or pull requests

2 participants