Skip to content

Setting envvars_force_uppercase to false lowercases other environment variables #14934

@travishathaway

Description

@travishathaway

Checklist

  • I added a descriptive title
  • I searched open reports and couldn't find a duplicate

What happened?

When setting the envvars_force_uppercase to false:

conda config --set envvars_force_uppercase false

This changes to the activation code to output the following (conda shell.posix activate):

unset _CE_M
unset _CE_CONDA
PS1='(base) '
export path='/Users/username/miniconda3/bin:/Users/username/miniconda3/condabin'
export conda_prefix='/Users/username/miniconda3'
export conda_shlvl='1'
export conda_default_env='base'
export conda_prompt_modifier='(base) '
export CONDA_EXE='/Users/username/miniconda3/bin/conda'
export CONDA_PYTHON_EXE='/Users/username/miniconda3/bin/python'

You'll notice that environment variables like PATH and CONDA_PREFIX are lowercase which is not what we want. This causes all kinds of weird side-effects further on in the session. For example, look at my changing command prompt:

(test) root@7a7752c8176e:/# conda deactivate
(test) root@7a7752c8176e:/# conda activate base
(base) (test) root@7a7752c8176e:/# conda activate test
(test) (test) root@7a7752c8176e:/# conda activate base
(base) (test) (test) root@7a7752c8176e:/# conda activate test
(test) (test) (test) root@7a7752c8176e:/# 😬 

Furthermore, it also seems like this can break activation altogether when a variable has been set beforehand for the environment via:

conda env config vars set foo=bar --name test

This was the error I received on osx-arm64 with zsh after trying to activate this environment:

(eval):export:4: path: inconsistent type for assignment

Conda Info

active environment : base
    active env location : /opt/conda
            shell level : 1
       user config file : /root/.condarc
 populated config files : /opt/conda/.condarc
                          /root/.condarc
          conda version : 25.3.1
    conda-build version : not installed
         python version : 3.13.2.final.0
                 solver : libmamba (default)
       virtual packages : __archspec=1=x86_64
                          __conda=25.3.1=0
                          __glibc=2.36=0
                          __linux=5.15.49=0
                          __unix=0=0
       base environment : /opt/conda  (writable)
      conda av data dir : /opt/conda/etc/conda
  conda av metadata url : None
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /opt/conda/pkgs
                          /root/.conda/pkgs
       envs directories : /opt/conda/envs
                          /root/.conda/envs
               platform : linux-64
             user-agent : conda/25.3.1 requests/2.32.3 CPython/3.13.2 Linux/5.15.49-linuxkit debian/12.10 glibc/2.36 solver/libmamba conda-libmamba-solver/25.4.0 libmambapy/2.0.5 aau/0.7.0 c/. s/. e/.
                UID:GID : 0:0
             netrc file : None
           offline mode : False

Conda Config

==> /opt/conda/.condarc <==
channels:
  - defaults

==> /root/.condarc <==
channels:
  - defaults
envvars_force_uppercase: False

Conda list

n/a

Additional Context

I tested against 25.5.x and 25.3.x and saw similar behavior.

Metadata

Metadata

Labels

severity::1blocker; broken functionality with no workaroundsource::contributorcreated by a frequent contributortype::bugdescribes erroneous operation, use severity::* to classify the type

Type

No type

Projects

Status

🏁 Done

Status

Done 💪🏾

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions