melodic-thailand-99227
10/31/2021, 3:46 PMenough-analyst-54434
10/31/2021, 3:48 PMenough-analyst-54434
10/31/2021, 3:49 PMenough-analyst-54434
10/31/2021, 3:50 PMmelodic-thailand-99227
10/31/2021, 3:54 PMenough-analyst-54434
10/31/2021, 3:58 PM-ldebug
to the command line:
$ ./pants -ldebug test src/python/pants/util/strutil_test.py
...
08:56:14.34 [DEBUG] spawned local process as Some(16645) for Process { argv: ["./pytest_runner.pex_pex_shim.sh", "--no-header", "src/python/pants/util/strutil_test.py"], env: {"GPG_TTY": "/dev/pts/15", "PEX_EXTRA_SYS_PATH": "src/python", "PYTEST_ADDOPTS": "--color=yes --junitxml=src.python.pants.util.strutil_test.py.tests.xml -o junit_family=xunit2"}, working_directory: None, input_files: Digest { hash: Fingerprint<88a121e60364dcb235c1cf224eb676d90cb764838823024e57c970a80277c215>, size_bytes: 914 }, output_files: {RelativePath("src.python.pants.util.strutil_test.py.tests.xml")}, output_directories: {RelativePath("extra-output")}, timeout: Some(60s), execution_slot_variable: None, description: "Run Pytest for src/python/pants/util/strutil_test.py:tests", level: Debug, append_only_caches: {CacheName("pex_root"): CacheDest(".cache/pex_root")}, jdk_home: None, platform_constraint: None, use_nailgun: Digest { hash: Fingerprint<e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855>, size_bytes: 0 }, cache_scope: Successful }
08:56:14.46 [DEBUG] handle_workunits total=5355 completed=5352 started=5342 finished=False calls=2
08:56:14.54 [DEBUG] Completed: Run Pytest for src/python/pants/util/strutil_test.py:tests
08:56:14.54 [DEBUG] Completed: Scheduling: Run Pytest for src/python/pants/util/strutil_test.py:tests
08:56:14.55 [INFO] Completed: Run Pytest - src/python/pants/util/strutil_test.py:tests succeeded.
✓ src/python/pants/util/strutil_test.py:tests succeeded.
08:56:14.55 [DEBUG] Completed: `test` goal
08:56:14.55 [DEBUG] computed 1 nodes in 2.161858 seconds. there are 6637 total nodes.
08:56:14.55 [DEBUG] Async completion is enabled: workunit callbacks will complete in the background.
Notice the spawned local process as Some(16645) for Process { argv: ["./pytest_runner.pex_pex_shim.sh" ...
line. That has the env
passed in it.enough-analyst-54434
10/31/2021, 3:59 PMmelodic-thailand-99227
10/31/2021, 4:00 PMenough-analyst-54434
10/31/2021, 4:01 PM$ curl -sSL <https://raw.githubusercontent.com/boto/boto/develop/boto/__init__.py> -O
$ LANG= LC_TYPE= LC_ALL= python3.8 -mcompileall __init__.py
Compiling '__init__.py'...
enough-analyst-54434
10/31/2021, 4:15 PM$ python3.8 -W all -c 'print("""\c""")'
<string>:1: DeprecationWarning: invalid escape sequence \c
\c
Then:
python3.8 -W error -c 'print("""\c""")'
File "<string>", line 1
SyntaxError: invalid escape sequence \c
So you must have warnings setup to be treated as errors? Perhaps via PYTHONWARNINGS or ... I'm not sure.enough-analyst-54434
10/31/2021, 4:24 PMPYTHONWARNINGS=error
happening in Pants you'd have to deliberately tweak pants.toml to set that environment variable or else allow it to pass through.enough-analyst-54434
10/31/2021, 4:32 PMpython
binary. That was my only other idea:
1. You had such a binary on your system with a default of -W error
baked into the binary somehow.
2. Pants was choosing 1 and your runs from the command line were using a different Python without that baked in.enough-analyst-54434
10/31/2021, 4:37 PMmelodic-thailand-99227
10/31/2021, 5:56 PMmelodic-thailand-99227
10/31/2021, 5:56 PMenough-analyst-54434
10/31/2021, 8:42 PM./pants repl ::
which will create a venv and drop you into that venv's repl. That said, the best way to debug this is probably by adding --no-process-execution-local-cleanup
. That will print out /tmp/...
directories each process runs in. You can then cd into the /tmp/...
dir corresponding to the failing test and execute ./__run.sh
to reproduce, and then, after that experiment with what is happening inside that script.