Opened 11 years ago
Last modified 3 years ago
#22617 closed Cleanup/optimization
Allow to fix translation -> Fix makemessages to not delete debug data and hide errors (and all similar modules using "msgmerge") — at Initial Version
Reported by: | Cezary.Wagner | Owned by: | nobody |
---|---|---|---|
Component: | Core (Management commands) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Ad Timmering | Triage Stage: | Unreviewed |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
Please replace code in make messages to not delete *.po files if error occured and show messages (fix exception later).
Replace this code:
if errors:
if status != STATUS_OK:
raise CommandError(
"errors happened while running msgmerge\n%s" % errors)
elif self.verbosity > 0:
self.stdout.write(errors)
With this code (it shows error root cause and save/copy *.po need to solve this error):
if errors:
if status != STATUS_OK:
self.stdout.write(errors) # bug exception bellow not shows errors
import shutil
shutil.copyfile(pofile, '%s.debug' % pofile)
raise CommandError(
"errors happened while running msgmerge\n%s" % errors)
elif self.verbosity > 0:
self.stdout.write(errors)
All modules using command line tools should report errors and not delete input if error occured.