Browse Source

#13301: merge with 3.2.

pull/2332/head
Ezio Melotti 13 years ago
parent
commit
956c6c2dab
  1. 6
      Misc/NEWS
  2. 6
      Tools/i18n/msgfmt.py

6
Misc/NEWS

@ -227,6 +227,12 @@ Build
- Issue #15819: Make sure we can build Python out-of-tree from a read-only
source directory. (Somewhat related to issue #9860.)
Tools/Demos
-----------
- Issue #13301: use ast.literal_eval() instead of eval() in Tools/i18n/msgfmt.py
Patch by Serhiy Storchaka.
Documentation
-------------

6
Tools/i18n/msgfmt.py

@ -24,8 +24,9 @@ Options:
Display version information and exit.
"""
import sys
import os
import sys
import ast
import getopt
import struct
import array
@ -180,8 +181,7 @@ def make(filename, outfile):
l = l.strip()
if not l:
continue
# XXX: Does this always follow Python escape semantics?
l = eval(l)
l = ast.literal_eval(l)
if section == ID:
msgid += l.encode(encoding)
elif section == STR:

Loading…
Cancel
Save