Which is surprising, because that is what I think I did, though I manually applied
https://github.com/freenas/freenas/commit/e8ad94b9f80947e9876f4861711d682d5e794b4e and then restarted middlewared.
Edit: Compared my edit to what's in the repo. It's the same. Whatever happened here, you likely got something mangled during the creation of your new config.py. I copy/pasted the code from the repo into fnurble.py and compared to my manually edited config.py. Only difference is a couple extra newlines in my version.
Code:
truenas# md5 fnurble.py
MD5 (fnurble.py) = 975e8777c629f70ba683e446ed863070
truenas# diff fnurble.py /usr/local/lib/python3.8/site-packages/middlewared/plugins/config.py
42a43
>
43a45
>
44a47
>
45a49
>
198a203
>
I then moved the repo code into my environment and restarted middlewared. Works, whatever is going is local to you. Assuming you created the file in TrueNAS, not Windows, correct? CRLF would definitely trip you up.
Code:
truenas# mv /usr/local/lib/python3.8/site-packages/middlewared/plugins/config.py /usr/local/lib/python3.8/site-packages/middlewared/plugins/config.py.bak
truenas# cp fnurble.py /usr/local/lib/python3.8/site-packages/middlewared/plugins/config.py
truenas# service middlewared restart
Stopping middlewared.
Waiting for PIDS: 76.
truenas#