diff options
author | Nadeem Vawda <nadeem.vawda@gmail.com> | 2013-10-28 21:41:24 +0100 |
---|---|---|
committer | Nadeem Vawda <nadeem.vawda@gmail.com> | 2013-10-28 21:41:24 +0100 |
commit | acf010d6b83e6ee4bc916a61b04938f2f4205810 (patch) | |
tree | 20104eff0d9561d62fc9f538a7882d7b98e00ac1 /Python/pystrtod.c | |
parent | 284a788ebc97e88858f9299669470438dcf0ebfb (diff) | |
parent | c3408df66ec4dbebcbbfc283cebd9736d97f5f1c (diff) | |
download | cpython-acf010d6b83e6ee4bc916a61b04938f2f4205810.tar.gz |
#19395: Raise exception when pickling a (BZ2|LZMA)(Compressor|Decompressor).
The underlying C libraries provide no mechanism for serializing compressor and
decompressor objects, so actually pickling these classes is impractical.
Previously, these objects would be pickled without error, but attempting to use
a deserialized instance would segfault the interpreter.
Diffstat (limited to 'Python/pystrtod.c')
-rw-r--r-- | Python/pystrtod.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/pystrtod.c b/Python/pystrtod.c index 4ab8f08d22..b8dd919a26 100644 --- a/Python/pystrtod.c +++ b/Python/pystrtod.c @@ -164,7 +164,7 @@ static double _PyOS_ascii_strtod(const char *nptr, char **endptr) { char *fail_pos; - double val = -1.0; + double val; struct lconv *locale_data; const char *decimal_point; size_t decimal_point_len; @@ -923,7 +923,7 @@ static char *uc_float_strings[] = { static char * format_float_short(double d, char format_code, - int mode, Py_ssize_t precision, + int mode, int precision, int always_add_sign, int add_dot_0_if_integer, int use_alt_formatting, char **float_strings, int *type) { @@ -1059,7 +1059,7 @@ format_float_short(double d, char format_code, /* if using an exponent, reset decimal point position to 1 and adjust exponent accordingly.*/ if (use_exp) { - exp = decpt - 1; + exp = (int)decpt - 1; decpt = 1; } /* ensure vdigits_start < decpt <= vdigits_end, or vdigits_start < |