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

gh-87868: Sort and remove duplicates in getenvironment() #102731

Merged
merged 63 commits into from Jan 9, 2024

Conversation

aisk
Copy link
Contributor

@aisk aisk commented Mar 15, 2023

AlexWaygood added a commit to AlexWaygood/cpython that referenced this pull request Mar 15, 2023
The "check if generated files are up to date" CI check appears to be currently failing on all PRs (but not on pushes to main) 

See, for example:
- python#94468
- python#94468
- python#102731

This appears to be because the C-analyzer tool doesn't like the `#line` directives introduced in python@70185de. I'm advised by the message printed to the terminal in https://github.com/python/cpython/actions/runs/4428706945/jobs/7768216988#step:14:84 that this is the appropriate short-term fix!

Cc. @ericsnowcurrently
AlexWaygood added a commit that referenced this pull request Mar 15, 2023
The "check if generated files are up to date" CI check appears to be currently failing on all PRs (but not on pushes to main) 

See, for example:
- #94468
- #94468
- #102731

This appears to be because the C-analyzer tool doesn't like the `#line` directives introduced in 70185de. I'm advised by the message printed to the terminal in https://github.com/python/cpython/actions/runs/4428706945/jobs/7768216988#step:14:84 that this is the appropriate short-term fix!
Fidget-Spinner pushed a commit to Fidget-Spinner/cpython that referenced this pull request Mar 27, 2023
The "check if generated files are up to date" CI check appears to be currently failing on all PRs (but not on pushes to main) 

See, for example:
- python#94468
- python#94468
- python#102731

This appears to be because the C-analyzer tool doesn't like the `#line` directives introduced in python@70185de. I'm advised by the message printed to the terminal in https://github.com/python/cpython/actions/runs/4428706945/jobs/7768216988#step:14:84 that this is the appropriate short-term fix!
@aisk aisk requested a review from eendebakpt April 3, 2023 12:10
warsaw pushed a commit to warsaw/cpython that referenced this pull request Apr 11, 2023
The "check if generated files are up to date" CI check appears to be currently failing on all PRs (but not on pushes to main) 

See, for example:
- python#94468
- python#94468
- python#102731

This appears to be because the C-analyzer tool doesn't like the `#line` directives introduced in python@70185de. I'm advised by the message printed to the terminal in https://github.com/python/cpython/actions/runs/4428706945/jobs/7768216988#step:14:84 that this is the appropriate short-term fix!
Modules/_winapi.c Outdated Show resolved Hide resolved
Modules/_winapi.c Outdated Show resolved Hide resolved
Lib/test/test_subprocess.py Show resolved Hide resolved
aisk and others added 6 commits August 20, 2023 16:17
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
@aisk aisk requested a review from eendebakpt August 20, 2023 12:41
Modules/_winapi.c Outdated Show resolved Hide resolved
Modules/_winapi.c Outdated Show resolved Hide resolved
Modules/_winapi.c Outdated Show resolved Hide resolved
Lib/test/test_subprocess.py Show resolved Hide resolved
Modules/_winapi.c Outdated Show resolved Hide resolved
Modules/_winapi.c Outdated Show resolved Hide resolved
@aisk aisk requested a review from eendebakpt September 3, 2023 11:32
Modules/_winapi.c Outdated Show resolved Hide resolved
@zooba zooba merged commit c31be58 into python:main Jan 9, 2024
31 of 32 checks passed
@zooba
Copy link
Member

zooba commented Jan 9, 2024

CI looks good (and Azure Pipelines can be ignored here), so congrats! It's in!

@zooba zooba added OS-windows needs backport to 3.11 bug and security fixes needs backport to 3.12 bug and security fixes labels Jan 9, 2024
@miss-islington-app

This comment has been minimized.

@miss-islington-app

This comment has been minimized.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 9, 2024
…nGH-102731)

(cherry picked from commit c31be58)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Jan 9, 2024

GH-113865 is a backport of this pull request to the 3.12 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 9, 2024
…nGH-102731)

(cherry picked from commit c31be58)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Jan 9, 2024
@bedevere-app
Copy link

bedevere-app bot commented Jan 9, 2024

GH-113866 is a backport of this pull request to the 3.11 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.11 bug and security fixes label Jan 9, 2024
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 RHEL7 3.x has failed when building commit c31be58.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/15/builds/6594) and take a look at the build logs.
  4. Check if the failure is related to this commit (c31be58) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/15/builds/6594

Failed tests:

  • test_subprocess

Failed subtests:

  • test_one_environment_variable - test.test_subprocess.ProcessTestCase.test_one_environment_variable
  • test_one_environment_variable - test.test_subprocess.ProcessTestCaseNoPoll.test_one_environment_variable

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64/build/Lib/test/test_subprocess.py", line 847, in test_one_environment_variable
    self.assertTrue(stdout.startswith(b"fruit=orange"))
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: False is not true

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 RHEL8 3.x has failed when building commit c31be58.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/185/builds/5849) and take a look at the build logs.
  4. Check if the failure is related to this commit (c31be58) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/185/builds/5849

Failed tests:

  • test_subprocess

Failed subtests:

  • test_one_environment_variable - test.test_subprocess.ProcessTestCase.test_one_environment_variable
  • test_one_environment_variable - test.test_subprocess.ProcessTestCaseNoPoll.test_one_environment_variable

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-x86_64/build/Lib/test/test_subprocess.py", line 847, in test_one_environment_variable
    self.assertTrue(stdout.startswith(b"fruit=orange"))
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: False is not true

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot aarch64 RHEL8 3.x has failed when building commit c31be58.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/529/builds/5692) and take a look at the build logs.
  4. Check if the failure is related to this commit (c31be58) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/529/builds/5692

Failed tests:

  • test_subprocess

Failed subtests:

  • test_one_environment_variable - test.test_subprocess.ProcessTestCase.test_one_environment_variable
  • test_one_environment_variable - test.test_subprocess.ProcessTestCaseNoPoll.test_one_environment_variable

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-aarch64/build/Lib/test/test_subprocess.py", line 847, in test_one_environment_variable
    self.assertTrue(stdout.startswith(b"fruit=orange"))
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: False is not true

@zooba
Copy link
Member

zooba commented Jan 9, 2024

Okay, these buildbot failures look related to the new test. Will be a couple hours before I can dig into it myself, so if someone else gets started first, I'd add the actual stdout to the message parameter of the assertTrue call to see what's happening there.

It's possible that the process is failing to start with a mostly empty environment?

@aisk
Copy link
Contributor Author

aisk commented Jan 9, 2024

I'm attempting to address it, I think maybe it's caused by create a new process need some basic environment to start with.

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot aarch64 Fedora Stable 3.x has failed when building commit c31be58.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/125/builds/5079) and take a look at the build logs.
  4. Check if the failure is related to this commit (c31be58) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/125/builds/5079

Failed tests:

  • test_subprocess

Failed subtests:

  • test_one_environment_variable - test.test_subprocess.ProcessTestCase.test_one_environment_variable
  • test_one_environment_variable - test.test_subprocess.ProcessTestCaseNoPoll.test_one_environment_variable

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64/build/Lib/test/test_subprocess.py", line 847, in test_one_environment_variable
    self.assertTrue(stdout.startswith(b"fruit=orange"))
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: False is not true

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 RHEL8 FIPS Only Blake2 Builtin Hash 3.x has failed when building commit c31be58.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/469/builds/6966) and take a look at the build logs.
  4. Check if the failure is related to this commit (c31be58) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/469/builds/6966

Failed tests:

  • test_subprocess

Failed subtests:

  • test_one_environment_variable - test.test_subprocess.ProcessTestCase.test_one_environment_variable
  • test_one_environment_variable - test.test_subprocess.ProcessTestCaseNoPoll.test_one_environment_variable

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-fips-x86_64.no-builtin-hashes-except-blake2/build/Lib/test/test_subprocess.py", line 847, in test_one_environment_variable
    self.assertTrue(stdout.startswith(b"fruit=orange"))
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: False is not true

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Ubuntu Shared 3.x has failed when building commit c31be58.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/506/builds/6791) and take a look at the build logs.
  4. Check if the failure is related to this commit (c31be58) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/506/builds/6791

Failed tests:

  • test_subprocess

Failed subtests:

  • test_one_environment_variable - test.test_subprocess.ProcessTestCase.test_one_environment_variable
  • test_one_environment_variable - test.test_subprocess.ProcessTestCaseNoPoll.test_one_environment_variable

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_subprocess.py", line 847, in test_one_environment_variable
    self.assertTrue(stdout.startswith(b"fruit=orange"))
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: False is not true

@aisk aisk deleted the getenvironment branch January 9, 2024 16:35
@aisk
Copy link
Contributor Author

aisk commented Jan 9, 2024

Change the assertTrue to assertEqual will help to address it. Should I open a new PR to do this, or is there some other way to do it?

@aisk
Copy link
Contributor Author

aisk commented Jan 9, 2024

The change will be like #113867

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Fedora Stable 3.x has failed when building commit c31be58.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/543/builds/5159) and take a look at the build logs.
  4. Check if the failure is related to this commit (c31be58) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/543/builds/5159

Failed tests:

  • test_subprocess

Failed subtests:

  • test_one_environment_variable - test.test_subprocess.ProcessTestCase.test_one_environment_variable
  • test_one_environment_variable - test.test_subprocess.ProcessTestCaseNoPoll.test_one_environment_variable

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64/build/Lib/test/test_subprocess.py", line 847, in test_one_environment_variable
    self.assertTrue(stdout.startswith(b"fruit=orange"))
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: False is not true

zooba pushed a commit that referenced this pull request Jan 10, 2024
(cherry picked from commit c31be58)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
zooba pushed a commit that referenced this pull request Jan 11, 2024
(cherry picked from commit c31be58)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[_winapi] correctly sort and remove duplicates in getenvironment()
6 participants