ankidroid / ankidroid/Anki-Android

Exporting a deck as plain text fails if the deck name contains a slash

未关闭
#21,591 3 条评论 0 个 reaction 已指派 1 人 已被 @CapThunder19 认领 在 GitHub 查看
Needs Triage
主要语言
Kotlin
星标
11.8k
派生
2.9k
平均合并
2 天 3 小时
30 天内合并 PR
171

描述

### Checked for duplicates?

- [x] This issue is not a duplicate

### Does it also happen in the desktop version?

- [ ] This bug does not occur in the latest version of Anki Desktop

### What are the steps to reproduce this bug?

1. Create a deck with a "/" in its name, e.g. hi/test
2. Add card to it
3. on Deck Picker long-press the deck and then Export the deck
4. Set "Export format" to "Notes in Plain Text (.txt)"
5. Tap Export

The export fails with an error and no file is produced

Two things that narrow it down:
- The same deck exports fine as "Anki Deck Package (.apkg)"
- Renaming the deck to Der_Die_Das makes the .txt export work

"Cards in Plain Text (.txt)" fails in the same way

### Expected behaviour

What happened: the export failed with an IO error, no file was created

Image

What should have happened: the deck exports to a .txt file, with the slash
handled in the generated filename the same way the .apkg export already
handles it

### Debug info

```text
AnkiDroid Version = 2.24.0 (ebcf8e0e34921628b9b8a496c66ffd4adbb3705f)
Backend Version = 0.1.64-anki25.09.2 (25.09.2 3890e12c9e48c028c3f12aa58cb64bd9f8895e30)
Android Version = 15 (SDK 35)
ProductFlavor = play
Device Info = OPPO | OPPO | OP574FL1 | CPH2577 | CPH2577 | mt6768
WebView Info = [com.google.android.webview | 792208303]: Mozilla/5.0 (Linux; Android 15; CPH2577 Build/AP3A.240617.008; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/151.0.7922.83 Mobile Safari/537.36
ACRA UUID = e76ebe42-1f6f-4830-ac63-426b439fda94
FSRS = 5.1.0 (Enabled: false)
Crash Reports Enabled = true
```

### (Optional) Anything else you want to share?

_No response_

### Research

- [x] I have checked the [manual](https://docs.ankidroid.org/) and the [FAQ](https://github.com/ankidroid/Anki-Android/wiki/FAQ) and could not find a solution to my issue
- [ ] (Optional) I have confirmed the issue is not resolved in the latest alpha release ([instructions](https://docs.ankidroid.org/manual.html#betaTesting))

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。