spyder 5.4.4+ds-1 autopkgtest fails

Bug #2033518 reported by Benjamin Drung
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
spyderlib
New
Unknown
spyder (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

The autopkgtest for spyder 5.4.4+ds-1 fails:

```
=================================== FAILURES ===================================
_____________________ test_get_user_environment_variables ______________________

    def test_get_user_environment_variables():
        """Test get_user_environment_variables function"""
        # All platforms should have a path environment variable, but
        # Windows may have mixed case.
        keys = {k.lower() for k in get_user_environment_variables()}
> assert "path" in keys
E AssertionError: assert 'path' in {'_', 'debuginfod_urls', 'home', 'lc_ctype', 'pwd', 'shlvl'}

spyder/utils/tests/test_environ.py:42: AssertionError
_________________________________ test_environ _________________________________

environ_dialog = <spyder.utils.environ.UserEnvDialog object at 0x7ff4e3e3b400>
qtbot = <pytestqt.qtbot.QtBot object at 0x7ff4e39caad0>

    def test_environ(environ_dialog, qtbot):
        """Test the environment variables dialog."""
        environ_dialog.show()
        assert environ_dialog

        # All platforms should have a path environment variable, but
        # Windows may have mixed case.
        keys = {k.lower() for k in environ_dialog.get_value()}
> assert "path" in keys
E AssertionError: assert 'path' in {'_', 'debuginfod_urls', 'home', 'lc_ctype', 'pwd', 'shlvl'}

spyder/utils/tests/test_environ.py:64: AssertionError
=============================== warnings summary ===============================
```

Running `env` before the test is executed in the autopkgtest shows that `PATH` is set:

```
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
```

But running something similar to the spyder code does not contain the PATH variable:

```
$ env -i bash -l -c env | sort
DEBUGINFOD_URLS=https://debuginfod.ubuntu.com
PWD=/tmp/autopkgtest.wq0cE8/build.3Mr/real-tree
SHLVL=0
_=/bin/env
```

Benjamin Drung (bdrung)
description: updated
Revision history for this message
Benjamin Drung (bdrung) wrote :

The current upstream master approach seems to work (tested in schroot):

```
$ cat user-env.sh
#!/bin/bash -i
unset HISTFILE
#/bin/bash -l -c "/usr/bin/python3 -c 'import os; print(dict(os.environ))'"
/bin/bash -l -c env | grep PATH
$ ./user-env.sh
PATH=/usr/local/bin:/usr/bin:/bin
```

Revision history for this message
Benjamin Drung (bdrung) wrote (last edit ):

Correction: The user-env.sh script does not work inside a schroot when running with an empty environment:

```
$ schroot-wrapper -p python3,vim -c mantic
$ cat user-env.sh
#!/bin/bash -i
unset HISTFILE
/bin/bash -l -c "/usr/bin/python3 -c 'import os; print(dict(os.environ))'"
$ env -i ./user-env.sh
{'PWD': '/home/myuser', 'SHLVL': '1', '_': '/usr/bin/python3', 'LC_CTYPE': 'C.UTF-8'}
```

Revision history for this message
Benjamin Drung (bdrung) wrote :
Changed in spyderlib:
status: Unknown → New
Revision history for this message
Jose Luis Rivero (j-rivero) wrote :

Upstream fix was merged and released in 5.5.0. Noble is shipping this patch.

Revision history for this message
Benjamin Drung (bdrung) wrote :

The spyder 5.5.1+ds-1 autopkgtest on amd64 is succeeding.

Changed in spyder (Ubuntu):
status: New → Fix Released
tags: removed: update-excuse
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.