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

Fails to build on windows outside of cygwin or msys/mingw64 #422

Open
xrheihwh opened this issue Oct 8, 2024 · 0 comments
Open

Fails to build on windows outside of cygwin or msys/mingw64 #422

xrheihwh opened this issue Oct 8, 2024 · 0 comments

Comments

@xrheihwh
Copy link

xrheihwh commented Oct 8, 2024

Two different errors I encountered. The first one is that I get the following terminal output:

Traceback (most recent call last):
  File "D:\Users\Matthew\downloads\thebookofshaders\src\parseBook.py", line 73, in <module>
    fileString = originalChapter.read()
                 ^^^^^^^^^^^^^^^^^^^^^^
  File "D:\msys64\mingw64\lib\python3.11\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 4870: character maps to <undefined>
make: *** [Makefile:17: pdf] Error 1

I fixed this by setting encoding='utf-8' in the open functions.

My second issue is something I cannot figure out why because it works with mingw64 shell.

Traceback (most recent call last):
  File "D:\Users\Matthew\downloads\thebookofshaders\src\parseBook.py", line 78, in <module>
    modifiedChapterString = re.sub(imgPattern, subPattern, fileString)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\msys64\mingw64\lib\python3.11\re\__init__.py", line 185, in sub
    return _compile(pattern, flags).sub(repl, string, count)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\msys64\mingw64\lib\python3.11\re\__init__.py", line 317, in _subx
    template = _compile_repl(template, pattern)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\msys64\mingw64\lib\python3.11\re\__init__.py", line 308, in _compile_repl
    return _parser.parse_template(repl, pattern)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\msys64\mingw64\lib\python3.11\re\_parser.py", line 1081, in parse_template
    addgroup(int(this[1:]), len(this) - 1)
  File "D:\msys64\mingw64\lib\python3.11\re\_parser.py", line 1017, in addgroup
    raise s.error("invalid group reference %d" % index, pos)
re.error: invalid group reference 10 at position 4
make: *** [Makefile:17: pdf] Error 1

I don't know if windows was ever intended for being built on, but just wanted to file a bug report it fails to build on windows outside of some sort of POSIX emulation.

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

1 participant