diff -pruN 0.26.0-1/.cargo_vcs_info.json 0.27.0-2/.cargo_vcs_info.json
--- 0.26.0-1/.cargo_vcs_info.json	1970-01-01 00:00:01.000000000 +0000
+++ 0.27.0-2/.cargo_vcs_info.json	1970-01-01 00:00:01.000000000 +0000
@@ -1,6 +1,6 @@
 {
   "git": {
-    "sha1": "bc3caf522f8d4ddfceda8c6ca438b5e6ff16972d"
+    "sha1": "43c714f13d40db35b080659c67b818758cc8c202"
   },
   "path_in_vcs": ""
 }
\ No newline at end of file
diff -pruN 0.26.0-1/.github/workflows/ci.yml 0.27.0-2/.github/workflows/ci.yml
--- 0.26.0-1/.github/workflows/ci.yml	2006-07-24 01:21:28.000000000 +0000
+++ 0.27.0-2/.github/workflows/ci.yml	2006-07-24 01:21:28.000000000 +0000
@@ -49,17 +49,21 @@ jobs:
     strategy:
       fail-fast: false # If one platform fails, allow the rest to keep testing.
       matrix:
-        python-architecture: ["x64"]
-        python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.13t"]
-        os: ["macos-13", "ubuntu-latest", "windows-latest"]
+        python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.14t"]
+        os: ["macos-latest", "ubuntu-latest", "windows-latest"]
         rust: [stable]
         include:
-          - python-version: "3.13"
+          - python-version: "3.14"
             os: "ubuntu-latest"
             rust: ${{ needs.resolve.outputs.MSRV }}
-          - python-version: "3.13"
-            python-architecture: "arm64"
-            os: "macos-latest"
+          - python-version: "3.14"
+            os: "macos-15-intel"
+            rust: "stable"
+          - python-version: "3.14"
+            os: "ubuntu-24.04-arm"
+            rust: "stable"
+          - python-version: "3.14"
+            os: "windows-11-arm"
             rust: "stable"
 
     steps:
@@ -69,7 +73,6 @@ jobs:
         uses: actions/setup-python@v5
         with:
           python-version: ${{ matrix.python-version }}
-          architecture: ${{ matrix.python-python-architecture }}
 
       - name: Install Rust toolchain
         uses: dtolnay/rust-toolchain@master
@@ -88,9 +91,7 @@ jobs:
       - name: Test
         run: cargo test --verbose
 
-      # https://github.com/PyO3/pyo3/issues/4709 - can't use abi3 w. freethreaded build
-      - if: ${{ !endsWith(matrix.python-version, 't') }}
-        name: Test (abi3)
+      - name: Test (abi3)
         run: cargo test --verbose --features pyo3/abi3-py37
 
     env:
diff -pruN 0.26.0-1/CHANGELOG.md 0.27.0-2/CHANGELOG.md
--- 0.26.0-1/CHANGELOG.md	2006-07-24 01:21:28.000000000 +0000
+++ 0.27.0-2/CHANGELOG.md	2006-07-24 01:21:28.000000000 +0000
@@ -1,3 +1,6 @@
+## 0.27.0 - 2025-11-07
+- Update to PyO3 0.27
+
 ## 0.26.0 - 2025-08-30
 
 ### Packaging
diff -pruN 0.26.0-1/Cargo.lock 0.27.0-2/Cargo.lock
--- 0.26.0-1/Cargo.lock	1970-01-01 00:00:01.000000000 +0000
+++ 0.27.0-2/Cargo.lock	1970-01-01 00:00:01.000000000 +0000
@@ -16,9 +16,12 @@ checksum = "2304e00983f87ffb38b55b444b5e
 
 [[package]]
 name = "indoc"
-version = "2.0.6"
+version = "2.0.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f4c7245a08504955605670dbf141fceab975f15ca21570696aebe9d2e71576bd"
+checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706"
+dependencies = [
+ "rustversion",
+]
 
 [[package]]
 name = "itoa"
@@ -28,9 +31,9 @@ checksum = "4a5f13b858c8d314ee3e8f639011
 
 [[package]]
 name = "libc"
-version = "0.2.175"
+version = "0.2.177"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543"
+checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976"
 
 [[package]]
 name = "maplit"
@@ -40,9 +43,9 @@ checksum = "3e2e65a1a2e43cfcb47a895c4c8b
 
 [[package]]
 name = "memchr"
-version = "2.7.5"
+version = "2.7.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0"
+checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273"
 
 [[package]]
 name = "memoffset"
@@ -67,18 +70,18 @@ checksum = "f84267b20a16ea918e43c6a88433
 
 [[package]]
 name = "proc-macro2"
-version = "1.0.101"
+version = "1.0.103"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de"
+checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8"
 dependencies = [
  "unicode-ident",
 ]
 
 [[package]]
 name = "pyo3"
-version = "0.26.0"
+version = "0.27.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ba0117f4212101ee6544044dae45abe1083d30ce7b29c4b5cbdfa2354e07383"
+checksum = "37a6df7eab65fc7bee654a421404947e10a0f7085b6951bf2ea395f4659fb0cf"
 dependencies = [
  "indoc",
  "libc",
@@ -93,18 +96,18 @@ dependencies = [
 
 [[package]]
 name = "pyo3-build-config"
-version = "0.26.0"
+version = "0.27.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4fc6ddaf24947d12a9aa31ac65431fb1b851b8f4365426e182901eabfb87df5f"
+checksum = "f77d387774f6f6eec64a004eac0ed525aab7fa1966d94b42f743797b3e395afb"
 dependencies = [
  "target-lexicon",
 ]
 
 [[package]]
 name = "pyo3-ffi"
-version = "0.26.0"
+version = "0.27.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "025474d3928738efb38ac36d4744a74a400c901c7596199e20e45d98eb194105"
+checksum = "2dd13844a4242793e02df3e2ec093f540d948299a6a77ea9ce7afd8623f542be"
 dependencies = [
  "libc",
  "pyo3-build-config",
@@ -112,9 +115,9 @@ dependencies = [
 
 [[package]]
 name = "pyo3-macros"
-version = "0.26.0"
+version = "0.27.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2e64eb489f22fe1c95911b77c44cc41e7c19f3082fc81cce90f657cdc42ffded"
+checksum = "eaf8f9f1108270b90d3676b8679586385430e5c0bb78bb5f043f95499c821a71"
 dependencies = [
  "proc-macro2",
  "pyo3-macros-backend",
@@ -124,9 +127,9 @@ dependencies = [
 
 [[package]]
 name = "pyo3-macros-backend"
-version = "0.26.0"
+version = "0.27.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "100246c0ecf400b475341b8455a9213344569af29a3c841d29270e53102e0fcf"
+checksum = "70a3b2274450ba5288bc9b8c1b69ff569d1d61189d4bff38f8d22e03d17f932b"
 dependencies = [
  "heck",
  "proc-macro2",
@@ -137,7 +140,7 @@ dependencies = [
 
 [[package]]
 name = "pythonize"
-version = "0.26.0"
+version = "0.27.0"
 dependencies = [
  "maplit",
  "pyo3",
@@ -149,14 +152,20 @@ dependencies = [
 
 [[package]]
 name = "quote"
-version = "1.0.40"
+version = "1.0.42"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d"
+checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f"
 dependencies = [
  "proc-macro2",
 ]
 
 [[package]]
+name = "rustversion"
+version = "1.0.22"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
+
+[[package]]
 name = "ryu"
 version = "1.0.20"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -164,27 +173,38 @@ checksum = "28d3b2b1366ec20994f1fd18c3c5
 
 [[package]]
 name = "serde"
-version = "1.0.219"
+version = "1.0.228"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6"
+checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
 dependencies = [
+ "serde_core",
  "serde_derive",
 ]
 
 [[package]]
 name = "serde_bytes"
-version = "0.11.17"
+version = "0.11.19"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8437fd221bde2d4ca316d61b90e337e9e702b3820b87d63caa9ba6c02bd06d96"
+checksum = "a5d440709e79d88e51ac01c4b72fc6cb7314017bb7da9eeff678aa94c10e3ea8"
 dependencies = [
  "serde",
+ "serde_core",
+]
+
+[[package]]
+name = "serde_core"
+version = "1.0.228"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
+dependencies = [
+ "serde_derive",
 ]
 
 [[package]]
 name = "serde_derive"
-version = "1.0.219"
+version = "1.0.228"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
+checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -193,31 +213,33 @@ dependencies = [
 
 [[package]]
 name = "serde_json"
-version = "1.0.143"
+version = "1.0.145"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a"
+checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c"
 dependencies = [
  "itoa",
  "memchr",
  "ryu",
  "serde",
+ "serde_core",
 ]
 
 [[package]]
 name = "serde_path_to_error"
-version = "0.1.17"
+version = "0.1.20"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "59fab13f937fa393d08645bf3a84bdfe86e296747b506ada67bb15f10f218b2a"
+checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457"
 dependencies = [
  "itoa",
  "serde",
+ "serde_core",
 ]
 
 [[package]]
 name = "syn"
-version = "2.0.106"
+version = "2.0.109"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6"
+checksum = "2f17c7e013e88258aa9543dcbe81aca68a667a9ac37cd69c9fbc07858bfe0e2f"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -226,15 +248,15 @@ dependencies = [
 
 [[package]]
 name = "target-lexicon"
-version = "0.13.2"
+version = "0.13.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e502f78cdbb8ba4718f566c418c52bc729126ffd16baee5baa718cf25dd5a69a"
+checksum = "df7f62577c25e07834649fc3b39fafdc597c0a3527dc1c60129201ccfcbaa50c"
 
 [[package]]
 name = "unicode-ident"
-version = "1.0.18"
+version = "1.0.22"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512"
+checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5"
 
 [[package]]
 name = "unindent"
diff -pruN 0.26.0-1/Cargo.toml 0.27.0-2/Cargo.toml
--- 0.26.0-1/Cargo.toml	1970-01-01 00:00:01.000000000 +0000
+++ 0.27.0-2/Cargo.toml	1970-01-01 00:00:01.000000000 +0000
@@ -13,7 +13,7 @@
 edition = "2021"
 rust-version = "1.74"
 name = "pythonize"
-version = "0.26.0"
+version = "0.27.0"
 authors = ["David Hewitt <1939362+davidhewitt@users.noreply.github.com>"]
 build = false
 autolib = false
@@ -41,7 +41,7 @@ name = "test_with_serde_path_to_err"
 path = "tests/test_with_serde_path_to_err.rs"
 
 [dependencies.pyo3]
-version = "0.26"
+version = "0.27"
 default-features = false
 
 [dependencies.serde]
@@ -53,7 +53,7 @@ default-features = false
 version = "1.0.2"
 
 [dev-dependencies.pyo3]
-version = "0.26"
+version = "0.27"
 features = [
     "auto-initialize",
     "macros",
diff -pruN 0.26.0-1/Cargo.toml.orig 0.27.0-2/Cargo.toml.orig
--- 0.26.0-1/Cargo.toml.orig	2006-07-24 01:21:28.000000000 +0000
+++ 0.27.0-2/Cargo.toml.orig	2006-07-24 01:21:28.000000000 +0000
@@ -1,6 +1,6 @@
 [package]
 name = "pythonize"
-version = "0.26.0"
+version = "0.27.0"
 authors = ["David Hewitt <1939362+davidhewitt@users.noreply.github.com>"]
 edition = "2021"
 rust-version = "1.74"
@@ -13,11 +13,11 @@ documentation = "https://docs.rs/crate/p
 
 [dependencies]
 serde = { version = "1.0", default-features = false, features = ["std"] }
-pyo3 = { version = "0.26", default-features = false }
+pyo3 = { version = "0.27", default-features = false }
 
 [dev-dependencies]
 serde = { version = "1.0", default-features = false, features = ["derive"] }
-pyo3 = { version = "0.26", default-features = false, features = ["auto-initialize", "macros", "py-clone"] }
+pyo3 = { version = "0.27", default-features = false, features = ["auto-initialize", "macros", "py-clone"] }
 serde_json = "1.0"
 serde_bytes = "0.11"
 maplit = "1.0.2"
diff -pruN 0.26.0-1/debian/cargo-checksum.json 0.27.0-2/debian/cargo-checksum.json
--- 0.26.0-1/debian/cargo-checksum.json	2025-10-12 20:06:06.000000000 +0000
+++ 0.27.0-2/debian/cargo-checksum.json	2025-11-18 10:37:13.000000000 +0000
@@ -1 +1 @@
-{"package":"11e06e4cff9be2bbf2bddf28a486ae619172ea57e79787f856572878c62dcfe2","files":{}}
+{"package":"a3a8f29db331e28c332c63496cfcbb822aca3d7320bc08b655d7fd0c29c50ede","files":{}}
diff -pruN 0.26.0-1/debian/changelog 0.27.0-2/debian/changelog
--- 0.26.0-1/debian/changelog	2025-10-12 20:06:06.000000000 +0000
+++ 0.27.0-2/debian/changelog	2025-11-18 10:37:13.000000000 +0000
@@ -1,3 +1,23 @@
+rust-pythonize (0.27.0-2) unstable; urgency=medium
+
+  * Target unstable distribution.
+
+ -- Jelmer Vernooĳ <jelmer@debian.org>  Tue, 18 Nov 2025 10:37:13 +0000
+
+rust-pythonize (0.27.0-1) experimental; urgency=medium
+
+  * Team upload.
+  * Package pythonize 0.27.0 from crates.io using debcargo 2.7.11
+
+ -- Jelmer Vernooĳ <jelmer@debian.org>  Tue, 11 Nov 2025 17:44:12 +0000
+
+rust-pythonize (0.26.0-2) experimental; urgency=medium
+
+  * Team upload.
+  * Package pythonize 0.26.0 from crates.io using debcargo 2.7.11
+
+ -- Jelmer Vernooĳ <jelmer@debian.org>  Thu, 30 Oct 2025 19:35:00 +0000
+
 rust-pythonize (0.26.0-1) unstable; urgency=medium
 
   * Team upload.
diff -pruN 0.26.0-1/debian/control 0.27.0-2/debian/control
--- 0.26.0-1/debian/control	2025-10-12 20:06:06.000000000 +0000
+++ 0.27.0-2/debian/control	2025-11-18 10:37:13.000000000 +0000
@@ -6,7 +6,7 @@ Build-Depends: debhelper-compat (= 13),
 Build-Depends-Arch: cargo:native <!nocheck>,
  rustc:native (>= 1.74) <!nocheck>,
  libstd-rust-dev <!nocheck>,
- librust-pyo3-0.26-dev <!nocheck>,
+ librust-pyo3-0.27-dev <!nocheck>,
  librust-serde-1+std-dev <!nocheck>
 Maintainer: Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
 Uploaders:
@@ -22,15 +22,15 @@ Architecture: any
 Multi-Arch: same
 Depends:
  ${misc:Depends},
- librust-pyo3-0.26-dev,
+ librust-pyo3-0.27-dev,
  librust-serde-1+std-dev
 Provides:
  librust-pythonize+default-dev (= ${binary:Version}),
  librust-pythonize-0-dev (= ${binary:Version}),
  librust-pythonize-0+default-dev (= ${binary:Version}),
- librust-pythonize-0.26-dev (= ${binary:Version}),
- librust-pythonize-0.26+default-dev (= ${binary:Version}),
- librust-pythonize-0.26.0-dev (= ${binary:Version}),
- librust-pythonize-0.26.0+default-dev (= ${binary:Version})
+ librust-pythonize-0.27-dev (= ${binary:Version}),
+ librust-pythonize-0.27+default-dev (= ${binary:Version}),
+ librust-pythonize-0.27.0-dev (= ${binary:Version}),
+ librust-pythonize-0.27.0+default-dev (= ${binary:Version})
 Description: Rust <-> Python interconnect using Serde and PyO3 - Rust source code
  Source code for Debianized Rust crate "pythonize"
diff -pruN 0.26.0-1/debian/tests/control 0.27.0-2/debian/tests/control
--- 0.26.0-1/debian/tests/control	2025-10-12 20:06:06.000000000 +0000
+++ 0.27.0-2/debian/tests/control	2025-11-18 10:37:13.000000000 +0000
@@ -1,14 +1,14 @@
-Test-Command: /usr/share/cargo/bin/cargo-auto-test pythonize 0.26.0 --all-targets --all-features
+Test-Command: /usr/share/cargo/bin/cargo-auto-test pythonize 0.27.0 --all-targets --all-features
 Features: test-name=rust-pythonize:@
-Depends: dh-cargo (>= 31), rustc (>= 1.74), librust-maplit-1+default-dev (>= 1.0.2-~~), librust-pyo3-0.26+auto-initialize-dev, librust-pyo3-0.26+macros-dev, librust-pyo3-0.26+py-clone-dev, librust-serde-1+derive-dev, librust-serde-bytes-0.11+default-dev, librust-serde-json-1+default-dev, librust-serde-path-to-error-0.1+default-dev (>= 0.1.15-~~), @
+Depends: dh-cargo (>= 31), rustc (>= 1.74), librust-maplit-1+default-dev (>= 1.0.2-~~), librust-pyo3-0.27+auto-initialize-dev, librust-pyo3-0.27+macros-dev, librust-pyo3-0.27+py-clone-dev, librust-serde-1+derive-dev, librust-serde-bytes-0.11+default-dev, librust-serde-json-1+default-dev, librust-serde-path-to-error-0.1+default-dev (>= 0.1.15-~~), @
 Restrictions: allow-stderr, skip-not-installable
 
-Test-Command: /usr/share/cargo/bin/cargo-auto-test pythonize 0.26.0 --all-targets
+Test-Command: /usr/share/cargo/bin/cargo-auto-test pythonize 0.27.0 --all-targets
 Features: test-name=librust-pythonize-dev:default
-Depends: dh-cargo (>= 31), rustc (>= 1.74), librust-maplit-1+default-dev (>= 1.0.2-~~), librust-pyo3-0.26+auto-initialize-dev, librust-pyo3-0.26+macros-dev, librust-pyo3-0.26+py-clone-dev, librust-serde-1+derive-dev, librust-serde-bytes-0.11+default-dev, librust-serde-json-1+default-dev, librust-serde-path-to-error-0.1+default-dev (>= 0.1.15-~~), @
+Depends: dh-cargo (>= 31), rustc (>= 1.74), librust-maplit-1+default-dev (>= 1.0.2-~~), librust-pyo3-0.27+auto-initialize-dev, librust-pyo3-0.27+macros-dev, librust-pyo3-0.27+py-clone-dev, librust-serde-1+derive-dev, librust-serde-bytes-0.11+default-dev, librust-serde-json-1+default-dev, librust-serde-path-to-error-0.1+default-dev (>= 0.1.15-~~), @
 Restrictions: allow-stderr, skip-not-installable
 
-Test-Command: /usr/share/cargo/bin/cargo-auto-test pythonize 0.26.0 --all-targets --no-default-features
+Test-Command: /usr/share/cargo/bin/cargo-auto-test pythonize 0.27.0 --all-targets --no-default-features
 Features: test-name=librust-pythonize-dev:
-Depends: dh-cargo (>= 31), rustc (>= 1.74), librust-maplit-1+default-dev (>= 1.0.2-~~), librust-pyo3-0.26+auto-initialize-dev, librust-pyo3-0.26+macros-dev, librust-pyo3-0.26+py-clone-dev, librust-serde-1+derive-dev, librust-serde-bytes-0.11+default-dev, librust-serde-json-1+default-dev, librust-serde-path-to-error-0.1+default-dev (>= 0.1.15-~~), @
+Depends: dh-cargo (>= 31), rustc (>= 1.74), librust-maplit-1+default-dev (>= 1.0.2-~~), librust-pyo3-0.27+auto-initialize-dev, librust-pyo3-0.27+macros-dev, librust-pyo3-0.27+py-clone-dev, librust-serde-1+derive-dev, librust-serde-bytes-0.11+default-dev, librust-serde-json-1+default-dev, librust-serde-path-to-error-0.1+default-dev (>= 0.1.15-~~), @
 Restrictions: allow-stderr, skip-not-installable
diff -pruN 0.26.0-1/src/error.rs 0.27.0-2/src/error.rs
--- 0.26.0-1/src/error.rs	2006-07-24 01:21:28.000000000 +0000
+++ 0.27.0-2/src/error.rs	2006-07-24 01:21:28.000000000 +0000
@@ -1,5 +1,5 @@
 use pyo3::PyErr;
-use pyo3::{exceptions::*, DowncastError, DowncastIntoError};
+use pyo3::{exceptions::*, CastError, CastIntoError};
 use serde::{de, ser};
 use std::convert::Infallible;
 use std::error;
@@ -153,18 +153,18 @@ impl From<PyErr> for PythonizeError {
     }
 }
 
-/// Handle errors that occur when attempting to use `PyAny::cast_as`
-impl<'a, 'py> From<DowncastError<'a, 'py>> for PythonizeError {
-    fn from(other: DowncastError<'a, 'py>) -> Self {
+/// Handle errors that occur when attempting to use `PyAny::cast`
+impl<'a, 'py> From<CastError<'a, 'py>> for PythonizeError {
+    fn from(other: CastError<'a, 'py>) -> Self {
         Self {
             inner: Box::new(ErrorImpl::UnexpectedType(other.to_string())),
         }
     }
 }
 
-/// Handle errors that occur when attempting to use `PyAny::cast_as`
-impl<'py> From<DowncastIntoError<'py>> for PythonizeError {
-    fn from(other: DowncastIntoError<'py>) -> Self {
+/// Handle errors that occur when attempting to use `PyAny::cast`
+impl<'py> From<CastIntoError<'py>> for PythonizeError {
+    fn from(other: CastIntoError<'py>) -> Self {
         Self {
             inner: Box::new(ErrorImpl::UnexpectedType(other.to_string())),
         }
diff -pruN 0.26.0-1/tests/test_with_serde_path_to_err.rs 0.27.0-2/tests/test_with_serde_path_to_err.rs
--- 0.26.0-1/tests/test_with_serde_path_to_err.rs	2006-07-24 01:21:28.000000000 +0000
+++ 0.27.0-2/tests/test_with_serde_path_to_err.rs	2006-07-24 01:21:28.000000000 +0000
@@ -100,7 +100,10 @@ fn test_de_invalid() {
         let err = serde_path_to_error::deserialize::<_, Root<String>>(de).unwrap_err();
 
         assert_eq!(err.path().to_string(), "root_map.nested_1.nested_key");
-        assert_eq!(err.to_string(), "root_map.nested_1.nested_key: unexpected type: 'int' object cannot be converted to 'PyString'");
+        assert_eq!(
+            err.to_string(),
+            "root_map.nested_1.nested_key: unexpected type: 'int' object cannot be cast as 'str'"
+        );
     })
 }
 
@@ -143,7 +146,7 @@ fn test_ser_valid() {
             .get_item("root_map")
             .unwrap()
             .unwrap()
-            .downcast_into::<PyDict>()
+            .cast_into::<PyDict>()
             .unwrap();
         assert_eq!(root_map.len(), 2);
 
@@ -151,7 +154,7 @@ fn test_ser_valid() {
             .get_item("nested_0")
             .unwrap()
             .unwrap()
-            .downcast_into::<PyDict>()
+            .cast_into::<PyDict>()
             .unwrap();
         assert_eq!(nested_0.len(), 1);
         let nested_key_0: String = nested_0
@@ -166,7 +169,7 @@ fn test_ser_valid() {
             .get_item("nested_1")
             .unwrap()
             .unwrap()
-            .downcast_into::<PyDict>()
+            .cast_into::<PyDict>()
             .unwrap();
         assert_eq!(nested_1.len(), 1);
         let nested_key_1: String = nested_1
