Kaydet (Commit) dc118790 authored tarafından Ezio Melotti's avatar Ezio Melotti

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

#13301: use ast.literal_eval() instead of eval() in Tools/i18n/msgfmt.py.  Patch by Serhiy Storchaka.
üst 09017767
......@@ -530,6 +530,12 @@ Build
- Issue #14437: Fix building the _io module under Cygwin.
Tools/Demos
-----------
- Issue #13301: use ast.literal_eval() instead of eval() in Tools/i18n/msgfmt.py
Patch by Serhiy Storchaka.
Documentation
-------------
......
......@@ -25,8 +25,9 @@ Options:
Display version information and exit.
"""
import sys
import os
import sys
import ast
import getopt
import struct
import array
......@@ -170,8 +171,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
elif section == STR:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment