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

Fix git clone test on non-English locale #8843

Merged
merged 1 commit into from
Jan 20, 2024

Conversation

kkhramova
Copy link
Contributor

@kkhramova kkhramova commented Jan 3, 2024

Pull Request Check List

  • Added tests for changed code.
  • Updated documentation for changed code.

When running tests using a non-English locale vcs.git.test_system.TestSystemGit test fails because git uses localized messages in its output.

To reproduce run:

LANG=uk_UA.UTF-8 poetry run pytest

This PR fixes the issue by ignoring any output from git commands.

@dimbleby
Copy link
Contributor

dimbleby commented Jan 3, 2024

IMO it doesnt make a lot of sense for SystemGit.run() (and .clone() and .checkout()) to return strings.

Suggest that it would be preferable to use subprocess.check_call() - sending stdout to devnull - instead of subprocess.check_output(), then the locale is of no interest to anyone.

@kkhramova kkhramova force-pushed the git-clone-locale-fix branch from 8e02c18 to e38341b Compare January 12, 2024 17:46
@kkhramova
Copy link
Contributor Author

I made the changes, @dimbleby.
Can you please take another look?

@dimbleby
Copy link
Contributor

Suggest that it would be preferable to use subprocess.check_call() - sending stdout to devnull - instead of subprocess.check_output()

@kkhramova kkhramova force-pushed the git-clone-locale-fix branch from e38341b to 464c392 Compare January 13, 2024 01:26
@kkhramova
Copy link
Contributor Author

Thank you, @dimbleby
Now subprocess.check_output() is changed to subprocess.check_call()

@dimbleby
Copy link
Contributor

and how about redirecting stdout? does the code as written write the output to the terminal?

@kkhramova kkhramova force-pushed the git-clone-locale-fix branch from 464c392 to 2c9620b Compare January 13, 2024 15:31
@kkhramova
Copy link
Contributor Author

stdout is now redirected to devnull.
@dimbleby thank you for your patient guidance.

@radoering radoering force-pushed the git-clone-locale-fix branch from 2c9620b to 424195d Compare January 20, 2024 10:26
@radoering radoering merged commit 9756b57 into python-poetry:master Jan 20, 2024
19 checks passed
@kkhramova kkhramova deleted the git-clone-locale-fix branch January 21, 2024 19:07
Copy link

github-actions bot commented Mar 3, 2024

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants