-
Couldn't load subscription status.
- Fork 521
fixes encoding issue when reading YAML files. #2221
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
fixes encoding issue when reading YAML files. #2221
Conversation
This problem only occurs when compiling under windows. This is due to the default encoding for loading files being set to cp1252. To change this behavior we need to supply the proper encoding of utf-8
|
Oh thanks @kdschlosser ! I don't think any of us can test this, but if @vwheeler63 can get it to work I'm happy to merge it in to improve the experience of folks using Windows! |
|
Wow Kevin! ( @kdschlosser ) I'm honored that you would chip in to help me get this local build resolved. 😄 My Python 3.8 is now getting farther with What is weird about it is that in the activated virtual environment I have set up, I did do the step, and No change. So I deactivated the virtual environment and did in case it needed to be in the root Python installation, and did it again. No change. And just to verify, is the first part of my PATH (alongside my other versions), and no other python version paths are present. Any clues? I have my phone nearby if you wanna connect screens. I have the free version of TeamViewer if it helps. Kind regards, |
|
P.S. @kdschlosser I also looked in the local |
|
@kdschlosser I forgot to mention that I also tried adding the from the https://ablog.readthedocs.io/en/stable/ documentation, but it didn't change the results, so I took it out again. |
|
delete the clone and clone it again and set up the virtual env again. Then give it a go and see what happens. |
|
make sure you have both python in your path statement and also PYTHON_PATH set to point to your python installation. |
|
ahh OK I see what is going on.... There is zero detection of installed python versions in the batch file. The batch file just calls "sphinx-build" and whatever |
|
There needs to be code like this... @echo off
setlocal
setlocal enabledelayedexpansion
set "_version_major=0"
set "_version_minor=0"
set _found_python_path=""
for /f "tokens=1" %%a in ('REG QUERY HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore /s /f InstallPath ^| findstr "HKEY_LOCAL_MACHINE"') do (
set _python_reg=%%a
for /f "tokens=3" %%b in ('REG QUERY !_python_reg! /v ExecutablePath') do (
set _python_path=%%b
)
for /f "tokens=5 delims=\" %%v in ("%%a") Do (
set _version=%%v
for /f "tokens=1,2 delims=." %%p in ("%%v") Do (
set "_major=%%p"
set "_minor=%%q"
IF !_major! gtr !_version_major! (
set "_version_major=%%p"
set "_version_minor=%%q"
set _found_python_path=!_python_path!
) ELSE (
IF !_major!==!_version_major! IF !_minor! gtr !_version_minor! (
set "_version_major=%%p"
set "_version_minor=%%q"
set _found_python_path=!_python_path!
)
)
)
)
)
echo !_found_python_path!
endlocalin the batch file. This will detect whatever Python version is wanting to be used regardless of it being in the |
|
I would make it so that when detecting the Python version if 3.8 is found then it will use that and if it is not found then it will use the highest installed version. Add a command line option to disable the detection and rely on whatever |
So far I have simply NOT included ANY python path by default, and then when I need it, I run one of my batch files to put the appropriate directories at the head of my PATH for the version I want to use. It keeps my environment (e.g. PATH var) from getting kludged up. You're a wiz with batch files! Did you just write that? |
|
I saw that you had said that most of the people that would compile this are not Windows users. However, you should be able to build on Windows considering Windows has ~75% market share.. That's a whole lot of possible contributors you are missing out on if the project is not able to be compiled on Windows. |
It's funny because same exact issue came up when dealing with the ESP32 SDK on Windows and I wrote that because they were using Funny the same thing is also happening here as well. |
Fascinating. Well, you did a thorough job! Me: I used to be (1994-95-ish) a Unix administrator, so I'm pretty careful about where things go, and I periodically de-kludge my PATH, and followed a tip from someone on |
|
@plaindocs Hi, Sam. I don't know how to evaluate the failing check (links-internal), but we haven't resolved the build issue yet, so maybe it will resolve. |
|
@kdschlosser Kevin: is that new version on |
Oops. I missed this one. Let me give that a try. (However, without it, I don't get that "no such module" for any other of my installed modules....) |
|
@kdschlosser Ohhhh.... I figured out why.... |
|
why? I updated the make.bat file to target a python 3.8 install and I also added the proper command to run sphinx build using |
|
@kdschlosser I owe you an apology: just today I added a SPHINXBUILD environment variable and it was pointing to Python312. I eliminated it again (was only needed in a GitBash environment where it was actually using the Now I am getting Nice work. Now let's see if I can resolve the missing files, or work around them. Could you kindly:
Kind regards, |
|
@kdschlosser I tried testing your MAKE.BAT and there appear to be 2 things wrong with it:
That said, let's back up a couple of paces and make sure we're addressing the right problem. Background info: this repository's README cleverly tells the user how to set up a virtual environment which already correctly handles the Python version and installed packages forever more, and due to that, the However, the yaml-utf-8 problem WAS the right target, and it does seem that you nailed that in the With Unfortunately, that's all the detail it generated. No logfiles in TMPDIR.... I can ignore the WARNING at the moment, but the error is blocking the build. Q1: Is it building for you on your system? Q2: Any insights on that error? Kind regards, |
|
@kdschlosser P.S. I do agree about using |
|
I didn't even check the spacing. I wanted you to test it to see if it works properly before spending any time to beautify it. |
|
I am going to kill this PR and create a new one. I want to keep the PR clean and not have it jumbled up with a bunch of commits and then reversing the commits. |
Alright. |

This problem only occurs when compiling under windows. This is due to the default encoding for loading files being set to cp1252. To change this behavior we need to supply the proper encoding of utf-8
@vwheeler63
Give this a try and see if it corrects the build problem under Windows. It might need some tweaking to make it work correctly bit it should do the trick after any needed tweaks.
📚 Documentation preview 📚: https://writethedocs-www--2221.org.readthedocs.build/