pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/RustPython/RustPython/pull/8436

-requests-12898a7be3dbcd40.css" /> Replace deprecated `chrono` with `jiff` by joshuamegnauth54 · Pull Request #8436 · RustPython/RustPython · GitHub
Skip to content

Replace deprecated chrono with jiff - #8436

Merged
youknowone merged 1 commit into
RustPython:mainfrom
joshuamegnauth54:replace-deprecated-chrono
Aug 4, 2026
Merged

Replace deprecated chrono with jiff#8436
youknowone merged 1 commit into
RustPython:mainfrom
joshuamegnauth54:replace-deprecated-chrono

Conversation

@joshuamegnauth54

@joshuamegnauth54 joshuamegnauth54 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

See: chronotope/chrono#1768

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Improved date and time handling across supported platforms.
    • Added safer handling for invalid or unavailable build timestamps, with reliable fallback behavior.
    • Updated certificate validity dates and system time conversions for more consistent formatting.
  • Compatibility
    • Improved consistency of local-time, UTC, and calendar calculations across environments.
    • Enhanced timestamp validation to prevent invalid time values.
    • Improved timezone-aware formatting for build information and date-related operations.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: 0ce41754-01ea-4874-a5d5-47cfcff07aaf

📥 Commits

Reviewing files that changed from the base of the PR and between 92a0412 and 84687d0.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • Cargo.toml
  • crates/stdlib/Cargo.toml
  • crates/stdlib/src/ssl/cert.rs
  • crates/vm/Cargo.toml
  • crates/vm/build.rs
  • crates/vm/src/stdlib/time.rs
🚧 Files skipped from review as they are similar to previous changes (6)
  • crates/vm/Cargo.toml
  • crates/stdlib/Cargo.toml
  • crates/vm/build.rs
  • crates/stdlib/src/ssl/cert.rs
  • Cargo.toml
  • crates/vm/src/stdlib/time.rs

📝 Walkthrough

Walkthrough

The PR replaces chrono with jiff across workspace dependencies, certificate validity formatting, VM build timestamps, and non-Unix/Windows runtime time handling.

Changes

Jiff time migration

Layer / File(s) Summary
Dependency wiring and certificate timestamps
Cargo.toml, crates/stdlib/Cargo.toml, crates/stdlib/src/ssl/cert.rs
The workspace and standard library replace chrono with jiff. Certificate validity timestamps use UTC jiff formatting.
VM build timestamp handling
crates/vm/Cargo.toml, crates/vm/build.rs
VM features and dependencies use jiff. Git timestamps use fallible parsing, system-timezone conversion, and strftime; invalid values fall back to the current time.
Runtime time conversion
crates/vm/src/stdlib/time.rs
Non-platform time conversion uses jiff::Timestamp, Zoned, and civil datetimes for gmtime, localtime, mktime, and struct_time handling.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested labels: z-ca-2026

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: replacing the deprecated chrono dependency with jiff.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@joshuamegnauth54
joshuamegnauth54 marked this pull request as ready for review August 3, 2026 16:31
@joshuamegnauth54
joshuamegnauth54 force-pushed the replace-deprecated-chrono branch from 9e4ff33 to 55e14ab Compare August 3, 2026 16:31

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/vm/src/stdlib/time.rs`:
- Around line 429-432: Complete the Jiff migration in
OptionalArg::naive_or_local and the related non-Unix/non-Windows time
constructors: return Zoned instead of NaiveDateTime, pass tm.datetime() to
StructTimeData::new_inner, and update new_local to use the assigned tm value
rather than the undefined tz reference.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4709810b-04e7-4b17-a427-d7509f6b2732

📥 Commits

Reviewing files that changed from the base of the PR and between 51d7b50 and 55e14ab.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • Cargo.toml
  • crates/stdlib/Cargo.toml
  • crates/stdlib/src/ssl/cert.rs
  • crates/vm/Cargo.toml
  • crates/vm/build.rs
  • crates/vm/src/stdlib/time.rs

Comment thread crates/vm/src/stdlib/time.rs Outdated
@joshuamegnauth54
joshuamegnauth54 force-pushed the replace-deprecated-chrono branch from 55e14ab to 92a0412 Compare August 3, 2026 17:04
@joshuamegnauth54
joshuamegnauth54 force-pushed the replace-deprecated-chrono branch from 92a0412 to 84687d0 Compare August 4, 2026 00:14

@youknowone youknowone left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, didn't know chrono is going to be deprecated

@youknowone
youknowone merged commit 184db11 into RustPython:main Aug 4, 2026
27 checks passed
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.

2 participants

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy