NaPs / Kolekto

Kolekto is a really KISS movie catalog software
MIT License
27 stars 3 forks source link

[bug] UTF-8 in config file #16

Closed tetraf closed 10 years ago

tetraf commented 10 years ago

With ArchLinux, python 2.7.6, Kolekto 1.1 from AUR (https://aur.archlinux.org/packages/kolekto/).

$ kolekto config
Traceback (most recent call last):
  File "/usr/bin/kolekto", line 75, in <module>
    main()
  File "/usr/bin/kolekto", line 68, in main
    args.command(args, config)
  File "/usr/lib/python2.7/site-packages/kolekto/commands/config.py", line 17, in run
    config = printer.edit(fconfig.read())
  File "/usr/lib/python2.7/site-packages/kolekto/printer.py", line 141, in edit
    ftmp.write(text.encode('utf-8'))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 199: ordinal not in range(128)

In config file:

view 'Année' {
    pattern = '{year|"inconnue"}/{title}.{ext}'
}

No problem with:

view 'Annee' {
    pattern = '{year|"inconnue"}/{title}.{ext}'
}
NaPs commented 10 years ago

Hi, thanks for your report. The problem has been fixed.

As a workaround, you can edit the configuration file using your favorite editor instead of using the "config" command. The bug only occurs only while editing the configuration file, Kolekto itself should handle the utf-8 encoding properly.

tetraf commented 10 years ago

OK, cheers.