summaryrefslogtreecommitdiff
path: root/Python/formatter_unicode.c
diff options
context:
space:
mode:
authorLars Gust?bel <lars@gustaebel.de>2015-07-02 19:41:03 +0200
committerLars Gust?bel <lars@gustaebel.de>2015-07-02 19:41:03 +0200
commita0333aa657baeb3738a8c2fe211168cb1dbab8ac (patch)
tree9d48b355036c218e706d4e0c698fc3586673bd5b /Python/formatter_unicode.c
parente8c3a8aa583475fa33dd8b74959193217cb56933 (diff)
parentc6050850b5f399a24702795515d02fdf06b01b4f (diff)
downloadcpython-a0333aa657baeb3738a8c2fe211168cb1dbab8ac.tar.gz
Merge with 3.4: Issue #24514: tarfile now tolerates number fields consisting of only whitespace.
Diffstat (limited to 'Python/formatter_unicode.c')
-rw-r--r--Python/formatter_unicode.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Python/formatter_unicode.c b/Python/formatter_unicode.c
index e3a8149841..056bb76902 100644
--- a/Python/formatter_unicode.c
+++ b/Python/formatter_unicode.c
@@ -846,6 +846,13 @@ format_long_internal(PyObject *value, const InternalFormatSpec *format,
" format specifier 'c'");
goto done;
}
+ /* error to request alternate format */
+ if (format->alternate) {
+ PyErr_SetString(PyExc_ValueError,
+ "Alternate form (#) not allowed with integer"
+ " format specifier 'c'");
+ goto done;
+ }
/* taken from unicodeobject.c formatchar() */
/* Integer input truncated to a character */