Commit Graph

83 Commits

Author SHA1 Message Date
Giampaolo Rodolà 985b68e611 Store all errors signaling a disconnection into a global frozenset to save some computation time on recv() and send(). 2010-09-15 21:43:47 +00:00
Giampaolo Rodolà 76fc8c7098 fix issue 658749: correctly interprets asyncore's windows errors on connect() 2010-08-23 21:53:41 +00:00
Giampaolo Rodolà 934abddaec fix issue #2944: asyncore doesn't handle connection refused correctly (patch by Alexander Shigin). Merged from 2.7 branch. 2010-08-04 09:02:27 +00:00
Georg Brandl cbb0ae4a42 #9354: Provide getsockopt() in asyncore file_wrapper(). Patch by Lukas Langa. 2010-07-28 08:19:35 +00:00
Giampaolo Rodolà 82e02b5876 Merged revisions 81294 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81294 | giampaolo.rodola | 2010-05-18 22:04:31 +0200 (mar, 18 mag 2010) | 1 line

  Fix issue #8573 (asyncore._strerror bug): fixed os.strerror typo; included NameError in the tuple of expected exception; added test case for asyncore._strerror.
........
2010-05-18 20:11:58 +00:00
Giampaolo Rodolà d61e397b12 Merged revisions 80880 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r80880 | giampaolo.rodola | 2010-05-06 21:56:34 +0200 (gio, 06 mag 2010) | 1 line

  provides a clearer warning message when cheap inheritance with the underlying socket object is used
........
2010-05-06 20:02:37 +00:00
Giampaolo Rodolà 8d2dc85154 Merged revisions 80875 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r80875 | giampaolo.rodola | 2010-05-06 19:57:06 +0200 (gio, 06 mag 2010) | 1 line

  Fix asyncore issues 8573 and 8483: _strerror might throw ValueError; asyncore.__getattr__ cheap inheritance caused confusing error messages when accessing undefined class attributes; added an alias for __str__ which now is used as a fallback for __repr__
........
2010-05-06 18:06:30 +00:00
Josiah Carlson 0abc64d719 This fixes bug 5798 on OS X.
This should also fix disconnect behavior cross-platform.
2009-06-03 19:48:02 +00:00
R. David Murray 78532baeab Merged revisions 70873,70904,70934,71490 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r70873 | josiah.carlson | 2009-03-31 15:32:34 -0400 (Tue, 31 Mar 2009) | 2 lines

  This resolves issue 1161031.  Tests pass.
........
  r70904 | josiah.carlson | 2009-03-31 17:49:36 -0400 (Tue, 31 Mar 2009) | 3 lines

  Made handle_expt_event() be called last, so that we don't accidentally read
  after closing the socket.
........
  r70934 | josiah.carlson | 2009-03-31 21:28:11 -0400 (Tue, 31 Mar 2009) | 2 lines

  Fix for failing asyncore tests.
........
  r71490 | r.david.murray | 2009-04-11 13:52:56 -0400 (Sat, 11 Apr 2009) | 4 lines

  Make test_asyncore tests match code changes introduced by the
  fix to Issue1161031, refactoring the test to simplify it in
  the process.
........
2009-04-12 15:35:44 +00:00
Josiah Carlson aae55cbab4 This fixes issue 4332 for Py3k. 2008-11-19 18:22:41 +00:00
Georg Brandl f112369463 Merged revisions 65152 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r65152 | georg.brandl | 2008-07-20 09:29:58 +0200 (Sun, 20 Jul 2008) | 2 lines

  Remove exception indexing in asyncore.
........
2008-07-20 07:31:30 +00:00
Josiah Carlson c31bc9a498 Fix for AttributeError in test_asynchat. 2008-07-11 22:18:27 +00:00
Josiah Carlson 9f2f83338f Fixed bugs 760475, 953599, and 1519. This is a translation of changelist 64768
to the py3k branch.
2008-07-07 05:04:12 +00:00
Josiah Carlson d74900ebb5 Committing Py3k version of changelist 64080 and 64257, along with updated tests
for smtpd, which required updating with the new semantics.
2008-07-07 04:15:08 +00:00
Georg Brandl 7357c23ee7 Fix exception slicing. 2008-01-06 18:23:30 +00:00
Georg Brandl 6464d47195 In followup to #1310: Remove more exception indexing. 2007-10-22 16:16:13 +00:00
Collin Winter ce36ad8a46 Raise statement normalization in Lib/. 2007-08-30 01:19:48 +00:00
Guido van Rossum df4a743ac0 Fix test_asyncore after merge. It needs to use bytes. 2007-07-18 20:57:44 +00:00
Guido van Rossum be19ed77dd Fix most trivially-findable print statements.
There's one major and one minor category still unfixed:
doctests are the major category (and I hope to be able to augment the
refactoring tool to refactor bona fide doctests soon);
other code generating print statements in strings is the minor category.

(Oh, and I don't know if the compiler package works.)
2007-02-09 05:37:30 +00:00
Guido van Rossum b940e113bf SF patch 1631942 by Collin Winter:
(a) "except E, V" -> "except E as V"
(b) V is now limited to a simple name (local variable)
(c) V is now deleted at the end of the except block
2007-01-10 16:19:56 +00:00
Guido van Rossum e2b70bcf74 Get rid of dict.has_key(). Boy this has a lot of repercussions!
Not all code has been fixed yet; this is just a checkpoint...
The C API still has PyDict_HasKey() and _HasKeyString(); not sure
if I want to change those just yet.
2006-08-18 22:13:04 +00:00
Neal Norwitz 4ce69a5b06 No need to import exceptions, they are builtins 2005-09-01 00:45:28 +00:00
Andrew M. Kuchling e47c381c62 [Bug #1011606] Only check file descriptors for exceptional conditions if the fd is readable or writable 2004-09-01 14:04:51 +00:00
Andrew M. Kuchling 9d499f2f96 Back out patch #982681 2004-08-13 20:06:57 +00:00
Tim Peters 182b5aca27 Whitespace normalization, via reindent.py. 2004-07-18 06:16:08 +00:00
Andrew M. Kuchling 5336f8caa4 [Patch #982681] Apply this patch correctly; makes set_reuse_addr() work on Windows 2004-07-15 16:17:07 +00:00
Andrew M. Kuchling 0fff6c8651 In poll(), check connections for exceptional conditions 2004-07-10 17:36:11 +00:00
Andrew M. Kuchling dfa74b97ec Return value from .close(); move .set_file up 2004-07-10 15:51:19 +00:00
Tim Peters 4e0e1b6a54 Whitespace normalization. 2004-07-07 20:54:48 +00:00
Andrew M. Kuchling 6fe93cdeb3 For readable() objects, the previous value of 'flags' was ignored.
Rearrange code for writable() case to make the parallel logic clearer
2004-07-07 12:23:53 +00:00
Michael W. Hudson d5cf143482 Check in the updated version of patch #957240, which doesn't rely
on the marshalling characteristics of infinities.
2004-06-30 09:02:33 +00:00
Martin v. Löwis ad21945d03 Back out #957240. 2004-06-14 04:58:42 +00:00
Martin v. Löwis eac324b90b Patch #957240: Add count parameter to asyncore.loop. 2004-06-03 09:18:35 +00:00
Andrew M. Kuchling 67867eaf8c [Part of patch #909005] Added map parameter for file_dispatcher and dispatcher_with_send 2004-03-21 20:03:18 +00:00
Andrew M. Kuchling 174bdbc999 [Part of patch #909005] Repeating exception changed from 'raise socket.error, why' to just raise. Make use of connect_ex() raise socket.error with 2-tuple instead of just error code 2004-03-21 19:58:28 +00:00
Andrew M. Kuchling 419af88b34 [Part of patch #909005] Remove Mac code for writable 2004-03-21 19:52:01 +00:00
Andrew M. Kuchling 0ebbbe30f1 [Part of patch #909005] Set initial poll flags 2004-03-21 19:50:09 +00:00
Andrew M. Kuchling 68522b1895 [Part of patch #909005] Use True/False 2004-03-21 19:46:16 +00:00
Andrew M. Kuchling 9303777f22 [Part of patch #909005] Handle POLLPRI flag, and various errors cases. Fixes bug #887279 2004-03-21 19:26:00 +00:00
Raymond Hettinger 3dc3484ac8 SF bug #892492: Multiple close() for asyncore.dispatcher.
(Contributed by Alexey Klimkin.)

Don't keep the file descriptor after the channel is deleted.
2004-02-08 11:32:50 +00:00
Andrew M. Kuchling 6c2871e707 [Part of patch #648322] Delete the poll2() function, which uses a 'poll' extension module that was once part of Medusa. Contributed by Kjetil Jacobsen 2003-10-22 14:38:27 +00:00
Andrew M. Kuchling f9ca409292 [Bug #758241] When you use asyncore with a non-default map, methods
of the dispatcher object break.  e.g. if you close() the object, it
  tries to remove itself from the default map, not from the map the
  dispatcher was created with.

  The patch, from Stephane Ninin, records the map as an attribute of
  the dispatcher instance.

2.3 bugfix candidate.
2003-10-22 13:48:27 +00:00
Walter Dörwald f0dfc7ac5c Fix a bunch of typos in documentation, docstrings and comments.
(From SF patch #810751)
2003-10-20 14:01:56 +00:00
Andrew M. Kuchling c07fb2fc5b Fix comment typo 2003-02-14 01:13:01 +00:00
Guido van Rossum 9a40c1c299 Add XXX about Winsock error values 2002-12-26 18:22:54 +00:00
Guido van Rossum e94d8fab56 Fix an old bug in poll(). When a signal is handled while we're
blocked in select(), this will raise select.error with errno set to
EINTR.  The except clauses correctly ignores this error, but the rest
of the logic will then call read() for all objects in select's *input*
list of read file descriptors.  Then when an object's read_handler()
is naive, it will call recv() on its socket, which will raise an
IOError, and then asyncore decides to close the socket.  To fix this,
we simply return in this case.

Backport candidate.
2002-11-05 18:41:20 +00:00
Thomas Heller 6d817ad43d Again, I did check in too many changes. Sorry. 2002-09-26 13:19:48 +00:00
Thomas Heller d8ce87ad84 On Windows, select() does not accept empty lists.
Patch suggested by Guido, fixes SF item 611464.

Bugfix candidate, will backport to release22-maint myself.
2002-09-24 17:30:31 +00:00
Guido van Rossum 12e9668989 Fiddle with compact_traceback().
More whitespace cleanup.
2002-09-13 14:09:26 +00:00
Guido van Rossum d560ace3a7 I don't think it's safe to use map.iteritems() in the various poll
routines.  I got some errors "dictionary changed size during
iteration" when running ZEO tests on machine while doing heavy
forground work in another window, and thinking about it, I believe
that it should be okay if readable() or writable() modifies the map.

I also finally made all the spacing conform to the Python style guide:
no space between a function/method name and the following left
parenthesis (fixed lots of occurrences), spaces around assignment
operators (fixed a few, always of the form "map=..."), and a blank
line between the class statement and the first method definition (a
few).
2002-09-12 04:57:29 +00:00