| Commit message (Collapse) | Author | Age | Files | Lines |
|\ |
|
| | |
|
| |\ |
|
| | |
| | |
| | |
| | | |
Also add to comment in the C code.
|
|\ \ \
| |/ / |
|
| |\ \
| | |/ |
|
| | |
| | |
| | |
| | |
| | |
| | | |
This reuses existing code to hopefully make the new test_input_no_stdout_
fileno() test work. It is hanging Free BSD 9 and OS X Tiger buildbots, and I
don't know why.
|
|\ \ \
| |/ / |
|
| |\ \
| | |/ |
|
| | |
| | |
| | |
| | | |
Also factored out some test cases into a new PtyTests class.
|
|\ \ \
| |/ / |
|
| |\ \
| | |/ |
|
| | | |
|
|\ \ \
| |/ / |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
sys.path has an unwritable __pycache__ directory.
This typically comes up when someone runs the test suite from an
administrative install of Python on Windows where the user does not
have write permissions to the stdlib's directory.
Thanks to Zachary Ware and Matthias Klose for reporting bugs related
to this issue.
|
| | |
| | |
| | |
| | | |
Optimize also %% formater.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Optimize bytes.__mod__(args) for integere formats: %d (%i, %u), %o, %x and %X.
_PyBytesWriter is now used to format directly the integer into the writer
buffer, instead of using a temporary bytes object.
Formatting is between 30% and 50% faster on a microbenchmark.
|
|\ \ \
| |/ / |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This is a relatively benign bug, since having both be true was correctly
rejected at in SMTPServer even before this patch.
Patch by Xiang Zhang.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
string is pure ASCII: use _PyBytesWriter_WriteBytes(), don't check individual
character.
Cleanup unicode_encode_ucs1():
* Rename repunicode to rep
* Clear rep object on error
* Factorize code between bytes and unicode path
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
Substract preallocate bytes from min_size before calling
_PyBytesWriter_Prepare().
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* Thanks to the _PyBytesWriter API, output smaller than 512 bytes are allocated
on the stack and so avoid calling _PyBytes_Resize(). Because of that, change
the default buffer size to fmtcnt instead of fmtcnt+100.
* Rely on _PyBytesWriter algorithm to overallocate the buffer instead of using
a custom code. For example, _PyBytesWriter uses a different overallocation
factor (25% or 50%) depending on the platform to get best performances.
* Disable overallocation for the last write.
* Replace C loops to fill characters with memset()
* Add also many comments to _PyBytes_Format()
* Remove unused FORMATBUFLEN constant
* Avoid the creation of a temporary bytes object when formatting a floating
point number (when no custom formatting option is used)
* Fix also reference leaks on error handling
* Use Py_MEMCPY() to copy bytes between two formatters (%)
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
Rename "stack buffer" to "small buffer".
Add also an assertion in _PyBytesWriter_GetPos().
|
| | |
| | |
| | |
| | | |
Fix code to estimate the needed space.
|
| | |
| | |
| | |
| | |
| | |
| | | |
Rewrite backslashreplace() to be closer to PyCodec_BackslashReplaceErrors().
Add also unit tests for non-BMP characters.
|
| | |
| | |
| | |
| | | |
Replace "#if Py_DEBUG" with "#ifdef Py_DEBUG".
|
| | |
| | |
| | |
| | | |
Declare also the private API in bytesobject.h.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Issue #25318: Optimize backslashreplace and xmlcharrefreplace error handlers in
UTF-8 encoder. Optimize also backslashreplace error handler for ASCII and
Latin1 encoders.
Use the new _PyBytesWriter API to optimize these error handlers for the
encoders. It avoids to create an exception and call the slow implementation of
the error handler.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Add a new private API to optimize Unicode encoders. It uses a small buffer
allocated on the stack and supports overallocation.
Use _PyBytesWriter API for UCS1 (ASCII and Latin1) and UTF-8 encoders. Enable
overallocation for the UTF-8 encoder with error handlers.
unicode_encode_ucs1(): initialize collend to collstart+1 to not check the
current character twice, we already know that it is not ASCII.
|
| | | |
|
|\ \ \
| |/ / |
|
| | |
| | |
| | |
| | | |
selected on upgrade.
|
|\ \ \
| |/ / |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
extensions.
Patch by Nikolay Bogoychev.
|
|\ \ \
| |/ /
| | |
| | | |
Patch by Henrik Heimbuerger and Bar Harel.
|
| |\ \
| | |/
| | |
| | | |
Patch by Henrik Heimbuerger and Bar Harel.
|
| | |
| | |
| | |
| | | |
Patch by Henrik Heimbuerger and Bar Harel.
|
| | | |
|
|\ \ \
| |/ / |
|
| | | |
|
| |\ \
| | |/ |
|