Anki 25.06 Beta

I really liked the decision to migrate to Python 3.13! Was there any specific factor that weighed more in choosing this moment to make the migration?

By the way, could this change to Python 3.13 impact or delay the release of the stable Anki version, or are you confident about it? I’ll take the opportunity to revisit my addons.

1 Like

@Keks Is this the same issue?

I’m not sure if this is a problem with my computers drivers but now whenever I start Anki with Vulkan enabled it crashes without even the “Do you want to switch drivers” message. A git bisect found 04996c77 to be the bad commit, specifically d459af8b8 (It’s a big commit so not very helpful).

I would have updated to it much sooner, but had been waiting for PyOxdizer to gain support past 3.10.

The beta testing period should give us an approximate idea of the impact, and as we’re not depending on any post-3.9 functionality yet, it can be backed out if necessary. Aside from add-ons that vendor Python-version-specific extension modules, I suspect it won’t be that impactful. Anki itself required very few changes to support past 3.9. And users that depend on on a specific broken add-on could easily switch their install back to 3.9 by editing .python-version in AnkiProgramFiles.

1 Like

Run bash tools\run-qt6.6. It won’t work fully on Windows, but you should then be able to use out\pyenv66\scripts\python to run tools\run.py. If it works, it indicates the Qt version change is the issue.

1 Like

I’m using a card template called Cloze Interactive (which allows revealing clozes sequentially via shortcut keys) and modified the shortcut keys within it.
When the shortcut keys are ← and →, they don’t work, but when set to q and w, they function properly. Could it be that the new version of Anki has blocked the behavior of ← and → in templates?
Moreover, it seems that navigator.clipboard.writeText in another template is no longer functioning either.

Running with ./tools/run-qt6.6 fixes the issue. (I use Linux so I didn’t need to do the extra steps.)

How do 6.7 and 6.9 fare? You’ll need to pull down the latest git for them.

1 Like

6.7 doesn’t work but 6.9 does.

I produced a corrupt collection.anki2 database ~5 years ago which produced DiskFull

25.06b4 changes the error associated with loading this file. Could someone test in the Desktop UI to be sure the functionality is ‘expected’ (probably unchanging from 25.06b1)

Technical Details

The file produced the following when loaded in 25.06b1 and executing create table nums (id int)

error while compiling: "create table nums (id int)": DBError { info: "SqliteFailure(Error { code: DiskFull, extended_code: 13 }, Some(\"database or disk is full\"))", kind: Other }

In 25.06b4, this now outputs:

JsonError { info: "decoding deck config: expected value at line 1 column 1" }

The Android Framework still outputs a SQLiteFullException when accessing the file

In DataGrip (sqlite 3.45.1):

  • SQLITE_IOERR_SHORT_READ when accessing col
  • SQLITE_CORRUPT when accessing sqlite_stat1
  • other tables seem fine
1 Like

Not sure if it is specific to this beta but I am today, for the first time, seeing a weird error message when clicking “Add to Dictionary” in the editor with @Shigeyuki’s Spell Checker add-on.

Edit: I got this when running Anki from Terminal.

Traceback (most recent call last):
  File "C:\Users\User\AppData\Roaming\uv\python\cpython-3.13.5-windows-x86_64-none\Lib\concurrent\futures\thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)
  File "C:\Users\User\AppData\Local\AnkiProgramFiles\.venv\Lib\site-packages\aqt\operations\__init__.py", line 243, in wrapped_op
    return self._op(mw.col)
           ~~~~~~~~^^^^^^^^
  File "C:\Users\User\AppData\Roaming\Anki2\addons21\143753963\manage.py", line 86, in compilePersonal
    compileUserDictionary("personal")
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "C:\Users\User\AppData\Roaming\Anki2\addons21\143753963\manage.py", line 93, in compileUserDictionary
    with open(base + ".txt", "rbU") as f:
         ~~~~^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid mode: 'rbU'

Looks like an add-on bug but I never encountered it before.

Also, I think Anki should return an error window like other errors with an option to copy the debug info so that the user doesn’t need to launch Anki in a terminal to get this.

2 Likes

Thanks for the report, I’ll look into it. Maybe this update will break a lot of add-ons, if you find other add-ons of mine that are broken, or if you find broken add-ons that the author no longer active, feel free to request them to me through this thread. AnkiForums: Simple fix of broken add-ons for the latest Anki (by Shige)

3 Likes

Building the standalone sync-server using the instructions from Sync Server - Anki Manual in a fresh source checkout fails.

$ ./ninja extract:protoc
$ cargo install --path rslib/sync
[snip]
error: failed to run custom build command for `anki_i18n v0.0.0 (/tmp/anki/rslib/i18n)`
[snip]
  --- stderr

  thread 'main' panicked at rslib/i18n/gather.rs:63:37:
  called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to compile `anki-sync-server v0.0.0 (/tmp/anki/rslib/sync)`, intermediate artifacts can be found at `/tmp/anki/target`.

after manually running ./ninja ftl_repo it still fails, which did not happen at tag 25.02.7.

$ cargo install --path rslib/sync
[snip]
error[E0432]: unresolved import `tokio::io::AsyncReadExt`
   --> rslib/src/sync/http_client/io_monitor.rs:20:5
    |
20  | use tokio::io::AsyncReadExt;
    |     ^^^^^^^^^^^^^^^^^^^^^^^ no `AsyncReadExt` in `io`
    |
note: found an item that was configured out
   --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.45.1/src/io/mod.rs:277:131
    |
277 | ...lex, empty, repeat, sink, simplex, AsyncBufReadExt, AsyncReadExt, AsyncSeekExt, AsyncWriteExt,
    |                                                        ^^^^^^^^^^^^
note: the item is gated behind the `io-util` feature
   --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.45.1/src/io/mod.rs:268:1
    |
268 | / cfg_io_util! {
269 | |     mod split;
270 | |     pub use split::{split, ReadHalf, WriteHalf};
271 | |     mod join;
...   |
279 | |     };
280 | | }
    | |_^
    = note: this error originates in the macro `cfg_io_util` (in Nightly builds, run with -Z macro-backtrace for more info)
help: a similar name exists in the module
    |
20  - use tokio::io::AsyncReadExt;
20  + use tokio::io::AsyncRead;
    |
help: consider importing this trait instead
    |
20  - use tokio::io::AsyncReadExt;
20  + use futures::AsyncReadExt;
    |

error[E0432]: unresolved import `tokio::io::AsyncReadExt`
   --> rslib/src/sync/request/header_and_stream.rs:20:5
    |
20  | use tokio::io::AsyncReadExt;
    |     ^^^^^^^^^^^^^^^^^^^^^^^ no `AsyncReadExt` in `io`
    |
note: found an item that was configured out
   --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.45.1/src/io/mod.rs:277:131
    |
277 | ...lex, empty, repeat, sink, simplex, AsyncBufReadExt, AsyncReadExt, AsyncSeekExt, AsyncWriteExt,
    |                                                        ^^^^^^^^^^^^
note: the item is gated behind the `io-util` feature
   --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.45.1/src/io/mod.rs:268:1
    |
268 | / cfg_io_util! {
269 | |     mod split;
270 | |     pub use split::{split, ReadHalf, WriteHalf};
271 | |     mod join;
...   |
279 | |     };
280 | | }
    | |_^
    = note: this error originates in the macro `cfg_io_util` (in Nightly builds, run with -Z macro-backtrace for more info)
help: a similar name exists in the module
    |
20  - use tokio::io::AsyncReadExt;
20  + use tokio::io::AsyncRead;
    |
help: consider importing this trait instead
    |
20  - use tokio::io::AsyncReadExt;
20  + use futures::AsyncReadExt;
    |

error[E0599]: no method named `read_to_end` found for struct `StreamReader` in the current scope
   --> rslib/src/sync/http_client/io_monitor.rs:140:18
    |
139 | /             reader
140 | |                 .read_to_end(&mut buf)
    | |                 -^^^^^^^^^^^ method not found in `StreamReader<MapErr<..., ...>, ...>`
    | |_________________|
    |

error[E0599]: `ZstdDecoder<StreamReader<MapErr<S, {closure@...}>, ...>>` is not an iterator
  --> rslib/src/sync/request/header_and_stream.rs:68:10
   |
67 | /     reader
68 | |         .take(*MAXIMUM_SYNC_PAYLOAD_BYTES_UNCOMPRESSED)
   | |         -^^^^ `ZstdDecoder<StreamReader<MapErr<S, {closure@...}>, ...>>` is not an iterator
   | |_________|
   |
   |
  ::: /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/async-compression-0.4.25/src/tokio/bufread/mod.rs:10:1
   |
10 |   algos!(tokio::bufread<R>);
   |   ------------------------- doesn't satisfy `_: Iterator`
   |
   = note: the following trait bounds were not satisfied:
           `async_compression::tokio::bufread::ZstdDecoder<StreamReader<futures::stream::MapErr<S, {closure@rslib/src/sync/request/header_and_stream.rs:63:22: 63:25}>, bytes::Bytes>>: std::iter::Iterator`
           which is required by `&mut async_compression::tokio::bufread::ZstdDecoder<StreamReader<futures::stream::MapErr<S, {closure@rslib/src/sync/request/header_and_stream.rs:63:22: 63:25}>, bytes::Bytes>>: std::iter::Iterator`

Some errors have detailed explanations: E0432, E0599.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `anki` (lib) due to 4 previous errors
error: failed to compile `anki-sync-server v0.0.0 (/tmp/anki/rslib/sync)`, intermediate artifacts can be found at `/tmp/anki/target`.

It’s more likely a difference in Qt version and WebEngine. You could try with different Qt version - I’ll try to provide instructions on how to do so in the next beta.

That’s good news. I’d like to get at least one stable release out with 6.8 so that we can get an idea of regresions/improvements with a subsequent upgrade to 6.9, but as they have the same min OS versions, it hopefully wouldn’t be disruptive upgrade.

I think it’s more likely changed in b4, as I bumped the rusqlite version, which likely brought in a newer vendored SQLite. They’re probably being more tolerant of this particular corruption than they were previously.

This appears to have been deprecated since Python 3.3, and the add-on author would have been alerted to this if they’d been following recommended practice: Console Output - Writing Anki Add-ons

Will be fixed, thanks.

4 Likes

A new beta has been posted: Release 25.06b5 · ankitects/anki · GitHub

Once it’s available for download, I’ll update New online installer/launcher with instructions.

2 Likes

It seems these issues have re-occurred:

As Damien says this was just due to old Python code. I fixed it and uploaded it.

3 Likes

I forgot to add the Qt instructions. I’ve edited the post:

Is mpv installed? Does Anki print something when run from a terminal?

Reinstalling mpv fixed it! Thank you.