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

pip uses deprecated utcnow method #12005

Closed
pganssle opened this issue Apr 30, 2023 · 3 comments
Closed

pip uses deprecated utcnow method #12005

pganssle opened this issue Apr 30, 2023 · 3 comments
Labels
type: bug A confirmed bug or unintended behavior

Comments

@pganssle
Copy link
Member

pganssle commented Apr 30, 2023

Description

There are two places in pip's codebase that use datetime.utcnow, plus one additional place in cachecontrol.

This will start raising deprecation warnings in 3.12.

@pganssle pganssle added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Apr 30, 2023
@pfmoore
Copy link
Member

pfmoore commented Apr 30, 2023

Thanks for the heads up. What's the recommended replacement that works in Python 3.7 - 3.12? I know from the Discourse thread that .now(datetime.UTC) is the recommended replacement, but that's only valid in 3.11+. As far as I can see, the backward compatible approach would be .now(timezone(timedelta(0))). Is that correct? It feels a bit verbose and non-obvious (nothing that a well-placed comment can't fix, of course!)

I've created #12007 to see if the fix here is as simple as I hope it is :-)

The cachecontrol problem will need to be raised with them, and we'll pick up the fix when they release one. I raised psf/cachecontrol#291 to flag it with them.

@pfmoore
Copy link
Member

pfmoore commented Apr 30, 2023

lol, looks like you beat me to it with #12006. Ignore my PR in that case.

@pfmoore pfmoore removed the S: needs triage Issues/PRs that need to be triaged label Apr 30, 2023
@hugovk
Copy link
Contributor

hugovk commented Sep 11, 2023

I think this can be closed now PRs #12006 and psf/cachecontrol#290 have been merged.

Thank you!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

4 participants