Commit Graph

2097 Commits

Author SHA1 Message Date
Anthony Baxter
aadae7dae9 partial backport of guido's 1.188.
Add sendall() method, which loops until all data is written or an
  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().)

the 'partial' is because 1.188 also added a couple of Py_*_ALLOW_THREADS
wrappers around SSL_read and SSL_write, and I want to check those separately.

This is adding a new method to the socket object, which would normally
be a bad thing to do in a bugfix release - however, in this case, it
allows fixes for a nasty problem that would otherwise have a filthy
filthy fix to Get It Right. Still to-do is to patch the std library
modules to use sendall() where appropriate, rather than send().
2001-11-01 14:14:26 +00:00
Anthony Baxter
7aff5e470a backport of MvL's 1.180
Test for __sun instead of __sun__, since SUNWspro only defines the latter;
  gcc defines both.
...must get sparc box at home out of cupboard for testing this stuff...
2001-11-01 14:05:52 +00:00
Anthony Baxter
3357529c34 backport tim's 1.191:
PySocketSock_connect_ex():  On Windows, return the correct Windows exit
  code.  The patch is from Jeremy, and allows test_asynchat to run again.
2001-11-01 14:00:11 +00:00
Anthony Baxter
5d0fdbc690 backport (partially) jeremy's 1.178
Use PySocket_Err() instead of PyErr_SetFromErrno().
  The former does the right thing on Windows, the latter does not.

The 'partial' is because the code's changed quite a lot and it's not clear
that the two that are still there of the form
                return PyErr_SetFromErrno(SSLErrorObject);
can be replaced with PySocket_Err() - it looks like they need the new
PySSL_SetError, which is a tad large to be comfortable with just checking
in without reading it further.
2001-11-01 13:58:16 +00:00
Anthony Baxter
22a2ce8d40 backport tim's 2.44
Make clear in the docstring that "std" applies to both size and alignment,
  not just to alignment.  Spotted by Guido.

not normally bothering with docstring cleanups, but in this case Tim _did_
note it as a bugfix candidate, so I'll be nice :)
2001-11-01 13:34:10 +00:00
Anthony Baxter
39103a210c backport of 2.114:
SF patch #459385 (Norman Vine): time.timezone fix for Cygwin.
(skipped whitespace normalisation section of patch - this is a bugfix,
not a beauty contest :)
2001-11-01 13:14:43 +00:00
Anthony Baxter
c00f9343c2 backport 2.26
[Bug #433047, reported by Armin Rigo] Remove extra 'i' character in
      PyArg_ParseTuple() call.
2001-11-01 12:52:27 +00:00
Anthony Baxter
449ff25782 backport 2.61.
Properly use &&. Closes bug #434989.
2001-11-01 12:48:28 +00:00
Anthony Baxter
2c0d76e641 backport of fix from 2.7
Fix for bug [ #433047 ] missing args to PyArg_ParseTuple
2001-11-01 11:38:44 +00:00
Anthony Baxter
cece2b7da6 backport fixes from 2.32 and 2.29:
Change the limit on the input size for b2a_base64 to what will fit in
  memory, rather than the standard's 57.
  This fixes SF bug #473009.

  This closes bug #430849 (internal error produced by binascii.a2b_base64)
2001-11-01 11:30:06 +00:00
Guido van Rossum
bad60d9674 Fix leak in SSLread in nonblocking mode -- from SF bug #472798.
(Not a merge from the code on the trunk -- the trunk has evolved
perhaps too much.)
2001-10-19 15:17:42 +00:00
Thomas Wouters
83ac3305cf Backport of Jack's checkin 1.117:
File handlers don't work on the mac, so don't pretend they do.
2001-07-19 09:43:12 +00:00
Thomas Wouters
09fdab3e6f Backport of AMK's checkin 2.52:
[Bug #438050]
   Include sys/poll.h if it was found by the configure script.  The OpenGroup
   spec says poll.h is the correct header file to use, so that file is
   preferred.
2001-07-16 16:03:31 +00:00
Thomas Wouters
b8238516a2 Fix SF #441664: Python crash on del of a slice of a mmap
Check for slice/item deletion, which calls slice/item assignment with a NULL
value, and raise a TypeError instead of coredumping. Bugreport and suggested
fix by Alex Martelli.
2001-07-16 15:45:20 +00:00
Thomas Wouters
3261912601 Net result of Tim's checkins 2.28 through 2.31:
- SF but #417587: compiler warnings compiling 2.1.
  Repaired *some* of the SGI compiler warnings Sjoerd Mullender
  reported.

- Minor fiddling related to
  SF patch 416251 2.1c1 mmapmodule: unused vrbl cleanup

- Fix the .find() method for memory maps.

  1) it didn't obey the "start" parameter (and when it does, we must
     validate the value)
  2) the return value needs to be an absolute index, rather than
     relative to some arbitrary point in the file

  (checking CVS, it appears this method never worked; these changes
   bring it into line with typical .find() behavior)


- Fix new compiler warnings.  Also boost "start" from (C) int to long and
  return a (C) long:  PyArg_ParseTuple and Py_BuildValue may not let
  us get at the size_t we really want, but C int is clearly too small
  for a 64-bit box, and both the start parameter and the return value
  should work for large mapped files even on 32-bit boxes.  The code
  really needs to be rethought from scratch (not by me, though ...).
2001-07-12 12:43:11 +00:00
Thomas Wouters
cac2498815 Re-do the broken-nice() patch to break less platforms. Hopefully none :P
Also note that it isn't just Linux nice() that is broken: at least FreeBSD
and BSDI also have this problem. os.nice() should probably just be emulated
using getpriority()/setpriority(), if they are available, but that isn't
worth putting in 2.1.1.
2001-07-11 22:27:39 +00:00
Thomas Wouters
44589dda83 Patch #439995 (slightly modified from the uploaded version):
Work around Linux's nonstandard nice() systemcall, which does not return the
new priority.

This closes SF bug #439990.
2001-07-11 14:01:08 +00:00
Thomas Wouters
958106de04 Backport of Guido's checkins of acconfig.h (1.50), configure.in (1.224) and
readline.c (2.36), and re-generated config.h.in and configure:

SF Patch #432457 by Jason Tishler: support for readline 4.2.

This patch allows the readline module to build cleanly with GNU
readline 4.2 without breaking the build for earlier GNU readline
versions.  The configure script checks for the presence of
rl_completion_matches in libreadline.
2001-07-11 12:18:24 +00:00
Thomas Wouters
5eaa74048f Set PYTHONHOMEHELP to 2.1 2001-06-27 14:11:12 +00:00
Thomas Wouters
01a4623f43 Backport Fred's checkin 2.51:
Add :method info to the PyArg_ParseTuple() format strings for poll objects.
2001-06-27 13:12:47 +00:00
Thomas Wouters
687f228681 Backport of Tim's checkin 2.111:
SF patch #418147 Fixes to allow compiling w/ Borland, from Stephen Hansen.
2001-06-27 13:01:54 +00:00
Thomas Wouters
94441fe050 Backport of Tim's checkin 2.190:
SF patch #418147 Fixes to allow compiling w/ Borland, from Stephen Hansen.
2001-06-27 13:01:12 +00:00
Fred Drake
bba4c8c76b Fix my own typo: protect the FLUSHO usage with "#ifdef FLUSHO", not
"#ifndef FLUSHO".
2001-06-18 21:05:04 +00:00
Fred Drake
bbdc66ff2f Spell "#ifdef" as "#ifdef", not "#endif". 2001-06-16 20:46:10 +00:00
Thomas Wouters
458004a50d Protect several more uses of constants with #ifdefs; these are necessary on
(at least) SCO OpenServer 5. Fixes a non-SF-submitted bugreport by Michael
Kent.
2001-06-15 11:58:49 +00:00