GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-28624: Add test for subprocess to check that cmd arg supports PathLike by sayanchowdhury · Pull Request #157 · python/cpython

Conversation

@sayanchowdhury

@sayanchowdhury sayanchowdhury commented Feb 18, 2017

Copy link
Copy Markdown
Contributor

No description provided.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@the-knights-who-say-ni

the-knights-who-say-ni commented Feb 18, 2017

Copy link
Copy Markdown

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA. This is necessary for legal reasons before we can look at your contribution. Please follow these steps to help rectify the issue:

  1. If you don't have an account on b.p.o, please create one
  2. Make sure your GitHub username is listed in "Your Details" at b.p.o
  3. If you have not already done so, please sign the PSF contributor agreement
  4. If you just signed the CLA, please wait at least one US business day and then check "Your Details" on bugs.python.org to see if your account has been marked as having signed the CLA (the delay is due to a person having to manually check your signed CLA)
  5. Reply here saying you have completed the above steps

Thanks again to your contribution and we look forward to looking at it!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@the-knights-who-say-ni the-knights-who-say-ni added the CLA not signed label Feb 18, 2017
@ncoghlan ncoghlan removed the CLA not signed label Feb 18, 2017
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Feb 18, 2017
@serhiy-storchaka serhiy-storchaka added type-feature A feature request or enhancement tests Tests in the Lib/test dir and removed type-feature A feature request or enhancement labels Feb 18, 2017
JelleZijlstra
JelleZijlstra reviewed Feb 18, 2017
View reviewed changes
Comment thread Doc/library/subprocess.rst Outdated

@JelleZijlstra JelleZijlstra Feb 18, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make suspicious fails here with "default role used". Not sure, but you may have to put double backticks around os.PathLike.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@ncoghlan ncoghlan Feb 19, 2017

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:ref:os.PathLike would be a preferable fix here (turning this into a cross reference to the ABC's docs)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@ncoghlan ncoghlan Feb 19, 2017

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, if you follow Berker's suggestion below (which seems like a good idea to me), that will also fix this.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
berkerpeksag
berkerpeksag requested changes Feb 18, 2017
View reviewed changes
Comment thread Doc/library/subprocess.rst Outdated

@berkerpeksag berkerpeksag Feb 18, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add two spaces before "*cwd* also accepts a os.PathLike object."

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@berkerpeksag berkerpeksag Feb 18, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to follow the style in the rest of stdlib:

[...] child.  *cmd* can be a :class:`str` and :term:`path-like <path-like object>` object.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ncoghlan and sayanchowdhury reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

@berkerpeksag berkerpeksag Feb 18, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And please add a versionchanged directive to properly document os.PathLike support:

.. versionchanged:: 3.6
   *cwd* parameter accepts a :term:`path-like object`.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ncoghlan and sayanchowdhury reacted with thumbs up emoji
All reactions
  • 👍 2 reactions
Comment thread Lib/test/test_subprocess.py Outdated

@berkerpeksag berkerpeksag Feb 18, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to add a comment here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Lib/test/test_subprocess.py Outdated

@berkerpeksag berkerpeksag Feb 18, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can create a pathlib.Path instance from temp_dir and pass it to cwd.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@ncoghlan ncoghlan Feb 19, 2017

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sayanchowdhury and I were discussing that at the PyCon Pune sprints and I suggested doing it this way to avoid adding a new dependency to the test cases.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@berkerpeksag berkerpeksag added the needs backport to 3.6 label Feb 18, 2017
@sayanchowdhury
sayanchowdhury force-pushed the bpo28624 branch 3 times, most recently from 271a1ad to 1cb8660 Compare February 19, 2017 05:53
@sayanchowdhury

sayanchowdhury commented Feb 19, 2017

Copy link
Copy Markdown
Contributor Author

Thanks for the review. I have updated the PR.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sayanchowdhury
sayanchowdhury force-pushed the bpo28624 branch from 1cb8660 to da4f28a Compare February 19, 2017 05:55
@ncoghlan

ncoghlan commented Feb 19, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

make patchcheck should clean up the trailing whitespace errors being picked up by Travis.

(Oops, after chatting to @sayanchowdhury, I realised this suggestion wasn't as useful as I thought - make patchcheck only checks uncommitted changes, so it will only help here if you first soft-reset the git state to an earlier commit)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sayanchowdhury
sayanchowdhury force-pushed the bpo28624 branch from da4f28a to e153659 Compare February 19, 2017 10:43
@sayanchowdhury

sayanchowdhury commented Feb 20, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

I ran make patchcheck which removed the trailing spaces. Travis also seems to be happy now.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

berkerpeksag
berkerpeksag approved these changes Feb 22, 2017
View reviewed changes
berkerpeksag
berkerpeksag requested changes Feb 22, 2017
View reviewed changes

@berkerpeksag berkerpeksag left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to merge this, but just noticed a small typo. I think this also deserves a Misc/NEWS entry since we are aim to support path-like objects in the stdlib in Python 3.6.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/library/subprocess.rst Outdated

@berkerpeksag berkerpeksag Feb 22, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmd -> cwd

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@sayanchowdhury sayanchowdhury Feb 22, 2017

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the typo. Fixed it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sayanchowdhury
sayanchowdhury force-pushed the bpo28624 branch from e153659 to 6c208d2 Compare February 22, 2017 07:15
@sayanchowdhury

sayanchowdhury commented Feb 22, 2017

Copy link
Copy Markdown
Contributor Author

Should add to section What's New in Python 3.6.1 release candidate 1 under Library in Misc/NEWS?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

zhangyangyu
zhangyangyu reviewed Feb 22, 2017
View reviewed changes
Comment thread Doc/library/subprocess.rst Outdated

@zhangyangyu zhangyangyu Feb 22, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, you only mention string and PathLike, how about bytes? Is it acceptable?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@sayanchowdhury sayanchowdhury Feb 26, 2017

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a test for bytes too and it's seems to be passing too. Also updated the docs.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sayanchowdhury
sayanchowdhury force-pushed the bpo28624 branch from 6c208d2 to c096044 Compare February 26, 2017 11:23
@berkerpeksag

berkerpeksag commented Feb 26, 2017

Copy link
Copy Markdown
Member

Can we please keep this PR specific to os.PathLike support? Passing cwd=b"something" is out of scope for this issue and it should be discussed on bugs.python.org.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sayanchowdhury
bpo-28624: Add test for Popen to check that cmd arg supports PathLike
3370e0b
Signed-off-by: Sayan Chowdhury <[email protected]>
@sayanchowdhury

sayanchowdhury commented Feb 26, 2017

Copy link
Copy Markdown
Contributor Author

Okay, I'll then go ahead and keep the changes os.PathLike specific.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sayanchowdhury
sayanchowdhury force-pushed the bpo28624 branch from c096044 to 3370e0b Compare February 26, 2017 11:41
@sayanchowdhury

sayanchowdhury commented Feb 26, 2017

Copy link
Copy Markdown
Contributor Author

I have updated the code.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@berkerpeksag
Move NEWS entry
0b2c42b
@berkerpeksag
Merge branch 'master' into bpo28624
bfd7de3
berkerpeksag
berkerpeksag approved these changes Feb 26, 2017
View reviewed changes
@berkerpeksag
berkerpeksag merged commit d5c11f7 into python:master Feb 26, 2017
berkerpeksag pushed a commit to berkerpeksag/cpython that referenced this pull request Feb 26, 2017
@sayanchowdhury @berkerpeksag
bpo-28624: Add a test that checks that cwd parameter of Popen() accep…
a3e870d
…ts PathLike objects (python#157)

(cherry picked from commit d5c11f7)
@berkerpeksag berkerpeksag removed the needs backport to 3.6 label Feb 26, 2017
@berkerpeksag

berkerpeksag commented Feb 26, 2017

Copy link
Copy Markdown
Member

Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

berkerpeksag added a commit that referenced this pull request Feb 26, 2017
@berkerpeksag
bpo-28624: Add a test that checks that cwd parameter of Popen() accep…
6b81003
…ts PathLike objects (#157) (#323)

(cherry picked from commit d5c11f7)
benjaminp added a commit that referenced this pull request Mar 2, 2017
@benjaminp
allow path-like objects to be cwd on windows
e431c29
#157 added the test, but it's currently (correctly) broken on windows.
@benjaminp benjaminp mentioned this pull request Mar 2, 2017
allow path-like objects to be cwd on windows #389
Merged
benjaminp added a commit that referenced this pull request Mar 2, 2017
@benjaminp
allow path-like objects to be cwd on windows (#389)
f522792
#157 added the test, but it's currently (correctly) broken on windows.
@ncoghlan ncoghlan added the sprint label May 28, 2017
@ncoghlan

ncoghlan commented May 28, 2017

Copy link
Copy Markdown
Contributor

Added the sprint label, as this PR was submitted at the PyCon Pune 2017 core development sprint.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

akruis added a commit to akruis/cpython that referenced this pull request Jun 20, 2018
@akruis
Stackless issue python#157: a trivial indentation fix
d119676
Detected by gcc -Wmisleading-indentation.
jaraco pushed a commit that referenced this pull request Dec 2, 2022
@Mariatta
Print rate limit remaining (#157)
1138fd5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@JelleZijlstra JelleZijlstra JelleZijlstra left review comments
@ncoghlan ncoghlan ncoghlan left review comments
@zhangyangyu zhangyangyu zhangyangyu left review comments
@berkerpeksag berkerpeksag berkerpeksag approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

sprint tests Tests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

7 participants

@sayanchowdhury @the-knights-who-say-ni @ncoghlan @berkerpeksag @JelleZijlstra @zhangyangyu @serhiy-storchaka
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.