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

Add errors="backslashreplace" to run_with_env_secrets.py #5456

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

lucylq
Copy link
Contributor

@lucylq lucylq commented Jul 17, 2024

See: https://fb.workplace.com/groups/4571909969591489/permalink/7818394354943018/

ExecuTorch CI was running into an issue where non-utf8 print output caused tests to crash. This was resolved by removing the printing in pytorch/executorch#4268.

This PR updates the error handling to use backslashreplace, which should still show us the error/printing, but without crashing the test.

From https://docs.python.org/3.9/library/io.html#io.TextIOWrapper:

'backslashreplace' causes malformed data to be replaced by a backslashed escape sequence. 

From https://docs.python.org/3/library/subprocess.html#frequently-used-arguments:

If encoding or errors are specified, or text (also known as universal_newlines) is true, the file objects stdin, stdout and stderr will be opened in text mode using the encoding and errors specified in the call or the defaults for io.TextIOWrapper.

Copy link

vercel bot commented Jul 17, 2024

@lucylq is attempting to deploy a commit to the Meta Open Source Team on Vercel.

A member of the Team first needs to authorize it.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 17, 2024
@lucylq lucylq changed the title test run_with_env_secrets.py change Add errors= Jul 17, 2024
@lucylq lucylq changed the title Add errors= Add errors="backslashreplace" to run_with_env_secrets.py Jul 17, 2024
@lucylq lucylq marked this pull request as ready for review July 17, 2024 17:11
@lucylq
Copy link
Contributor Author

lucylq commented Jul 17, 2024

test-secrets-filter-var tests are failing, though they seem to fail on an empty PR too, see #5458. Also looks like they're run sporadically, from HUD: https://hud.pytorch.org/hud/pytorch/test-infra/main/1?per_page=50

Do these tests require specific permissions?

@clee2000 clee2000 requested review from huydhn and a team July 17, 2024 17:37
Copy link

vercel bot commented Jul 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
torchci ⬜️ Ignored (Inspect) Visit Preview Jul 23, 2024 8:35am

@huydhn
Copy link
Contributor

huydhn commented Jul 23, 2024

run_with_env_secrets script is one of those few workflow whose tests would fail if the PR is a forked PR, so let me quickly double check this before landing

huydhn added a commit that referenced this pull request Jul 23, 2024
@huydhn
Copy link
Contributor

huydhn commented Jul 23, 2024

All tests pass on my end https://github.com/pytorch/test-infra/pull/5492/checks, so I guess this is good to go.

@huydhn huydhn merged commit 52f9014 into pytorch:main Jul 23, 2024
26 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants