diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-01-05 03:33:26 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-01-05 03:33:26 (GMT) |
commit | aaa4e9a4380f904c6ae4e7dadd229c48d3adc615 (patch) | |
tree | 950dcec5ce602ae71eee274bbc4fe4e775bd8c11 | |
parent | 477efb394412314d47fdfb3f7c287edb028809c0 (diff) | |
download | cpython-aaa4e9a4380f904c6ae4e7dadd229c48d3adc615.zip cpython-aaa4e9a4380f904c6ae4e7dadd229c48d3adc615.tar.gz cpython-aaa4e9a4380f904c6ae4e7dadd229c48d3adc615.tar.bz2 |
Remove arbitrary string length limits
PyUnicode_FromFormat() and PyErr_Format() allocates a buffer of the needed
size, it is no more a fixed-buffer of 500 bytes.
-rw-r--r-- | Objects/codeobject.c | 4 | ||||
-rw-r--r-- | Parser/tokenizer.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Objects/codeobject.c b/Objects/codeobject.c index e9cae13..bb938ea 100644 --- a/Objects/codeobject.c +++ b/Objects/codeobject.c @@ -347,11 +347,11 @@ code_repr(PyCodeObject *co) lineno = -1; if (co->co_filename && PyUnicode_Check(co->co_filename)) { return PyUnicode_FromFormat( - "<code object %.100U at %p, file \"%.300U\", line %d>", + "<code object %U at %p, file \"%U\", line %d>", co->co_name, co, co->co_filename, lineno); } else { return PyUnicode_FromFormat( - "<code object %.100U at %p, file ???, line %d>", + "<code object %U at %p, file ???, line %d>", co->co_name, co, lineno); } } diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index 441d05a..556be46 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -590,7 +590,7 @@ decoding_fgets(char *s, int size, struct tok_state *tok) if (filename != NULL) { PyErr_Format(PyExc_SyntaxError, "Non-UTF-8 code starting with '\\x%.2x' " - "in file %.200U on line %i, " + "in file %U on line %i, " "but no encoding declared; " "see http://python.org/dev/peps/pep-0263/ for details", badchar, filename, tok->lineno + 1); |