X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/967eed676fc83d15b26149047f353ac61faa8217..323d986cab0fe909289263325d181c7b9acfc2fa:/src/lesmianator/management/commands/lesmianator.py?ds=inline diff --git a/src/lesmianator/management/commands/lesmianator.py b/src/lesmianator/management/commands/lesmianator.py index bcad60189..7d9558d0f 100644 --- a/src/lesmianator/management/commands/lesmianator.py +++ b/src/lesmianator/management/commands/lesmianator.py @@ -75,7 +75,7 @@ class Command(BaseCommand): processed += 1 last_word = '' - text = str(m.group(1), 'utf-8').lower() + text = m.group(1).lower() for letter in text: mydict = lesmianator.setdefault(last_word, {}) mydict.setdefault(letter, 0) @@ -91,12 +91,11 @@ class Command(BaseCommand): return try: - dump(lesmianator, open(path, 'w')) + dump(lesmianator, open(path, 'wb')) except IOError: print(self.style.ERROR("Couldn't write to $s" % path)) return - dump(lesmianator, open(path, 'w')) if verbose >= 1: print("%d processed, %d skipped" % (processed, skipped)) print("Results dumped to %s" % path)