Repository: spyder-ide/spyder
Pull request: PR: Fix setting user environment variables on Windows
<!--- Make sure to read the Contributing Guidelines:                   --->
<!--- https://github.com/spyder-ide/spyder/blob/master/CONTRIBUTING.md --->
<!--- and follow PEP 8, PEP 257 and Spyder's code style:               --->
<!--- https://github.com/spyder-ide/spyder/wiki/Dev:-Coding-Style      --->

## Description of Changes

<!--- Explain what you've done and why --->

When adding user environment variables to Windows registry, the value must be a string. Under some circumstances, the user provided value may be numeric resulting in `ValueError: Could not convert the data to the specified type.`. Applying `clean_env` resolves this issue.

Also, a user warning ```UserWarning: A SpyderConfigurationObserver must define a `CONF_SECTION` class attribute!``` was encountered when launching the User environment variable widget. This was fixed by adding `CONF_SECTION = 'main'` to the `CollectionsEditorWidget` class.

### Issue(s) Resolved

<!--- List the issue(s) below, in the form "Fixes #1234"; one per line --->

Fixes #21771


### Affirmation

By submitting this Pull Request or typing my (user)name below,
I affirm the [Developer Certificate of Origin](https://developercertificate.org)
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.

<!--- TYPE YOUR USER/NAME AFTER THE FOLLOWING: --->
I certify the above statement is true and correct:

<!--- Thanks for your help making Spyder better for everyone! --->


Problem statement:
Adding "User environment variables in Windows registry"
## Description

### What steps will reproduce the problem?

<!--- You can use Markdown here --->

1. Clicked top menu Tools->Currentuserenvironment variables...

2. Open context menu by right click in free space below environment variables list in windo "User environment variables in Windows registry - Dictionary (5 elements)"

3. Pasted key "OMP_NUM_THREADS" from clipboard

4. Entered value 1

5. Clicked button "Save and Close" in the bottom-right corner of the window "User environment variables in Windows registry - Dictionary (5 elements)"

6. List of environment variables got a new 6th entry (Key:OMP_NUM_THREADS|Type:int|Size:1|Value:1) in the first data row. Value cell has an orange background, all other data cells in column "Value" having a green background.

=> Window "Issue reporter" opened


Got this exception the first time I tried. Gonna try to reproduce the exception now.

### Traceback
```python-traceback
Traceback (most recent call last):
  File "C:\ProgramData\anaconda3\Lib\site-packages\spyder\utils\environ.py", line 239, in accept
    set_user_env(listdict2envdict(self.get_value()), parent=self)
  File "C:\ProgramData\anaconda3\Lib\site-packages\spyder\utils\environ.py", line 103, in set_user_env
    winreg.SetValueEx(key, name, 0, types[name], env_dict[name])
ValueError: Could not convert the data to the specified type.
```

## Versions

* Spyder version: 5.4.3  (conda)
* Python version: 3.11.5 64-bit
* Qt version: 5.15.2
* PyQt5 version: 5.15.7
* Operating System: Windows 10

### Dependencies

```
# Mandatory:
atomicwrites >=1.2.0                             :  1.4.0 (OK)
chardet >=2.0.0                                  :  4.0.0 (OK)
cloudpickle >=0.5.0                              :  2.2.1 (OK)
cookiecutter >=1.6.0                             :  1.7.3 (OK)
diff_match_patch >=20181111                      :  20200713 (OK)
intervaltree >=3.0.2                             :  3.1.0 (OK)
IPython >=7.31.1,<9.0.0,!=8.8.0,!=8.9.0,!=8.10.0 :  8.15.0 (OK)
jedi >=0.17.2,<0.19.0                            :  0.18.1 (OK)
jellyfish >=0.7                                  :  1.0.1 (OK)
jsonschema >=3.2.0                               :  4.19.2 (OK)
keyring >=17.0.0                                 :  23.13.1 (OK)
nbconvert >=4.0                                  :  6.5.4 (OK)
numpydoc >=0.6.0                                 :  1.5.0 (OK)
paramiko >=2.4.0                                 :  2.8.1 (OK)
parso >=0.7.0,<0.9.0                             :  0.8.3 (OK)
pexpect >=4.4.0                                  :  4.8.0 (OK)
pickleshare >=0.4                                :  0.7.5 (OK)
psutil >=5.3                                     :  5.9.0 (OK)
pygments >=2.0                                   :  2.15.1 (OK)
pylint >=2.5.0,<3.0                              :  2.16.2 (OK)
pylint_venv >=2.1.1                              :  2.3.0 (OK)
pyls_spyder >=0.4.0                              :  0.4.0 (OK)
pylsp >=1.7.2,<1.8.0                             :  1.7.2 (OK)
pylsp_black >=1.2.0                              :  1.2.1 (OK)
qdarkstyle >=3.0.2,<3.2.0                        :  3.0.2 (OK)
qstylizer >=0.2.2                                :  0.2.2 (OK)
qtawesome >=1.2.1                                :  1.2.2 (OK)
qtconsole >=5.4.2,<5.5.0                         :  5.4.2 (OK)
qtpy >=2.1.0                                     :  2.2.0 (OK)
rtree >=0.9.7                                    :  1.0.1 (OK)
setuptools >=49.6.0                              :  68.0.0 (OK)
sphinx >=0.6.6                                   :  5.0.2 (OK)
spyder_kernels >=2.4.3,<2.5.0                    :  2.4.4 (OK)
textdistance >=4.2.0                             :  4.2.1 (OK)
three_merge >=0.1.1                              :  0.1.1 (OK)
watchdog >=0.10.3                                :  2.1.6 (OK)
zmq >=22.1.0                                     :  25.1.2 (OK)

# Optional:
cython >=0.21                                    :  None (NOK)
matplotlib >=3.0.0                               :  3.7.2 (OK)
numpy >=1.7                                      :  1.24.3 (OK)
pandas >=1.1.1                                   :  2.0.3 (OK)
scipy >=0.17.0                                   :  1.11.1 (OK)
sympy >=0.7.3                                    :  1.11.1 (OK)
```

### Environment

<details><summary>Environment</summary>

```
# packages in environment at C:\ProgramData\anaconda3:
#
# Name                    Version                   Build  Channel
_anaconda_depends         2023.09             py311_mkl_1  
abseil-cpp                20211102.0           hd77b12b_0  
aiobotocore               2.5.0           py311haa95532_0  
aiofiles                  22.1.0          py311haa95532_0  
aiohttp                   3.8.5           py311h2bbff1b_0  
aioitertools              0.7.1              pyhd3eb1b0_0  
aiosignal                 1.2.0              pyhd3eb1b0_0  
aiosqlite                 0.18.0          py311haa95532_0  
alabaster                 0.7.12             pyhd3eb1b0_0  
anaconda-anon-usage       0.4.2           py311hfc23b7f_0  
anaconda-catalogs         0.2.0           py311haa95532_0  
anaconda-client           1.12.1          py311haa95532_0  
anaconda-cloud-auth       0.1.3           py311haa95532_0  
anaconda-navigator        2.5.2           py311haa95532_0  
anaconda-project          0.11.1          py311haa95532_0  
anyio                     3.5.0           py311haa95532_0  
aom                       3.6.0                hd77b12b_0  
appdirs                   1.4.4              pyhd3eb1b0_0  
argon2-cffi               21.3.0             pyhd3eb1b0_0  
argon2-cffi-bindings      21.2.0          py311h2bbff1b_0  
arrow                     1.2.3           py311haa95532_1  
arrow-cpp                 11.0.0               ha81ea56_2  
astroid                   2.14.2          py311haa95532_0  
astropy                   5.1             py311h5bb9823_0  
asttokens                 2.0.5              pyhd3eb1b0_0  
async-lru                 2.0.4           py311haa95532_0  
async-timeout             4.0.2           py311haa95532_0  
atomicwrites              1.4.0                      py_0  
attrs                     23.1.0          py311haa95532_0  
automat                   20.2.0                     py_0  
autopep8                  1.6.0              pyhd3eb1b0_1  
aws-c-common              0.6.8                h2bbff1b_1  
aws-c-event-stream        0.1.6                hd77b12b_6  
aws-checksums             0.1.11               h2bbff1b_2  
aws-sdk-cpp               1.8.185              hd77b12b_1  
babel                     2.11.0          py311haa95532_0  
backcall                  0.2.0              pyhd3eb1b0_0  
backports                 1.1                pyhd3eb1b0_0  
backports.functools_lru_cache 1.6.4              pyhd3eb1b0_0  
backports.tempfile        1.0                pyhd3eb1b0_1  
backports.weakref         1.0.post1                  py_1  
bcrypt                    3.2.0           py311h2bbff1b_1  
beautifulsoup4            4.12.2          py311haa95532_0  
binaryornot               0.4.4              pyhd3eb1b0_1  
black                     23.3.0          py311haa95532_0  
blas                      1.0                         mkl  
bleach                    4.1.0              pyhd3eb1b0_0  
blosc                     1.21.3               h6c2663c_0  
bokeh                     3.2.1           py311h746a85d_0  
boltons                   23.0.0          py311haa95532_0  
boost-cpp                 1.82.0               h59b6b97_1  
botocore                  1.29.76         py311haa95532_0  
bottleneck                1.3.5           py311h5bb9823_0  
brotli                    1.0.9                h2bbff1b_7  
brotli-bin                1.0.9                h2bbff1b_7  
brotlipy                  0.7.0           py311h2bbff1b_1002  
bzip2                     1.0.8                he774522_0  
c-ares                    1.19.1               h2bbff1b_0  
c-blosc2                  2.8.0                hd77b12b_0  
ca-certificates           2023.12.12           haa95532_0  
certifi                   2023.11.17      py311haa95532_0  
cffi                      1.15.1          py311h2bbff1b_3  
cfitsio                   3.470                h2bbff1b_7  
chardet                   4.0.0           py311haa95532_1003  
charls                    2.2.0                h6c2663c_0  
charset-normalizer        2.0.4              pyhd3eb1b0_0  
click                     8.0.4           py311haa95532_0  
cloudpickle               2.2.1           py311haa95532_0  
clyent                    1.2.2           py311haa95532_1  
colorama                  0.4.6           py311haa95532_0  
colorcet                  3.0.1           py311haa95532_0  
comm                      0.1.2           py311haa95532_0  
conda                     23.7.4          py311haa95532_0  
conda-build               3.26.1          py311haa95532_0  
conda-content-trust       0.2.0           py311haa95532_0  
conda-index               0.3.0           py311haa95532_0  
conda-libmamba-solver     23.7.0          py311haa95532_0  
conda-pack                0.6.0              pyhd3eb1b0_0  
conda-package-handling    2.2.0           py311haa95532_0  
conda-package-streaming   0.9.0           py311haa95532_0  
conda-repo-cli            1.0.75          py311haa95532_0  
conda-token               0.4.0              pyhd3eb1b0_0  
conda-verify              3.4.2                      py_1  
console_shortcut          0.1.1                         4  
constantly                15.1.0          py311haa95532_0  
contourpy                 1.0.5           py311h59b6b97_0  
cookiecutter              1.7.3              pyhd3eb1b0_0  
cryptography              41.0.3          py311h89fc84f_0  
cssselect                 1.1.0              pyhd3eb1b0_0  
curl                      8.1.1                h2bbff1b_0  
cycler                    0.11.0             pyhd3eb1b0_0  
cytoolz                   0.12.0          py311h2bbff1b_0  
daal4py                   2023.1.1        py311h30df693_0  
dal                       2023.1.1         h59b6b97_48681  
dask                      2023.6.0        py311haa95532_0  
dask-core                 2023.6.0        py311haa95532_0  
datasets                  2.12.0          py311haa95532_0  
datashader                0.15.2          py311haa95532_0  
datashape                 0.5.4           py311haa95532_1  
dav1d                     1.2.1                h2bbff1b_0  
debugpy                   1.6.7           py311hd77b12b_0  
decorator                 5.1.1              pyhd3eb1b0_0  
defusedxml                0.7.1              pyhd3eb1b0_0  
diff-match-patch          20200713           pyhd3eb1b0_0  
dill                      0.3.6           py311haa95532_0  
distributed               2023.6.0        py311haa95532_0  
docstring-to-markdown     0.11            py311haa95532_0  
docutils                  0.18.1          py311haa95532_3  
entrypoints               0.4             py311haa95532_0  
et_xmlfile                1.1.0           py311haa95532_0  
executing                 0.8.3              pyhd3eb1b0_0  
filelock                  3.9.0           py311haa95532_0  
flake8                    6.0.0           py311haa95532_0  
flask                     2.2.2           py311haa95532_0  
fmt                       9.1.0                h6d14046_0  
fonttools                 4.25.0             pyhd3eb1b0_0  
freetype                  2.12.1               ha860e81_0  
frozenlist                1.3.3           py311h2bbff1b_0  
fsspec                    2023.4.0        py311haa95532_0  
future                    0.18.3          py311haa95532_0  
gensim                    4.3.0           py311heda8569_0  
gflags                    2.2.2                ha925a31_0  
giflib                    5.2.1                h8cc25b3_3  
glib                      2.69.1               h5dc1a3c_2  
glob2                     0.7                pyhd3eb1b0_0  
glog                      0.5.0                hd77b12b_0  
greenlet                  2.0.1           py311hd77b12b_0  
grpc-cpp                  1.48.2               hfe90ff0_1  
h5py                      3.9.0           py311h4e0e482_0  
hdf5                      1.12.1               h51c971a_3  
heapdict                  1.0.1              pyhd3eb1b0_0  
holoviews                 1.17.1          py311haa95532_0  
huggingface_hub           0.15.1          py311haa95532_0  
hvplot                    0.8.4           py311haa95532_0  
hyperlink                 21.0.0             pyhd3eb1b0_0  
icc_rt                    2022.1.0             h6049295_2  
icu                       58.2                 ha925a31_3  
idna                      3.4             py311haa95532_0  
imagecodecs               2023.1.23       py311he6ff3c7_0  
imageio                   2.26.0          py311haa95532_0  
imagesize                 1.4.1           py311haa95532_0  
imbalanced-learn          0.10.1          py311haa95532_1  
importlib-metadata        6.0.0           py311haa95532_0  
importlib_metadata        6.0.0                hd3eb1b0_0  
incremental               21.3.0             pyhd3eb1b0_0  
inflection                0.5.1           py311haa95532_0  
iniconfig                 1.1.1              pyhd3eb1b0_0  
intake                    0.6.8           py311haa95532_0  
intel-openmp              2023.1.0         h59b6b97_46319  
intervaltree              3.1.0              pyhd3eb1b0_0  
ipykernel                 6.25.0          py311h746a85d_0  
ipython                   8.15.0          py311haa95532_0  
ipython_genutils          0.2.0              pyhd3eb1b0_1  
ipywidgets                8.0.4           py311haa95532_0  
isort                     5.9.3              pyhd3eb1b0_0  
itemadapter               0.3.0              pyhd3eb1b0_0  
itemloaders               1.0.4              pyhd3eb1b0_1  
itsdangerous              2.0.1              pyhd3eb1b0_0  
jaraco.classes            3.2.1              pyhd3eb1b0_0  
jedi                      0.18.1          py311haa95532_1  
jellyfish                 1.0.1           py311h36a85e1_0  
jinja2                    3.1.2           py311haa95532_0  
jinja2-time               0.2.0              pyhd3eb1b0_3  
jmespath                  0.10.0             pyhd3eb1b0_0  
joblib                    1.2.0           py311haa95532_0  
jpeg                      9e                   h2bbff1b_1  
jq                        1.6                  haa95532_1  
json5                     0.9.6              pyhd3eb1b0_0  
jsonpatch                 1.32               pyhd3eb1b0_0  
jsonpointer               2.1                pyhd3eb1b0_0  
jsonschema                4.19.2          py311haa95532_0  
jsonschema-specifications 2023.7.1        py311haa95532_0  
jupyter                   1.0.0           py311haa95532_8  
jupyter-lsp               2.2.0           py311haa95532_0  
jupyter_client            7.4.9           py311haa95532_0  
jupyter_console           6.6.3           py311haa95532_0  
jupyter_core              5.3.0           py311haa95532_0  
jupyter_events            0.6.3           py311haa95532_0  
jupyter_server            2.10.0          py311haa95532_0  
jupyter_server_fileid     0.9.0           py311haa95532_0  
jupyter_server_terminals  0.4.4           py311haa95532_1  
jupyter_server_ydoc       0.8.0           py311haa95532_1  
jupyter_ydoc              0.2.4           py311haa95532_0  
jupyterlab                4.0.11          py311haa95532_0  
jupyterlab_pygments       0.1.2                      py_0  
jupyterlab_server         2.25.1          py311haa95532_0  
jupyterlab_widgets        3.0.9           py311haa95532_0  
kaleido-core              0.2.1                h2bbff1b_0  
keyring                   23.13.1         py311haa95532_0  
kiwisolver                1.4.4           py311hd77b12b_0  
krb5                      1.20.1               h5b6d351_0  
lazy-object-proxy         1.6.0           py311h2bbff1b_0  
lazy_loader               0.2             py311haa95532_0  
lcms2                     2.12                 h83e58a3_0  
lerc                      3.0                  hd77b12b_0  
libaec                    1.0.4                h33f27b4_1  
libarchive                3.6.2                hb62f4d4_2  
libavif                   0.11.1               h2bbff1b_0  
libboost                  1.82.0               hae598e9_1  
libbrotlicommon           1.0.9                h2bbff1b_7  
libbrotlidec              1.0.9                h2bbff1b_7  
libbrotlienc              1.0.9                h2bbff1b_7  
libclang                  14.0.6          default_hb5a9fac_1  
libclang13                14.0.6          default_h8e68704_1  
libcurl                   8.1.1                h86230a5_0  
libdeflate                1.17                 h2bbff1b_0  
libevent                  2.1.12               h56d1f94_1  
libffi                    3.4.4                hd77b12b_0  
libiconv                  1.16                 h2bbff1b_2  
liblief                   0.12.3               hd77b12b_0  
libmamba                  1.5.1                hcd6fe79_0  
libmambapy                1.5.1           py311h77c03ed_0  
libpng                    1.6.39               h8cc25b3_0  
libpq                     12.15                h906ac69_1  
libprotobuf               3.20.3               h23ce68f_0  
libsodium                 1.0.18               h62dcd97_0  
libsolv                   0.7.24               h23ce68f_0  
libspatialindex           1.9.3                h6c2663c_0  
libssh2                   1.10.0               he2ea4bf_2  
libthrift                 0.15.0               h4364b78_2  
libtiff                   4.5.1                hd77b12b_0  
libwebp                   1.3.2                hbc33d0d_0  
libwebp-base              1.3.2                h2bbff1b_0  
libxml2                   2.10.4               h0ad7f3c_1  
libxslt                   1.1.37               h2bbff1b_1  
libzopfli                 1.0.3                ha925a31_0  
linkify-it-py             2.0.0           py311haa95532_0  
llvmlite                  0.40.0          py311hf2fb9eb_0  
locket                    1.0.0           py311haa95532_0  
lxml                      4.9.3           py311h09808a7_0  
lz4                       4.3.2           py311h2bbff1b_0  
lz4-c                     1.9.4                h2bbff1b_0  
lzo                       2.10                 he774522_2  
m2-msys2-runtime          2.5.0.17080.65c939c               3  
m2-patch                  2.7.5                         2  
m2w64-libwinpthread-git   5.0.0.4634.697f757               2  
markdown                  3.4.1           py311haa95532_0  
markdown-it-py            2.2.0           py311haa95532_1  
markupsafe                2.1.1           py311h2bbff1b_0  
mathjax                   2.7.5                haa95532_0  
matplotlib                3.7.2           py311haa95532_0  
matplotlib-base           3.7.2           py311hf62ec03_0  
matplotlib-inline         0.1.6           py311haa95532_0  
mccabe                    0.7.0              pyhd3eb1b0_0  
mdit-py-plugins           0.3.0           py311haa95532_0  
mdurl                     0.1.0           py311haa95532_0  
menuinst                  1.4.19          py311h59b6b97_1  
mistune                   0.8.4           py311h2bbff1b_1000  
mkl                       2023.1.0         h6b88ed4_46357  
mkl-service               2.4.0           py311h2bbff1b_1  
mkl_fft                   1.3.8           py311h2bbff1b_0  
mkl_random                1.2.4           py311h59b6b97_0  
more-itertools            8.12.0             pyhd3eb1b0_0  
mpmath                    1.3.0           py311haa95532_0  
msgpack-python            1.0.3           py311h59b6b97_0  
msys2-conda-epoch         20160418                      1  
multidict                 6.0.2           py311h2bbff1b_0  
multipledispatch          0.6.0           py311haa95532_0  
multiprocess              0.70.14         py311haa95532_0  
munkres                   1.1.4                      py_0  
mypy_extensions           1.0.0           py311haa95532_0  
navigator-updater         0.4.0           py311haa95532_1  
nbclassic                 0.5.5           py311haa95532_0  
nbclient                  0.5.13          py311haa95532_0  
nbconvert                 6.5.4           py311haa95532_0  
nbformat                  5.9.2           py311haa95532_0  
nest-asyncio              1.5.6           py311haa95532_0  
networkx                  3.1             py311haa95532_0  
nltk                      3.8.1           py311haa95532_0  
notebook                  7.0.6           py311haa95532_0  
notebook-shim             0.2.2           py311haa95532_0  
numba                     0.57.1          py311hf62ec03_0  
numexpr                   2.8.4           py311h1fcbade_1  
numpy                     1.24.3          py311hdab7c0b_1  
numpy-base                1.24.3          py311hd01c5d8_1  
numpydoc                  1.5.0           py311haa95532_0  
openjpeg                  2.4.0                h4fc8c34_0  
openpyxl                  3.0.10          py311h2bbff1b_0  
openssl                   3.0.13               h2bbff1b_0  
orc                       1.7.4                h623e30f_1  
overrides                 7.4.0           py311haa95532_0  
packaging                 23.1            py311haa95532_0  
pandas                    2.0.3           py311hf62ec03_0  
pandocfilters             1.5.0              pyhd3eb1b0_0  
panel                     1.2.3           py311haa95532_0  
param                     1.13.0          py311haa95532_0  
paramiko                  2.8.1              pyhd3eb1b0_0  
parsel                    1.6.0           py311haa95532_0  
parso                     0.8.3              pyhd3eb1b0_0  
partd                     1.4.0           py311haa95532_0  
pathlib                   1.0.1              pyhd3eb1b0_1  
pathspec                  0.10.3          py311haa95532_0  
patsy                     0.5.3           py311haa95532_0  
pcre                      8.45                 hd77b12b_0  
pcre2                     10.42                h0ff8eda_0  
pep8                      1.7.1           py311haa95532_1  
pexpect                   4.8.0              pyhd3eb1b0_3  
pickleshare               0.7.5           pyhd3eb1b0_1003  
pillow                    10.0.1          py311h045eedc_0  
pip                       23.2.1          py311haa95532_0  
pkce                      1.0.3           py311haa95532_0  
pkginfo                   1.9.6           py311haa95532_0  
platformdirs              3.10.0          py311haa95532_0  
plotly                    5.9.0           py311haa95532_0  
pluggy                    1.0.0           py311haa95532_1  
ply                       3.11            py311haa95532_0  
powershell_shortcut       0.0.1                         3  
poyo                      0.5.0              pyhd3eb1b0_0  
prometheus_client         0.14.1          py311haa95532_0  
prompt-toolkit            3.0.36          py311haa95532_0  
prompt_toolkit            3.0.36               hd3eb1b0_0  
protego                   0.1.16                     py_0  
psutil                    5.9.0           py311h2bbff1b_0  
ptyprocess                0.7.0              pyhd3eb1b0_2  
pure_eval                 0.2.2              pyhd3eb1b0_0  
py-cpuinfo                8.0.0              pyhd3eb1b0_1  
py-lief                   0.12.3          py311hd77b12b_0  
pyarrow                   11.0.0          py311h8a3a540_1  
pyasn1                    0.4.8              pyhd3eb1b0_0  
pyasn1-modules            0.2.8                      py_0  
pybind11-abi              4                    hd3eb1b0_1  
pycodestyle               2.10.0          py311haa95532_0  
pycosat                   0.6.4           py311h2bbff1b_0  
pycparser                 2.21               pyhd3eb1b0_0  
pyct                      0.5.0           py311haa95532_0  
pycurl                    7.45.2          py311he2ea4bf_1  
pydantic                  1.10.8          py311h2bbff1b_0  
pydispatcher              2.0.5           py311haa95532_2  
pydocstyle                6.3.0           py311haa95532_0  
pyerfa                    2.0.0           py311h2bbff1b_0  
pyflakes                  3.0.1           py311haa95532_0  
pygments                  2.15.1          py311haa95532_1  
pyjwt                     2.4.0           py311haa95532_0  
pylint                    2.16.2          py311haa95532_0  
pylint-venv               2.3.0           py311haa95532_0  
pyls-spyder               0.4.0              pyhd3eb1b0_0  
pynacl                    1.5.0           py311h8cc25b3_0  
pyodbc                    4.0.34          py311hd77b12b_0  
pyopenssl                 23.2.0          py311haa95532_0  
pyparsing                 3.0.9           py311haa95532_0  
pyqt                      5.15.7          py311hd77b12b_0  
pyqt5-sip                 12.11.0         py311hd77b12b_0  
pyqtwebengine             5.15.7          py311hd77b12b_0  
pyrsistent                0.18.0          py311h2bbff1b_0  
pysocks                   1.7.1           py311haa95532_0  
pytables                  3.8.0           py311h4671533_3  
pytest                    7.4.0           py311haa95532_0  
python                    3.11.5               he1021f5_0  
python-dateutil           2.8.2              pyhd3eb1b0_0  
python-dotenv             0.21.0          py311haa95532_0  
python-fastjsonschema     2.16.2          py311haa95532_0  
python-json-logger        2.0.7           py311haa95532_0  
python-kaleido            0.2.1           py311haa95532_0  
python-libarchive-c       2.9                pyhd3eb1b0_1  
python-lmdb               1.4.1           py311hd77b12b_0  
python-lsp-black          1.2.1           py311haa95532_0  
python-lsp-jsonrpc        1.0.0              pyhd3eb1b0_0  
python-lsp-server         1.7.2           py311haa95532_0  
python-slugify            5.0.2              pyhd3eb1b0_0  
python-snappy             0.6.1           py311hd77b12b_0  
python-tzdata             2023.3             pyhd3eb1b0_0  
python-xxhash             2.0.2           py311h2bbff1b_1  
pytoolconfig              1.2.5           py311haa95532_1  
pytz                      2023.3.post1    py311haa95532_0  
pyviz_comms               2.3.0           py311haa95532_0  
pywavelets                1.4.1           py311h2bbff1b_0  
pywin32                   305             py311h2bbff1b_0  
pywin32-ctypes            0.2.0           py311haa95532_1000  
pywinpty                  2.0.10          py311h5da7b33_0  
pyyaml                    6.0             py311h2bbff1b_1  
pyzmq                     25.1.2          py311hd77b12b_0  
qdarkstyle                3.0.2              pyhd3eb1b0_0  
qstylizer                 0.2.2           py311haa95532_0  
qt-main                   5.15.2               h879a1e9_9  
qt-webengine              5.15.9               h5bd16bc_7  
qtawesome                 1.2.2           py311haa95532_0  
qtconsole                 5.4.2           py311haa95532_0  
qtpy                      2.2.0           py311haa95532_0  
qtwebkit                  5.212                h2bbfb41_5  
queuelib                  1.5.0           py311haa95532_0  
re2                       2022.04.01           hd77b12b_0  
referencing               0.30.2          py311haa95532_0  
regex                     2022.7.9        py311h2bbff1b_0  
reproc                    14.2.4               hd77b12b_1  
reproc-cpp                14.2.4               hd77b12b_1  
requests                  2.31.0          py311haa95532_0  
requests-file             1.5.1              pyhd3eb1b0_0  
requests-toolbelt         1.0.0           py311haa95532_0  
responses                 0.13.3             pyhd3eb1b0_0  
rfc3339-validator         0.1.4           py311haa95532_0  
rfc3986-validator         0.1.1           py311haa95532_0  
rope                      1.7.0           py311haa95532_0  
rpds-py                   0.10.6          py311h062c2fa_0  
rtree                     1.0.1           py311h2eaa2aa_0  
ruamel.yaml               0.17.21         py311h2bbff1b_0  
ruamel_yaml               0.17.21         py311h2bbff1b_0  
s3fs                      2023.4.0        py311haa95532_0  
safetensors               0.3.2           py311h062c2fa_0  
scikit-image              0.20.0          py311h3513d60_0  
scikit-learn              1.3.0           py311hf62ec03_0  
scikit-learn-intelex      2023.1.1        py311haa95532_0  
scipy                     1.11.1          py311hc1ccb85_0  
scrapy                    2.8.0           py311haa95532_0  
seaborn                   0.12.2          py311haa95532_0  
send2trash                1.8.2           py311haa95532_0  
service_identity          18.1.0             pyhd3eb1b0_1  
setuptools                68.0.0          py311haa95532_0  
sip                       6.6.2           py311hd77b12b_0  
six                       1.16.0             pyhd3eb1b0_1  
smart_open                5.2.1           py311haa95532_0  
snappy                    1.1.9                h6c2663c_0  
sniffio                   1.2.0           py311haa95532_1  
snowballstemmer           2.2.0              pyhd3eb1b0_0  
sortedcontainers          2.4.0              pyhd3eb1b0_0  
soupsieve                 2.4             py311haa95532_0  
sphinx                    5.0.2           py311haa95532_0  
sphinxcontrib-applehelp   1.0.2              pyhd3eb1b0_0  
sphinxcontrib-devhelp     1.0.2              pyhd3eb1b0_0  
sphinxcontrib-htmlhelp    2.0.0              pyhd3eb1b0_0  
sphinxcontrib-jsmath      1.0.1              pyhd3eb1b0_0  
sphinxcontrib-qthelp      1.0.3              pyhd3eb1b0_0  
sphinxcontrib-serializinghtml 1.1.5              pyhd3eb1b0_0  
spyder                    5.4.3           py311haa95532_1  
spyder-kernels            2.4.4           py311haa95532_0  
sqlalchemy                1.4.39          py311h2bbff1b_0  
sqlite                    3.41.2               h2bbff1b_0  
stack_data                0.2.0              pyhd3eb1b0_0  
statsmodels               0.14.0          py311hd7041d2_0  
sympy                     1.11.1          py311haa95532_0  
tabulate                  0.8.10          py311haa95532_0  
tbb                       2021.8.0             h59b6b97_0  
tbb4py                    2021.8.0        py311h59b6b97_0  
tblib                     1.7.0              pyhd3eb1b0_0  
tenacity                  8.2.2           py311haa95532_0  
terminado                 0.17.1          py311haa95532_0  
text-unidecode            1.3                pyhd3eb1b0_0  
textdistance              4.2.1              pyhd3eb1b0_0  
threadpoolctl             2.2.0              pyh0d69192_0  
three-merge               0.1.1              pyhd3eb1b0_0  
tifffile                  2023.4.12       py311haa95532_0  
tinycss2                  1.2.1           py311haa95532_0  
tk                        8.6.12               h2bbff1b_0  
tldextract                3.2.0              pyhd3eb1b0_0  
tokenizers                0.13.2          py311h49fca51_1  
toml                      0.10.2             pyhd3eb1b0_0  
tomlkit                   0.11.1          py311haa95532_0  
toolz                     0.12.0          py311haa95532_0  
tornado                   6.3.2           py311h2bbff1b_0  
tqdm                      4.65.0          py311h746a85d_0  
traitlets                 5.7.1           py311haa95532_0  
transformers              4.32.1          py311haa95532_0  
twisted                   22.10.0         py311h2bbff1b_0  
twisted-iocpsupport       1.0.2           py311h2bbff1b_0  
typing-extensions         4.7.1           py311haa95532_0  
typing_extensions         4.7.1           py311haa95532_0  
tzdata                    2023c                h04d1e81_0  
uc-micro-py               1.0.1           py311haa95532_0  
ujson                     5.4.0           py311hd77b12b_0  
unidecode                 1.2.0              pyhd3eb1b0_0  
urllib3                   1.26.16         py311haa95532_0  
utf8proc                  2.6.1                h2bbff1b_0  
vc                        14.2                 h21ff451_1  
vs2015_runtime            14.27.29016          h5e58377_2  
w3lib                     1.21.0             pyhd3eb1b0_0  
watchdog                  2.1.6           py311haa95532_0  
wcwidth                   0.2.5              pyhd3eb1b0_0  
webencodings              0.5.1           py311haa95532_1  
websocket-client          0.58.0          py311haa95532_4  
werkzeug                  2.2.3           py311haa95532_0  
whatthepatch              1.0.2           py311haa95532_0  
wheel                     0.38.4          py311haa95532_0  
widgetsnbextension        4.0.5           py311haa95532_0  
win_inet_pton             1.1.0           py311haa95532_0  
winpty                    0.4.3                         4  
wrapt                     1.14.1          py311h2bbff1b_0  
xarray                    2023.6.0        py311haa95532_0  
xlwings                   0.29.1          py311haa95532_0  
xxhash                    0.8.0                h2bbff1b_3  
xyzservices               2022.9.0        py311haa95532_1  
xz                        5.4.2                h8cc25b3_0  
y-py                      0.5.9           py311hb6bf4ef_0  
yaml                      0.2.5                he774522_0  
yaml-cpp                  0.7.0                hd77b12b_1  
yapf                      0.31.0             pyhd3eb1b0_0  
yarl                      1.8.1           py311h2bbff1b_0  
ypy-websocket             0.8.2           py311haa95532_0  
zeromq                    4.3.5                hd77b12b_0  
zfp                       1.0.0                hd77b12b_0  
zict                      2.2.0           py311haa95532_0  
zipp                      3.11.0          py311haa95532_0  
zlib                      1.2.13               h8cc25b3_0  
zlib-ng                   2.0.7                h2bbff1b_0  
zope                      1.0             py311haa95532_1  
zope.interface            5.4.0           py311h2bbff1b_0  
zstandard                 0.19.0          py311h2bbff1b_0  
zstd                      1.5.5                hd43e919_0  

```
</details>

Hints from issue discussion:
Using Operating System Version: Windows 11 Home, not Windows 10 as mentioned in the issue report.

 

Best regards,

Florian

 

Von: Florian Bethe ***@***.***> 
Gesendet: Mittwoch, 7. Februar 2024 11:05
An: spyder-ide/spyder ***@***.***>
Cc: Florian Bethe ***@***.***>; Your activity ***@***.***>
Betreff: [spyder-ide/spyder] Adding "User environment variables in Windows registry" (Issue #21771)

 


Description


What steps will reproduce the problem?


1.	Clicked top menu Tools->Currentuserenvironment variables...
2.	Open context menu by right click in free space below environment variables list in windo "User environment variables in Windows registry - Dictionary (5 elements)"
3.	Pasted key "OMP_NUM_THREADS" from clipboard
4.	Entered value 1
5.	Clicked button "Save and Close" in the bottom-right corner of the window "User environment variables in Windows registry - Dictionary (5 elements)"
6.	List of environment variables got a new 6th entry (Key:OMP_NUM_THREADS|Type:int|Size:1|Value:1) in the first data row. Value cell has an orange background, all other data cells in column "Value" having a green background.

=> Window "Issue reporter" opened

Got this exception the first time I tried. Gonna try to reproduce the exception now.


Traceback

Traceback (most recent call last):
  File "C:\ProgramData\anaconda3\Lib\site-packages\spyder\utils\environ.py", line 239, in accept
    set_user_env(listdict2envdict(self.get_value()), parent=self)
  File "C:\ProgramData\anaconda3\Lib\site-packages\spyder\utils\environ.py", line 103, in set_user_env
    winreg.SetValueEx(key, name, 0, types[name], env_dict[name])
ValueError: Could not convert the data to the specified type.

Versions


*	Spyder version: 5.4.3 (conda)
*	Python version: 3.11.5 64-bit
*	Qt version: 5.15.2
*	PyQt5 version: 5.15.7
*	Operating System: Windows 10


Dependencies

# Mandatory:
atomicwrites >=1.2.0                             :  1.4.0 (OK)
chardet >=2.0.0                                  :  4.0.0 (OK)
cloudpickle >=0.5.0                              :  2.2.1 (OK)
cookiecutter >=1.6.0                             :  1.7.3 (OK)
diff_match_patch >=20181111                      :  20200713 (OK)
intervaltree >=3.0.2                             :  3.1.0 (OK)
IPython >=7.31.1,<9.0.0,!=8.8.0,!=8.9.0,!=8.10.0 :  8.15.0 (OK)
jedi >=0.17.2,<0.19.0                            :  0.18.1 (OK)
jellyfish >=0.7                                  :  1.0.1 (OK)
jsonschema >=3.2.0                               :  4.19.2 (OK)
keyring >=17.0.0                                 :  23.13.1 (OK)
nbconvert >=4.0                                  :  6.5.4 (OK)
numpydoc >=0.6.0                                 :  1.5.0 (OK)
paramiko >=2.4.0                                 :  2.8.1 (OK)
parso >=0.7.0,<0.9.0                             :  0.8.3 (OK)
pexpect >=4.4.0                                  :  4.8.0 (OK)
pickleshare >=0.4                                :  0.7.5 (OK)
psutil >=5.3                                     :  5.9.0 (OK)
pygments >=2.0                                   :  2.15.1 (OK)
pylint >=2.5.0,<3.0                              :  2.16.2 (OK)
pylint_venv >=2.1.1                              :  2.3.0 (OK)
pyls_spyder >=0.4.0                              :  0.4.0 (OK)
pylsp >=1.7.2,<1.8.0                             :  1.7.2 (OK)
pylsp_black >=1.2.0                              :  1.2.1 (OK)
qdarkstyle >=3.0.2,<3.2.0                        :  3.0.2 (OK)
qstylizer >=0.2.2                                :  0.2.2 (OK)
qtawesome >=1.2.1                                :  1.2.2 (OK)
qtconsole >=5.4.2,<5.5.0                         :  5.4.2 (OK)
qtpy >=2.1.0                                     :  2.2.0 (OK)
rtree >=0.9.7                                    :  1.0.1 (OK)
setuptools >=49.6.0                              :  68.0.0 (OK)
sphinx >=0.6.6                                   :  5.0.2 (OK)
spyder_kernels >=2.4.3,<2.5.0                    :  2.4.4 (OK)
textdistance >=4.2.0                             :  4.2.1 (OK)
three_merge >=0.1.1                              :  0.1.1 (OK)
watchdog >=0.10.3                                :  2.1.6 (OK)
zmq >=22.1.0                                     :  25.1.2 (OK)
 
# Optional:
cython >=0.21                                    :  None (NOK)
matplotlib >=3.0.0                               :  3.7.2 (OK)
numpy >=1.7                                      :  1.24.3 (OK)
pandas >=1.1.1                                   :  2.0.3 (OK)
scipy >=0.17.0                                   :  1.11.1 (OK)
sympy >=0.7.3                                    :  1.11.1 (OK)

Environment


Environment 

# packages in environment at C:\ProgramData\anaconda3:
#
# Name                    Version                   Build  Channel
_anaconda_depends         2023.09             py311_mkl_1  
abseil-cpp                20211102.0           hd77b12b_0  
aiobotocore               2.5.0           py311haa95532_0  
aiofiles                  22.1.0          py311haa95532_0  
aiohttp                   3.8.5           py311h2bbff1b_0  
aioitertools              0.7.1              pyhd3eb1b0_0  
aiosignal                 1.2.0              pyhd3eb1b0_0  
aiosqlite                 0.18.0          py311haa95532_0  
alabaster                 0.7.12             pyhd3eb1b0_0  
anaconda-anon-usage       0.4.2           py311hfc23b7f_0  
anaconda-catalogs         0.2.0           py311haa95532_0  
anaconda-client           1.12.1          py311haa95532_0  
anaconda-cloud-auth       0.1.3           py311haa95532_0  
anaconda-navigator        2.5.2           py311haa95532_0  
anaconda-project          0.11.1          py311haa95532_0  
anyio                     3.5.0           py311haa95532_0  
aom                       3.6.0                hd77b12b_0  
appdirs                   1.4.4              pyhd3eb1b0_0  
argon2-cffi               21.3.0             pyhd3eb1b0_0  
argon2-cffi-bindings      21.2.0          py311h2bbff1b_0  
arrow                     1.2.3           py311haa95532_1  
arrow-cpp                 11.0.0               ha81ea56_2  
astroid                   2.14.2          py311haa95532_0  
astropy                   5.1             py311h5bb9823_0  
asttokens                 2.0.5              pyhd3eb1b0_0  
async-lru                 2.0.4           py311haa95532_0  
async-timeout             4.0.2           py311haa95532_0  
atomicwrites              1.4.0                      py_0  
attrs                     23.1.0          py311haa95532_0  
automat                   20.2.0                     py_0  
autopep8                  1.6.0              pyhd3eb1b0_1  
aws-c-common              0.6.8                h2bbff1b_1  
aws-c-event-stream        0.1.6                hd77b12b_6  
aws-checksums             0.1.11               h2bbff1b_2  
aws-sdk-cpp               1.8.185              hd77b12b_1  
babel                     2.11.0          py311haa95532_0  
backcall                  0.2.0              pyhd3eb1b0_0  
backports                 1.1                pyhd3eb1b0_0  
backports.functools_lru_cache 1.6.4              pyhd3eb1b0_0  
backports.tempfile        1.0                pyhd3eb1b0_1  
backports.weakref         1.0.post1                  py_1  
bcrypt                    3.2.0           py311h2bbff1b_1  
beautifulsoup4            4.12.2          py311haa95532_0  
binaryornot               0.4.4              pyhd3eb1b0_1  
black                     23.3.0          py311haa95532_0  
blas                      1.0                         mkl  
bleach                    4.1.0              pyhd3eb1b0_0  
blosc                     1.21.3               h6c2663c_0  
bokeh                     3.2.1           py311h746a85d_0  
boltons                   23.0.0          py311haa95532_0  
boost-cpp                 1.82.0               h59b6b97_1  
botocore                  1.29.76         py311haa95532_0  
bottleneck                1.3.5           py311h5bb9823_0  
brotli                    1.0.9                h2bbff1b_7  
brotli-bin                1.0.9                h2bbff1b_7  
brotlipy                  0.7.0           py311h2bbff1b_1002  
bzip2                     1.0.8                he774522_0  
c-ares                    1.19.1               h2bbff1b_0  
c-blosc2                  2.8.0                hd77b12b_0  
ca-certificates           2023.12.12           haa95532_0  
certifi                   2023.11.17      py311haa95532_0  
cffi                      1.15.1          py311h2bbff1b_3  
cfitsio                   3.470                h2bbff1b_7  
chardet                   4.0.0           py311haa95532_1003  
charls                    2.2.0                h6c2663c_0  
charset-normalizer        2.0.4              pyhd3eb1b0_0  
click                     8.0.4           py311haa95532_0  
cloudpickle               2.2.1           py311haa95532_0  
clyent                    1.2.2           py311haa95532_1  
colorama                  0.4.6           py311haa95532_0  
colorcet                  3.0.1           py311haa95532_0  
comm                      0.1.2           py311haa95532_0  
conda                     23.7.4          py311haa95532_0  
conda-build               3.26.1          py311haa95532_0  
conda-content-trust       0.2.0           py311haa95532_0  
conda-index               0.3.0           py311haa95532_0  
conda-libmamba-solver     23.7.0          py311haa95532_0  
conda-pack                0.6.0              pyhd3eb1b0_0  
conda-package-handling    2.2.0           py311haa95532_0  
conda-package-streaming   0.9.0           py311haa95532_0  
conda-repo-cli            1.0.75          py311haa95532_0  
conda-token               0.4.0              pyhd3eb1b0_0  
conda-verify              3.4.2                      py_1  
console_shortcut          0.1.1                         4  
constantly                15.1.0          py311haa95532_0  
contourpy                 1.0.5           py311h59b6b97_0  
cookiecutter              1.7.3              pyhd3eb1b0_0  
cryptography              41.0.3          py311h89fc84f_0  
cssselect                 1.1.0              pyhd3eb1b0_0  
curl                      8.1.1                h2bbff1b_0  
cycler                    0.11.0             pyhd3eb1b0_0  
cytoolz                   0.12.0          py311h2bbff1b_0  
daal4py                   2023.1.1        py311h30df693_0  
dal                       2023.1.1         h59b6b97_48681  
dask                      2023.6.0        py311haa95532_0  
dask-core                 2023.6.0        py311haa95532_0  
datasets                  2.12.0          py311haa95532_0  
datashader                0.15.2          py311haa95532_0  
datashape                 0.5.4           py311haa95532_1  
dav1d                     1.2.1                h2bbff1b_0  
debugpy                   1.6.7           py311hd77b12b_0  
decorator                 5.1.1              pyhd3eb1b0_0  
defusedxml                0.7.1              pyhd3eb1b0_0  
diff-match-patch          20200713           pyhd3eb1b0_0  
dill                      0.3.6           py311haa95532_0  
distributed               2023.6.0        py311haa95532_0  
docstring-to-markdown     0.11            py311haa95532_0  
docutils                  0.18.1          py311haa95532_3  
entrypoints               0.4             py311haa95532_0  
et_xmlfile                1.1.0           py311haa95532_0  
executing                 0.8.3              pyhd3eb1b0_0  
filelock                  3.9.0           py311haa95532_0  
flake8                    6.0.0           py311haa95532_0  
flask                     2.2.2           py311haa95532_0  
fmt                       9.1.0                h6d14046_0  
fonttools                 4.25.0             pyhd3eb1b0_0  
freetype                  2.12.1               ha860e81_0  
frozenlist                1.3.3           py311h2bbff1b_0  
fsspec                    2023.4.0        py311haa95532_0  
future                    0.18.3          py311haa95532_0  
gensim                    4.3.0           py311heda8569_0  
gflags                    2.2.2                ha925a31_0  
giflib                    5.2.1                h8cc25b3_3  
glib                      2.69.1               h5dc1a3c_2  
glob2                     0.7                pyhd3eb1b0_0  
glog                      0.5.0                hd77b12b_0  
greenlet                  2.0.1           py311hd77b12b_0  
grpc-cpp                  1.48.2               hfe90ff0_1  
h5py                      3.9.0           py311h4e0e482_0  
hdf5                      1.12.1               h51c971a_3  
heapdict                  1.0.1              pyhd3eb1b0_0  
holoviews                 1.17.1          py311haa95532_0  
huggingface_hub           0.15.1          py311haa95532_0  
hvplot                    0.8.4           py311haa95532_0  
hyperlink                 21.0.0             pyhd3eb1b0_0  
icc_rt                    2022.1.0             h6049295_2  
icu                       58.2                 ha925a31_3  
idna                      3.4             py311haa95532_0  
imagecodecs               2023.1.23       py311he6ff3c7_0  
imageio                   2.26.0          py311haa95532_0  
imagesize                 1.4.1           py311haa95532_0  
imbalanced-learn          0.10.1          py311haa95532_1  
importlib-metadata        6.0.0           py311haa95532_0  
importlib_metadata        6.0.0                hd3eb1b0_0  
incremental               21.3.0             pyhd3eb1b0_0  
inflection                0.5.1           py311haa95532_0  
iniconfig                 1.1.1              pyhd3eb1b0_0  
intake                    0.6.8           py311haa95532_0  
intel-openmp              2023.1.0         h59b6b97_46319  
intervaltree              3.1.0              pyhd3eb1b0_0  
ipykernel                 6.25.0          py311h746a85d_0  
ipython                   8.15.0          py311haa95532_0  
ipython_genutils          0.2.0              pyhd3eb1b0_1  
ipywidgets                8.0.4           py311haa95532_0  
isort                     5.9.3              pyhd3eb1b0_0  
itemadapter               0.3.0              pyhd3eb1b0_0  
itemloaders               1.0.4              pyhd3eb1b0_1  
itsdangerous              2.0.1              pyhd3eb1b0_0  
jaraco.classes            3.2.1              pyhd3eb1b0_0  
jedi                      0.18.1          py311haa95532_1  
jellyfish                 1.0.1           py311h36a85e1_0  
jinja2                    3.1.2           py311haa95532_0  
jinja2-time               0.2.0              pyhd3eb1b0_3  
jmespath                  0.10.0             pyhd3eb1b0_0  
joblib                    1.2.0           py311haa95532_0  
jpeg                      9e                   h2bbff1b_1  
jq                        1.6                  haa95532_1  
json5                     0.9.6              pyhd3eb1b0_0  
jsonpatch                 1.32               pyhd3eb1b0_0  
jsonpointer               2.1                pyhd3eb1b0_0  
jsonschema                4.19.2          py311haa95532_0  
jsonschema-specifications 2023.7.1        py311haa95532_0  
jupyter                   1.0.0           py311haa95532_8  
jupyter-lsp               2.2.0           py311haa95532_0  
jupyter_client            7.4.9           py311haa95532_0  
jupyter_console           6.6.3           py311haa95532_0  
jupyter_core              5.3.0           py311haa95532_0  
jupyter_events            0.6.3           py311haa95532_0  
jupyter_server            2.10.0          py311haa95532_0  
jupyter_server_fileid     0.9.0           py311haa95532_0  
jupyter_server_terminals  0.4.4           py311haa95532_1  
jupyter_server_ydoc       0.8.0           py311haa95532_1  
jupyter_ydoc              0.2.4           py311haa95532_0  
jupyterlab                4.0.11          py311haa95532_0  
jupyterlab_pygments       0.1.2                      py_0  
jupyterlab_server         2.25.1          py311haa95532_0  
jupyterlab_widgets        3.0.9           py311haa95532_0  
kaleido-core              0.2.1                h2bbff1b_0  
keyring                   23.13.1         py311haa95532_0  
kiwisolver                1.4.4           py311hd77b12b_0  
krb5                      1.20.1               h5b6d351_0  
lazy-object-proxy         1.6.0           py311h2bbff1b_0  
lazy_loader               0.2             py311haa95532_0  
lcms2                     2.12                 h83e58a3_0  
lerc                      3.0                  hd77b12b_0  
libaec                    1.0.4                h33f27b4_1  
libarchive                3.6.2                hb62f4d4_2  
libavif                   0.11.1               h2bbff1b_0  
libboost                  1.82.0               hae598e9_1  
libbrotlicommon           1.0.9                h2bbff1b_7  
libbrotlidec              1.0.9                h2bbff1b_7  
libbrotlienc              1.0.9                h2bbff1b_7  
libclang                  14.0.6          default_hb5a9fac_1  
libclang13                14.0.6          default_h8e68704_1  
libcurl                   8.1.1                h86230a5_0  
libdeflate                1.17                 h2bbff1b_0  
libevent                  2.1.12               h56d1f94_1  
libffi                    3.4.4                hd77b12b_0  
libiconv                  1.16                 h2bbff1b_2  
liblief                   0.12.3               hd77b12b_0  
libmamba                  1.5.1                hcd6fe79_0  
libmambapy                1.5.1           py311h77c03ed_0  
libpng                    1.6.39               h8cc25b3_0  
libpq                     12.15                h906ac69_1  
libprotobuf               3.20.3               h23ce68f_0  
libsodium                 1.0.18               h62dcd97_0  
libsolv                   0.7.24               h23ce68f_0  
libspatialindex           1.9.3                h6c2663c_0  
libssh2                   1.10.0               he2ea4bf_2  
libthrift                 0.15.0               h4364b78_2  
libtiff                   4.5.1                hd77b12b_0  
libwebp                   1.3.2                hbc33d0d_0  
libwebp-base              1.3.2                h2bbff1b_0  
libxml2                   2.10.4               h0ad7f3c_1  
libxslt                   1.1.37               h2bbff1b_1  
libzopfli                 1.0.3                ha925a31_0  
linkify-it-py             2.0.0           py311haa95532_0  
llvmlite                  0.40.0          py311hf2fb9eb_0  
locket                    1.0.0           py311haa95532_0  
lxml                      4.9.3           py311h09808a7_0  
lz4                       4.3.2           py311h2bbff1b_0  
lz4-c                     1.9.4                h2bbff1b_0  
lzo                       2.10                 he774522_2  
m2-msys2-runtime          2.5.0.17080.65c939c               3  
m2-patch                  2.7.5                         2  
m2w64-libwinpthread-git   5.0.0.4634.697f757               2  
markdown                  3.4.1           py311haa95532_0  
markdown-it-py            2.2.0           py311haa95532_1  
markupsafe                2.1.1           py311h2bbff1b_0  
mathjax                   2.7.5                haa95532_0  
matplotlib                3.7.2           py311haa95532_0  
matplotlib-base           3.7.2           py311hf62ec03_0  
matplotlib-inline         0.1.6           py311haa95532_0  
mccabe                    0.7.0              pyhd3eb1b0_0  
mdit-py-plugins           0.3.0           py311haa95532_0  
mdurl                     0.1.0           py311haa95532_0  
menuinst                  1.4.19          py311h59b6b97_1  
mistune                   0.8.4           py311h2bbff1b_1000  
mkl                       2023.1.0         h6b88ed4_46357  
mkl-service               2.4.0           py311h2bbff1b_1  
mkl_fft                   1.3.8           py311h2bbff1b_0  
mkl_random                1.2.4           py311h59b6b97_0  
more-itertools            8.12.0             pyhd3eb1b0_0  
mpmath                    1.3.0           py311haa95532_0  
msgpack-python            1.0.3           py311h59b6b97_0  
msys2-conda-epoch         20160418                      1  
multidict                 6.0.2           py311h2bbff1b_0  
multipledispatch          0.6.0           py311haa95532_0  
multiprocess              0.70.14         py311haa95532_0  
munkres                   1.1.4                      py_0  
mypy_extensions           1.0.0           py311haa95532_0  
navigator-updater         0.4.0           py311haa95532_1  
nbclassic                 0.5.5           py311haa95532_0  
nbclient                  0.5.13          py311haa95532_0  
nbconvert                 6.5.4           py311haa95532_0  
nbformat                  5.9.2           py311haa95532_0  
nest-asyncio              1.5.6           py311haa95532_0  
networkx                  3.1             py311haa95532_0  
nltk                      3.8.1           py311haa95532_0  
notebook                  7.0.6           py311haa95532_0  
notebook-shim             0.2.2           py311haa95532_0  
numba                     0.57.1          py311hf62ec03_0  
numexpr                   2.8.4           py311h1fcbade_1  
numpy                     1.24.3          py311hdab7c0b_1  
numpy-base                1.24.3          py311hd01c5d8_1  
numpydoc                  1.5.0           py311haa95532_0  
openjpeg                  2.4.0                h4fc8c34_0  
openpyxl                  3.0.10          py311h2bbff1b_0  
openssl                   3.0.13               h2bbff1b_0  
orc                       1.7.4                h623e30f_1  
overrides                 7.4.0           py311haa95532_0  
packaging                 23.1            py311haa95532_0  
pandas                    2.0.3           py311hf62ec03_0  
pandocfilters             1.5.0              pyhd3eb1b0_0  
panel                     1.2.3           py311haa95532_0  
param                     1.13.0          py311haa95532_0  
paramiko                  2.8.1              pyhd3eb1b0_0  
parsel                    1.6.0           py311haa95532_0  
parso                     0.8.3              pyhd3eb1b0_0  
partd                     1.4.0           py311haa95532_0  
pathlib                   1.0.1              pyhd3eb1b0_1  
pathspec                  0.10.3          py311haa95532_0  
patsy                     0.5.3           py311haa95532_0  
pcre                      8.45                 hd77b12b_0  
pcre2                     10.42                h0ff8eda_0  
pep8                      1.7.1           py311haa95532_1  
pexpect                   4.8.0              pyhd3eb1b0_3  
pickleshare               0.7.5           pyhd3eb1b0_1003  
pillow                    10.0.1          py311h045eedc_0  
pip                       23.2.1          py311haa95532_0  
pkce                      1.0.3           py311haa95532_0  
pkginfo                   1.9.6           py311haa95532_0  
platformdirs              3.10.0          py311haa95532_0  
plotly                    5.9.0           py311haa95532_0  
pluggy                    1.0.0           py311haa95532_1  
ply                       3.11            py311haa95532_0  
powershell_shortcut       0.0.1                         3  
poyo                      0.5.0              pyhd3eb1b0_0  
prometheus_client         0.14.1          py311haa95532_0  
prompt-toolkit            3.0.36          py311haa95532_0  
prompt_toolkit            3.0.36               hd3eb1b0_0  
protego                   0.1.16                     py_0  
psutil                    5.9.0           py311h2bbff1b_0  
ptyprocess                0.7.0              pyhd3eb1b0_2  
pure_eval                 0.2.2              pyhd3eb1b0_0  
py-cpuinfo                8.0.0              pyhd3eb1b0_1  
py-lief                   0.12.3          py311hd77b12b_0  
pyarrow                   11.0.0          py311h8a3a540_1  
pyasn1                    0.4.8              pyhd3eb1b0_0  
pyasn1-modules            0.2.8                      py_0  
pybind11-abi              4                    hd3eb1b0_1  
pycodestyle               2.10.0          py311haa95532_0  
pycosat                   0.6.4           py311h2bbff1b_0  
pycparser                 2.21               pyhd3eb1b0_0  
pyct                      0.5.0           py311haa95532_0  
pycurl                    7.45.2          py311he2ea4bf_1  
pydantic                  1.10.8          py311h2bbff1b_0  
pydispatcher              2.0.5           py311haa95532_2  
pydocstyle                6.3.0           py311haa95532_0  
pyerfa                    2.0.0           py311h2bbff1b_0  
pyflakes                  3.0.1           py311haa95532_0  
pygments                  2.15.1          py311haa95532_1  
pyjwt                     2.4.0           py311haa95532_0  
pylint                    2.16.2          py311haa95532_0  
pylint-venv               2.3.0           py311haa95532_0  
pyls-spyder               0.4.0              pyhd3eb1b0_0  
pynacl                    1.5.0           py311h8cc25b3_0  
pyodbc                    4.0.34          py311hd77b12b_0  
pyopenssl                 23.2.0          py311haa95532_0  
pyparsing                 3.0.9           py311haa95532_0  
pyqt                      5.15.7          py311hd77b12b_0  
pyqt5-sip                 12.11.0         py311hd77b12b_0  
pyqtwebengine             5.15.7          py311hd77b12b_0  
pyrsistent                0.18.0          py311h2bbff1b_0  
pysocks                   1.7.1           py311haa95532_0  
pytables                  3.8.0           py311h4671533_3  
pytest                    7.4.0           py311haa95532_0  
python                    3.11.5               he1021f5_0  
python-dateutil           2.8.2              pyhd3eb1b0_0  
python-dotenv             0.21.0          py311haa95532_0  
python-fastjsonschema     2.16.2          py311haa95532_0  
python-json-logger        2.0.7           py311haa95532_0  
python-kaleido            0.2.1           py311haa95532_0  
python-libarchive-c       2.9                pyhd3eb1b0_1  
python-lmdb               1.4.1           py311hd77b12b_0  
python-lsp-black          1.2.1           py311haa95532_0  
python-lsp-jsonrpc        1.0.0              pyhd3eb1b0_0  
python-lsp-server         1.7.2           py311haa95532_0  
python-slugify            5.0.2              pyhd3eb1b0_0  
python-snappy             0.6.1           py311hd77b12b_0  
python-tzdata             2023.3             pyhd3eb1b0_0  
python-xxhash             2.0.2           py311h2bbff1b_1  
pytoolconfig              1.2.5           py311haa95532_1  
pytz                      2023.3.post1    py311haa95532_0  
pyviz_comms               2.3.0           py311haa95532_0  
pywavelets                1.4.1           py311h2bbff1b_0  
pywin32                   305             py311h2bbff1b_0  
pywin32-ctypes            0.2.0           py311haa95532_1000  
pywinpty                  2.0.10          py311h5da7b33_0  
pyyaml                    6.0             py311h2bbff1b_1  
pyzmq                     25.1.2          py311hd77b12b_0  
qdarkstyle                3.0.2              pyhd3eb1b0_0  
qstylizer                 0.2.2           py311haa95532_0  
qt-main                   5.15.2               h879a1e9_9  
qt-webengine              5.15.9               h5bd16bc_7  
qtawesome                 1.2.2           py311haa95532_0  
qtconsole                 5.4.2           py311haa95532_0  
qtpy                      2.2.0           py311haa95532_0  
qtwebkit                  5.212                h2bbfb41_5  
queuelib                  1.5.0           py311haa95532_0  
re2                       2022.04.01           hd77b12b_0  
referencing               0.30.2          py311haa95532_0  
regex                     2022.7.9        py311h2bbff1b_0  
reproc                    14.2.4               hd77b12b_1  
reproc-cpp                14.2.4               hd77b12b_1  
requests                  2.31.0          py311haa95532_0  
requests-file             1.5.1              pyhd3eb1b0_0  
requests-toolbelt         1.0.0           py311haa95532_0  
responses                 0.13.3             pyhd3eb1b0_0  
rfc3339-validator         0.1.4           py311haa95532_0  
rfc3986-validator         0.1.1           py311haa95532_0  
rope                      1.7.0           py311haa95532_0  
rpds-py                   0.10.6          py311h062c2fa_0  
rtree                     1.0.1           py311h2eaa2aa_0  
ruamel.yaml               0.17.21         py311h2bbff1b_0  
ruamel_yaml               0.17.21         py311h2bbff1b_0  
s3fs                      2023.4.0        py311haa95532_0  
safetensors               0.3.2           py311h062c2fa_0  
scikit-image              0.20.0          py311h3513d60_0  
scikit-learn              1.3.0           py311hf62ec03_0  
scikit-learn-intelex      2023.1.1        py311haa95532_0  
scipy                     1.11.1          py311hc1ccb85_0  
scrapy                    2.8.0           py311haa95532_0  
seaborn                   0.12.2          py311haa95532_0  
send2trash                1.8.2           py311haa95532_0  
service_identity          18.1.0             pyhd3eb1b0_1  
setuptools                68.0.0          py311haa95532_0  
sip                       6.6.2           py311hd77b12b_0  
six                       1.16.0             pyhd3eb1b0_1  
smart_open                5.2.1           py311haa95532_0  
snappy                    1.1.9                h6c2663c_0  
sniffio                   1.2.0           py311haa95532_1  
snowballstemmer           2.2.0              pyhd3eb1b0_0  
sortedcontainers          2.4.0              pyhd3eb1b0_0  
soupsieve                 2.4             py311haa95532_0  
sphinx                    5.0.2           py311haa95532_0  
sphinxcontrib-applehelp   1.0.2              pyhd3eb1b0_0  
sphinxcontrib-devhelp     1.0.2              pyhd3eb1b0_0  
sphinxcontrib-htmlhelp    2.0.0              pyhd3eb1b0_0  
sphinxcontrib-jsmath      1.0.1              pyhd3eb1b0_0  
sphinxcontrib-qthelp      1.0.3              pyhd3eb1b0_0  
sphinxcontrib-serializinghtml 1.1.5              pyhd3eb1b0_0  
spyder                    5.4.3           py311haa95532_1  
spyder-kernels            2.4.4           py311haa95532_0  
sqlalchemy                1.4.39          py311h2bbff1b_0  
sqlite                    3.41.2               h2bbff1b_0  
stack_data                0.2.0              pyhd3eb1b0_0  
statsmodels               0.14.0          py311hd7041d2_0  
sympy                     1.11.1          py311haa95532_0  
tabulate                  0.8.10          py311haa95532_0  
tbb                       2021.8.0             h59b6b97_0  
tbb4py                    2021.8.0        py311h59b6b97_0  
tblib                     1.7.0              pyhd3eb1b0_0  
tenacity                  8.2.2           py311haa95532_0  
terminado                 0.17.1          py311haa95532_0  
text-unidecode            1.3                pyhd3eb1b0_0  
textdistance              4.2.1              pyhd3eb1b0_0  
threadpoolctl             2.2.0              pyh0d69192_0  
three-merge               0.1.1              pyhd3eb1b0_0  
tifffile                  2023.4.12       py311haa95532_0  
tinycss2                  1.2.1           py311haa95532_0  
tk                        8.6.12               h2bbff1b_0  
tldextract                3.2.0              pyhd3eb1b0_0  
tokenizers                0.13.2          py311h49fca51_1  
toml                      0.10.2             pyhd3eb1b0_0  
tomlkit                   0.11.1          py311haa95532_0  
toolz                     0.12.0          py311haa95532_0  
tornado                   6.3.2           py311h2bbff1b_0  
tqdm                      4.65.0          py311h746a85d_0  
traitlets                 5.7.1           py311haa95532_0  
transformers              4.32.1          py311haa95532_0  
twisted                   22.10.0         py311h2bbff1b_0  
twisted-iocpsupport       1.0.2           py311h2bbff1b_0  
typing-extensions         4.7.1           py311haa95532_0  
typing_extensions         4.7.1           py311haa95532_0  
tzdata                    2023c                h04d1e81_0  
uc-micro-py               1.0.1           py311haa95532_0  
ujson                     5.4.0           py311hd77b12b_0  
unidecode                 1.2.0              pyhd3eb1b0_0  
urllib3                   1.26.16         py311haa95532_0  
utf8proc                  2.6.1                h2bbff1b_0  
vc                        14.2                 h21ff451_1  
vs2015_runtime            14.27.29016          h5e58377_2  
w3lib                     1.21.0             pyhd3eb1b0_0  
watchdog                  2.1.6           py311haa95532_0  
wcwidth                   0.2.5              pyhd3eb1b0_0  
webencodings              0.5.1           py311haa95532_1  
websocket-client          0.58.0          py311haa95532_4  
werkzeug                  2.2.3           py311haa95532_0  
whatthepatch              1.0.2           py311haa95532_0  
wheel                     0.38.4          py311haa95532_0  
widgetsnbextension        4.0.5           py311haa95532_0  
win_inet_pton             1.1.0           py311haa95532_0  
winpty                    0.4.3                         4  
wrapt                     1.14.1          py311h2bbff1b_0  
xarray                    2023.6.0        py311haa95532_0  
xlwings                   0.29.1          py311haa95532_0  
xxhash                    0.8.0                h2bbff1b_3  
xyzservices               2022.9.0        py311haa95532_1  
xz                        5.4.2                h8cc25b3_0  
y-py                      0.5.9           py311hb6bf4ef_0  
yaml                      0.2.5                he774522_0  
yaml-cpp                  0.7.0                hd77b12b_1  
yapf                      0.31.0             pyhd3eb1b0_0  
yarl                      1.8.1           py311h2bbff1b_0  
ypy-websocket             0.8.2           py311haa95532_0  
zeromq                    4.3.5                hd77b12b_0  
zfp                       1.0.0                hd77b12b_0  
zict                      2.2.0           py311haa95532_0  
zipp                      3.11.0          py311haa95532_0  
zlib                      1.2.13               h8cc25b3_0  
zlib-ng                   2.0.7                h2bbff1b_0  
zope                      1.0             py311haa95532_1  
zope.interface            5.4.0           py311h2bbff1b_0  
zstandard                 0.19.0          py311h2bbff1b_0  
zstd                      1.5.5                hd43e919_0  
 

—
Reply to this email directly, view it on GitHub <https://github.com/spyder-ide/spyder/issues/21771> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AOJMGLVPICGCMOCVT45OKSTYSNGVTAVCNFSM6AAAAABC5QTQLCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGEZDENRUG42TQNI> .
You are receiving this because you are subscribed to this thread.  <https://github.com/notifications/beacon/AOJMGLV362RFJPFOTUFXVEDYSNGVTA5CNFSM6AAAAABC5QTQLCWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHH5BIIEE.gif> Message ID: ***@***.*** ***@***.***> >



-- 
Diese E-Mail wurde von Avast-Antivirussoftware auf Viren geprüft.
www.avast.com
Hey @FlorianBethe, thanks for reporting and a detailed description of your problem.

@mrclary, could you take a look at this to see if you're able to reproduce it? Thanks!
In my Windows VM, I can reproduce the error with minimal environment:
```
$ mamba create -n issue-21771 python=3.11.5 spyder=5.4.3
```
I can also reproduce the error with our latest 5.5.1 release on Python 3.10 and our latest master on Python 3.10.
I suspect maybe a change to `winreg`?
Yeah, it probably is. Could you take a look at this for 6.0 final?

Commit message: Fix issue: "ValueError: Could not convert the data to the specified type."

When inserting new variable in user environment variables on Windows, the value may not be a string and results in the error above.

Patch to review:
diff --git a/spyder/utils/environ.py b/spyder/utils/environ.py
index 899e241ee3c..fc95d78f749 100644
--- a/spyder/utils/environ.py
+++ b/spyder/utils/environ.py
@@ -131,7 +131,7 @@ def set_user_env(env, parent=None):
     Set user environment variables via HKCU (Windows) or shell startup file
     (Unix).
     """
-    env_dict = listdict2envdict(env)
+    env_dict = clean_env(listdict2envdict(env))
 
     if os.name == 'nt':
         types = dict()
diff --git a/spyder/widgets/collectionseditor.py b/spyder/widgets/collectionseditor.py
index 4e3292eded6..09dfdb4a1ca 100644
--- a/spyder/widgets/collectionseditor.py
+++ b/spyder/widgets/collectionseditor.py
@@ -1590,6 +1590,7 @@ def set_filter(self, dictfilter=None):
 
 class CollectionsEditorWidget(QWidget, SpyderWidgetMixin):
     """Dictionary Editor Widget"""
+    CONF_SECTION = 'main'
 
     sig_refresh_requested = Signal()
 


Code review comments:
diff_hunk: @@ -1590,6 +1590,7 @@ def set_filter(self, dictfilter=None):
 
 class CollectionsEditorWidget(QWidget, SpyderWidgetMixin):
     """Dictionary Editor Widget"""
+    CONF_SECTION = 'main'
path: spyder/widgets/collectionseditor.py
text: @user1:
```suggestion
    # Dummy conf section to avoid a warning from SpyderConfigurationObserver
    CONF_SECTION = ""
```