| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
the xreadlines module and lets it do its thing.)
|
|
|
|
| |
a fallback for TELL64. Fixes SF Bug #128119.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Tim discovered another "bug" in my get_line() code: while the comments
said that n<0 was invalid, it was in fact still called with n<0 (when
PyFile_GetLine() was called with n<0). In that case fortunately
executed the same code as for n==0.
Changed the comment to admit this fact, and changed Tim's MS speed
hack code to use 'n <= 0' as the criteria for the speed hack.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
code duplication is to let us get away without a realloc whenever possible;
boosted the init buf size (the cutoff at which we *can* get away without
a realloc) from 100 to 200 so that more files can enjoy this boost; and
allowed other threads to run in all cases. The last two cost something,
but not significantly: in my fat test case, less than a 1% slowdown total.
Since my test case has a great many short lines, that's probably the worst
slowdown, too. While the logic barely changed, there were lots of edits.
This also gets rid of the reference to fp->_cnt, so the last platform
assumption being made here is that fgets doesn't overwrite bytes
capriciously (== beyond the terminating null byte it must write).
|
|
|
|
|
|
| |
variant that never needs to "search from the right".
Also fixed unlikely memory leak in get_line, if string size overflows INTMAX.
Also new std test test_bufio to make sure .readline() works.
|
|
|
|
|
|
| |
realized that this behavior is already present in PyFile_GetLine(),
which is the only place that needs it. A little refactoring of that
function made get_line_raw() redundant.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The mapping dictionaries can now contain 1-n mappings, meaning
that character ordinals may be mapped to strings or Unicode object,
e.g. 0x0078 ('x') -> u"abc", causing the ordinal to be replaced by
the complete string or Unicode object instead of just one character.
Another feature introduced by the patch is that of mapping oridnals to
the emtpy string. This allows removing characters.
The patch is different from patch #103100 in that it does not cause a
performance hit for the normal use case of 1-1 mappings.
Written by Marc-Andre Lemburg, copyright assigned to Guido van Rossum.
|
|
|
|
|
|
|
| |
- The raw_input() functionality is moved to a separate function.
- Drop GNU getline() in favor of getc_unlocked(), which exists on more
platforms (and is even a tad faster on my system).
|
|
|
|
| |
longer get special treatment. The Py_NotImplemented type is here as well.
|
|
|
|
| |
now as well.
|
|
|
|
| |
now as well.
|
| |
|
|
|
|
|
| |
types no longer get special treatment from abstract.c so more number number
methods have to be implemented.
|
| |
|
|
|
|
| |
Added test for second one.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
codec to not apply Latin-1 mappings for keys which are not found
in the mapping dictionaries, but instead treat them as undefined
mappings.
The patch was originally written by Martin v. Loewis with some
additional (cosmetic) changes and an updated test script
by Marc-Andre Lemburg.
The standard codecs were recreated from the most current files
available at the Unicode.org site using the Tools/scripts/gencodec.py
tool.
This patch closes the bugs #116285 and #119960.
|
|
|
|
| |
fixes bug #126345.
|
|
|
|
| |
in one place.
|
|
|
|
|
| |
incorrect % characters; characters outside the printable range are
replaced with '?'
|
|
|
|
| |
using GNU libc's getline()
|
| |
|
|
|
|
| |
index at which an unknown %-escape was found
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
a prime size, which is in fact never true anymore ...).
|
| |
|
|
|
|
|
|
| |
Fix type of the self parameter to some string object methods.
This closes patch #102670.
|
|
|
|
| |
Improved version coming soon to a Source Forge near you!
|
| |
|
|
|
|
|
| |
Complete with docos and tests.
OKed by Guido.
|
| |
|
| |
|
| |
|
|
|
|
| |
Fixes a typo that caused "".join(u"this is a test") to dump core.
|
|
|
|
|
| |
hack for TELL64()... Sounds like there's something else going on
really. Does anybody have a clue I can buy?
|
|
|
|
|
|
|
| |
*really* closes bug #121965.
Added three attributes to the xrange object: start, stop, and step. These
are the same as for the slice objects.
|
|
|
|
|
|
| |
where ">=" should have been.
This closes bug #121965.
|
|
|
|
|
|
|
| |
ranges) -- but thanks to the 2.0 compression scheme, this doesn't add
a single byte to the resulting binaries (!)
Closes bug #117524
|
|
|
|
|
|
| |
Changes to error messages to increase consistency & clarity.
This (mostly) closes SourceForge patch #101839.
|
|
|
|
|
|
|
| |
for the bug reported in Bug #116174: "%% %s" % u"abc" failed due
to the way string formatting delegated work to the Unicode formatting
function.
|
|
|
|
|
|
|
| |
Fix large file support for BeOS.
This closes SourceForge patch #101773. Refer to the patch discussion for
information on possible alternate fixes.
|
|
|
|
|
|
|
|
|
|
| |
raise ValueError. Checked in the patch as far as it went, but also changed
all of ints, longs and floats to raise ZeroDivisionError instead when raising
0 to a negative number. This is what 754-inspired stds require, as the "true
result" is an infinity obtained from finite operands, i.e. it's a singularity.
Also changed float pow to not be so timid about using its square-and-multiply
algorithm. Note that what math.pow does is unrelated to what builtin pow
does, and will still vary by platform.
|
|
|
|
|
| |
support for the last_is_sticky flag. A few hard to find bugs may be
fixed by this patch since the old code was buggy.
|
|
|
|
|
|
| |
result-object-pointer that is passed in, when an exception occurs during
coercion. The pointer has to be explicitly initialized in the caller to avoid
putting trash on the Python stack.
|