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

error[E0599]: no method named and_utc found for struct NaiveDateTime in the current scope #3511

Closed
brianmay opened this issue Oct 14, 2023 · 2 comments · Fixed by #3512
Closed
Labels

Comments

@brianmay
Copy link

brianmay commented Oct 14, 2023

Bug Description

Compiler error

Steps to Reproduce

  1. Upgrade pyo3 from 0.19.2 to 0.20.0
  2. Compile

Backtrace

error[E0599]: no method named `and_utc` found for struct `NaiveDateTime` in the current scope
   --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-0.20.0/src/conversions/chrono.rs:230:15
    |
230 |         Ok(dt.and_utc())
    |               ^^^^^^^ method not found in `NaiveDateTime`

For more information about this error, try `rustc --explain E0599`.
error: could not compile `pyo3` (lib) due to previous error


### Your operating system and version

Linux

### Your Python version (`python --version`)

N/A

### Your Rust version (`rustc --version`)

Rust 1.73

### Your PyO3 version

0.20.0

### How did you install python? Did you use a virtualenv?

N/A

### Additional Info

https://github.com/brianmay/robotica-rust/actions/runs/6506697314/job/17672737275?pr=277
@brianmay brianmay added the bug label Oct 14, 2023
@brianmay
Copy link
Author

I think my chrono was out of date. 0.4.24.

Wondering if it is possible to increase the minimum version this library. But I don't really understand dependency management that well.

Anyway, closing.

@adamreichold
Copy link
Member

I think there is a real bug here, because while we properly constrain our dev-dependency on chrono via

chrono = { version = "0.4.25" }

our optional runtime dependency is incorrect

chrono = { version = "0.4", default-features = false, optional = true }

should also use 0.4.25 as the version specifier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants