#13301: use ast.literal_eval() instead of eval() in Tools/i18n/msgfmt.py. Patch by Serhiy Storchaka.

This commit is contained in:
Ezio Melotti 2012-11-09 11:46:19 +01:00
parent 8b6b176b33
commit 9bf379e9fb
2 changed files with 9 additions and 3 deletions

View File

@ -682,6 +682,12 @@ Build
- Issue #14018: Fix OS X Tcl/Tk framework checking when using OS X SDKs.
Tools/Demos
-----------
- Issue #13301: use ast.literal_eval() instead of eval() in Tools/i18n/msgfmt.py
Patch by Serhiy Storchaka.
Documentation
-------------

View File

@ -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: