Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling of "#" in commands has changed in tox4 #2617

Closed
osfrickler opened this issue Dec 7, 2022 · 1 comment · Fixed by #2621
Closed

Handling of "#" in commands has changed in tox4 #2617

osfrickler opened this issue Dec 7, 2022 · 1 comment · Fixed by #2621
Assignees
Labels
area:documentation help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted.

Comments

@osfrickler
Copy link

Issue

Sample tox.ini:

[testenv]
allowlist_externals = 
  bash
commands =
  bash -c "echo 'foo#bar'"

With tox3:

python run-test-pre: PYTHONHASHSEED='411589126'
python run-test: commands[0] | bash -c 'echo '"'"'foo#bar'"'"''
foo#bar
__________________________________________________________________________________________ summary ___________________________________________________________________________________________
  python: commands succeeded
  congratulations :)

With tox4:

py: commands[0]> bash -c '"echo '"'"'foo'
/usr/bin/bash: -c: line 1: unexpected EOF while looking for matching `"'
/usr/bin/bash: -c: line 2: syntax error: unexpected end of file
py: exit 2 (0.00 seconds) /home/jharbott/tmp> bash -c '"echo '"'"'foo' pid=125625
  py: FAIL code 2 (0.03=setup[0.02]+cmd[0.00] seconds)
  evaluation failed :( (0.06 seconds)

Escaping the # as \# solves the issue and seems to be backwards compatible, so maybe this is just the expected behaviour.

Environment

Provide at least:

  • OS: Ubuntu 22.04
@gaborbernat
Copy link
Member

Yes you're right escaping is the path ahead, we need to document it though in the breaking section 👍 PR welcome.

@jugmac00 jugmac00 self-assigned this Dec 7, 2022
@gaborbernat gaborbernat added this to the 4.0.x milestone Dec 7, 2022
jugmac00 added a commit to jugmac00/tox that referenced this issue Dec 7, 2022
... `commands_pre` or `commands_post`.

This fixes tox-dev#2617.
jugmac00 added a commit to jugmac00/tox that referenced this issue Dec 7, 2022
... `commands_pre` or `commands_post`.

This fixes tox-dev#2617.
gaborbernat pushed a commit to jugmac00/tox that referenced this issue Dec 8, 2022
... `commands_pre` or `commands_post`.

This fixes tox-dev#2617.
@gaborbernat gaborbernat added the help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted. label Dec 8, 2022
gaborbernat pushed a commit that referenced this issue Dec 8, 2022
Co-authored-by: Bernát Gábor <bgabor8@bloomberg.net>
fixes #2617
Resolves #2615
matthewhegarty added a commit to matthewhegarty/django-import-export that referenced this issue Jan 31, 2023
matthewhegarty added a commit to django-import-export/django-import-export that referenced this issue Jan 31, 2023
* tox updates

* bumped setup-python

* fix handling of # char (tox-dev/tox#2617)

* updated dep url

* removed escape char from tox.ini

* added double escape

* removed broken escape char

* added tox minversion

* upgrade to tox v4 syntax

* updated tox versions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:documentation help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants