kelciour / movies2anki

Convert movies with subtitles to watch them with Anki. Inspired by subs2srs
GNU Affero General Public License v3.0
309 stars 29 forks source link

Filename with a percent character causes ValueError: invalid interpolation syntax in the filename history #22

Closed aleksejrs closed 9 months ago

aleksejrs commented 2 years ago

I added file-1.mp4file-3.mp4, restarted Anki, then added file-4.mp4file-6.mp4 and file-% .mp4

Anki 2.1.22 (0ecc189a) Python 3.8.1 Qt 5.14.1 PyQt 5.14.1
Platform: Linux
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2022-01-15 13:36:32
Add-ons possibly involved: ⁨Watch Foreign Language Movies with Anki⁩

Caught exception:
Traceback (most recent call last):
  File "/home/anki/.local/share/Anki2/addons21/939347702/movies2anki.py", line 1574, in start
    self.startSingleMode()
  File "/home/anki/.local/share/Anki2/addons21/939347702/movies2anki.py", line 1705, in startSingleMode
    self.model.save_settings()
  File "/home/anki/.local/share/Anki2/addons21/939347702/movies2anki.py", line 695, in save_settings
    config.set('main', 'recent_deck_names', ",".join(reversed(self.recent_deck_names)))
  File "/home/anki/.local/share/Anki2/addons21/939347702/configparser.py", line 1198, in set
    super().set(section, option, value)
  File "/home/anki/.local/share/Anki2/addons21/939347702/configparser.py", line 892, in set
    value = self._interpolation.before_set(self, section, option,
  File "/home/anki/.local/share/Anki2/addons21/939347702/configparser.py", line 401, in before_set
    raise ValueError("invalid interpolation syntax in %r at "
ValueError: invalid interpolation syntax in 'file-%,file-6,file-5,file-4,file-3' at position 5
kelciour commented 2 years ago

Thank you for the report!