| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
"socket.socket" -- on Windows, "socket.socket" is the wrapper class.
Also added the module name to the SSL type (which is not a new-style
class -- I don't want to mess with it yet).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
constructor acts just like socket() before. All three arguments have
a sensible default now; socket() is equivalent to
socket(AF_INET, SOCK_STREAM).
One minor issue: the socket() function and the SocketType had
different doc strings; socket.__doc__ gave the signature,
SocketType.__doc__ gave the methods. I've merged these for now, but
maybe the list of methods is no longer necessary since it can easily
be recovered through socket.__dict__.keys(). The problem with keeping
it is that the total doc string is a bit long (34 lines -- it scrolls
of a standard tty screen).
Another general issue with the socket module is that it's a big mess.
There's pages and pages of random platform #ifdefs, and the naming
conventions are totally wrong: it uses Py prefixes and CapWords for
static functions. That's a cleanup for another day... (Also I think
the big starting comment that summarizes the API can go -- it's a
repeat of the docstring.)
|
|
|
|
|
|
|
| |
error occurs, and doesn't return a count. (This is my second patch
from SF patch #474307, with small change to the docstring for send().)
2.1.2 "bugfix" candidate.
|
|
|
|
|
|
|
|
| |
Replace some tortuous code that was trying to be clever but forgot to
DECREF the key and value, by more longwinded but obviously correct
code.
(Inspired by but not copying the fix from SF patch #475033.)
|
|
|
|
| |
and that the work-around should be restricted to that system.
|
|
|
|
|
| |
like findall, but returns an iterator (which returns match objects)
instead of a list of strings/tuples.
|
| |
|
| |
|
|
|
|
|
|
| |
STRICT_SYSV_CURSES when compiling curses module on HP/UX. Generalize
access to _flags on systems where WINDOW is opaque. Fixes bugs
#432497, #422265, and the curses parts of #467145 and #473150.
|
|
|
|
| |
not properly processing numeric IPv4 addresses. Fixes V5.1 part of #472675.
|
| |
|
|
|
|
| |
the existing #ifdef MS_WINDOWS), but eventually ifdeffing on configure features is probably better.
|
|
|
|
| |
PyArg_UnpackTuple() function (serves as an example and test case).
|
|
|
|
|
| |
template string, and don't call the template compiler if we can
avoid it.
|
|
|
|
| |
(sorry, barry)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
strings, not C strings)
removed USE_PYTHON defines, and related sre.py helpers
skip calling the subx helper if the template is callable.
interestingly enough, this means that
def callback(m):
return literal
result = pattern.sub(callback, string)
is much faster than
result = pattern.sub(literal, string)
|
|
|
|
|
|
| |
check to the test suite.
added a few missing exception checks in the _sre module
|
|
|
|
|
|
|
|
|
| |
removed (conceptually flawed) getliteral helper; the new sub/subn code
uses a faster code path for literal replacement strings, but doesn't
(yet) look for literal patterns.
added STATE_OFFSET macro, and use it to convert state.start/ptr to
char indexes
|
|
|
|
| |
Do not set the Expat handlers if it is. Fixes PyXML bug #473195.
|
|
|
|
| |
also restored SRE Unicode support for 1.6/2.0/2.1
|
|
|
|
|
|
|
|
| |
Allow passing strings to the .border() method
Correct some error messages ("1 or 4" -> "1 to 4")
Bump version number
Tweak code formatting
Update my e-mail address
|
|
|
|
|
| |
This appears to be a case of a missing \n\ in a multiline string
literal.
|
|
|
|
|
|
|
|
| |
This adds unsetenv to posix, and uses it in the __delitem__ method of
os.environ.
(XXX Should we change the preferred name for putenv to setenv, for
consistency?)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was submitted by Moshe, but apparently he's too busy to check it
in himself. He wrote:
Here is a function in GNU readline called add_history,
which is used to manage the history list. Though Python
uses this function internally, it does not expose it to
the Python programmer. This patch adds direct interface
to this function with documentation.
This could be used by friendly modules to "seed" the
history with commands.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a big one, touching lots of files. Some of the platforms
aren't tested yet. Briefly, this changes the return value of the
os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the
time functions localtime(), gmtime(), and strptime() from tuples into
pseudo-sequences. When accessed as a sequence, they behave exactly as
before. But they also have attributes like st_mtime or tm_year. The
stat return value, moreover, has a few platform-specific attributes
that are not available through the sequence interface (because
everybody expects the sequence to have a fixed length, these couldn't
be added there). If your platform's struct stat doesn't define
st_blksize, st_blocks or st_rdev, they won't be accessible from Python
either.
(Still missing is a documentation update.)
|
|
|
|
| |
<grp.h> it seems. This requires yet another configure test.
|
|
|
|
|
|
|
|
| |
compile should raise error for non-strings
SRE bug #432570, 448951:
reset group after failed match
also bumped version number to 2.2.0
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Quoth the OpenSSL RAND_add man page:
OpenSSL makes sure that the PRNG state is unique for each
thread. On systems that provide /dev/urandom, the
randomness device is used to seed the PRNG transparently.
However, on all other systems, the application is
responsible for seeding the PRNG by calling RAND_add(),
RAND_egd(3) or RAND_load_file(3).
I decided to expose RAND_add() because it's general and RAND_egd()
because it's a useful special case. RAND_load_file() didn't seem to
offer much over RAND_add(), so I skipped it. Also supplied
RAND_status() which returns true if the PRNG is seeded and false if
not.
|
| |
|
| |
|
|
|
|
| |
line fits in reasonable screen width.
|
| |
|
|
|
|
| |
Made the presence/absence of a semicolon after macros consistent.
|
|
|
|
|
|
|
| |
removed the tricks).
Changed the ENTER/LEAVE_ZLIB macros so as not to create a new block (a
new block is neither necessary nor helpful).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Apparently this patch (rev 2.41) replaced all the good old "s#"
formats in PyArg_ParseTuple() with "S". Then it did
PyString_FromStringAndSize() to get back the values setup by the
"s#" format. It also incref'd and decref'd the string obtained by
"S" even though the argument tuple had a reference to it.
Replace PyString_AsString() calls with PyString_AS_STRING().
A good rule of thumb -- if you never check the return value of
PyString_AsString() to see if it's NULL, you ought to be using the
macro <wink>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Many functions used a local variable called return_error, which was
initialized to zero. If an error occurred, it was set to true. Most
of the code paths checked were only executed if return_error was
false. goto is clearer.
The code also seemed to be written under the curious assumption that
calling Py_DECREF() on a local variable would assign the variable to
NULL. As a result, more of the error-exit code paths returned an
object that had a reference count of zero instead of just returning
NULL. Fixed the code to explicitly assign NULL after the DECREF.
A bit more reformatting, but not much.
XXX Need a much better test suite for zlib, since it the current tests
don't exercise any of this broken code.
|
| |
|
|
|
|
|
| |
It sets a ZlibError exception, using the msg from the z_stream pointer
if one is available.
|
|
|
|
|
| |
When PyString_FromStringAndSize() and _PyString_Resize() fail, they
set an exception. There's no need to set a new exception.
|
|
|
|
|
|
| |
Consistently indent 4 spaces.
Use whitespace around operators.
Put braces in the right places.
|
|
|
|
|
|
| |
This changes Pythread_start_thread() to return the thread ID, or -1
for an error. (It's technically an incompatible API change, but I
doubt anyone calls it.)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mostly by Toby Dickenson and Titus Brown.
Add an optional argument to a decompression object's decompress()
method. The argument specifies the maximum length of the return
value. If the uncompressed data exceeds this length, the excess data
is stored as the unconsumed_tail attribute. (Not to be confused with
unused_data, which is a separate issue.)
Difference from SF patch: Default value for unconsumed_tail is ""
rather than None. It's simpler if the attribute is always a string.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Added support for saving the names of the functions observed into the
profile log.
Added support for using the profiler to measure coverage without collecting
timing information (which is the slow part). Coverage logs can also be
substantially smaller than profiling logs where per-line information is
being collected.
Updated comments on the log format; corrected record type values in some
of the record descriptions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Raise ValueError when an object contains an arbitrarily nested
reference to itself. (The previous fix just produced invalid
pickles.)
Solution is very much like Py_ReprEnter() and Py_ReprLeave():
fast_save_enter() and fast_save_leave() that tracks the fast_container
limit and keeps a fast_memo of objects currently being pickled.
The cost of the solution is moderately expensive for deeply nested
structures, but it still seems to be faster than normal pickling,
based on tests with deeply nested lists.
Once FAST_LIMIT is exceeded, the new code is about twice as slow as
fast-mode code that doesn't check for recursion. It's still twice as
fast as the normal pickling code. In the absence of deeply nested
structures, I couldn't measure a difference.
|
|
|
|
| |
initialize (or use or even know about :-).
|