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 incorrect string operations on bytes output of 'ps' subprocess #1765

Conversation

parikshittiwari740
Copy link
Contributor

@parikshittiwari740 parikshittiwari740 commented Jun 2, 2024

The subprocess to get the current shell name would always return a bytes output. The subsequent string operations on
that output would always fail with a TypeError.

Using subprocess.run() along with its text flag will fix the issue at hand as well as bring the code in-line with python's
recommendation of using run for all use cases it can handle. The current use case does not warrant a use for subprocess.communicate()
.

Closes #1754

Signed-off-by: Parikshit Tiwari <parikshitatiwari@gmail.com>
@parikshittiwari740 parikshittiwari740 requested a review from a team as a code owner June 2, 2024 10:39
Copy link

linux-foundation-easycla bot commented Jun 2, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: parikshittiwari740 / name: Parikshit Tiwari (7103dcb)
  • ✅ login: JeanChristopheMorinPerso / name: Jean-Christophe Morin (8699a35, 839d5aa)

src/rez/utils/_version.py Outdated Show resolved Hide resolved
src/rez/system.py Show resolved Hide resolved
@JeanChristopheMorinPerso JeanChristopheMorinPerso added this to the Next milestone Jun 22, 2024
Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
Copy link

codecov bot commented Jun 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 58.39%. Comparing base (a13f7bb) to head (839d5aa).
Report is 27 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1765      +/-   ##
==========================================
- Coverage   58.41%   58.39%   -0.02%     
==========================================
  Files         126      126              
  Lines       17163    17205      +42     
  Branches     3506     3519      +13     
==========================================
+ Hits        10025    10047      +22     
- Misses       6473     6491      +18     
- Partials      665      667       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JeanChristopheMorinPerso JeanChristopheMorinPerso merged commit 57136a3 into AcademySoftwareFoundation:main Jun 29, 2024
47 checks passed
Pixel-Minions added a commit to Pixel-Minions/rez that referenced this pull request Sep 26, 2024
… wrong shell type to be selected (AcademySoftwareFoundation#1765)

Signed-off-by: Parikshit Tiwari <parikshitatiwari@gmail.com>
Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
Co-authored-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shell type plugin can resolve incorrectly in rez.system on Linux.
2 participants