summaryrefslogtreecommitdiff
path: root/Python/formatter_unicode.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2014-05-09 00:31:32 +0200
committerAntoine Pitrou <solipsis@pitrou.net>2014-05-09 00:31:32 +0200
commit74339a075353dfb9256d2b746b4cd1daf78d2736 (patch)
tree4a694446c54f2c63d6154e5b4cbcb8c68fe61e7b /Python/formatter_unicode.c
parentf2dde0a5269fe5697c68b0336d42223b3db2df7e (diff)
parentdc91a772d955f6dd4af3ce0070d03159c4b6c3b2 (diff)
downloadcpython-74339a075353dfb9256d2b746b4cd1daf78d2736.tar.gz
Issue #21396: Fix TextIOWrapper(..., write_through=True) to not force a flush() on the underlying binary stream.
Patch by akira.
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 */