[issue25910] Fixing links in documentation

2017-12-06 Thread Jim Fulton

Change by Jim Fulton <j...@jimfulton.info>:


--
nosy:  -j1m

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue25910>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27391] server_hostname should only be required when checking host names

2017-09-17 Thread Jim Fulton

Jim Fulton added the comment:

OMG, >1year. :)

This was always a minor issue.  I still think the current asyncio behavior is 
dumb, but whatever.

FWIW, I tripped on this when adding SSL support to ZEO, which is a 
client-server *database* protocol used by ZODB, having nothing to do with the 
Web. In this context, the client and server are well known to each other and 
share certs.

--
stage:  -> resolved
status: open -> closed

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue27391>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31280] Namespace packages in directories added to path aren't importable if packages from the same namespace are in site-packages

2017-08-26 Thread Jim Fulton

Jim Fulton added the comment:

See: https://github.com/pypa/pip/issues/4695

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue31280>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31280] Namespace packages in directories added to path aren't importable if packages from the same namespace are in site-packages

2017-08-26 Thread Jim Fulton

Jim Fulton added the comment:

Wow, OK. It didn't occur to me to look for .pth files. (Buildout doesn't use 
them.)  I guess this is a pip bug or misfeature.  I'll head over to pypa.

Thanks!

--
stage:  -> resolved
status: open -> closed

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue31280>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31280] Namespace packages in directories added to path aren't importable if packages from the same namespace are in site-packages

2017-08-25 Thread Jim Fulton

Jim Fulton added the comment:

No, but I managed to unattach it, because "Choose File" always feels like a 
submit button to me.

Sorry.

Attached.

--
Added file: http://bugs.python.org/file47101/z.py

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue31280>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31280] Namespace packages in directories added to path aren't importable if packages from the same namespace are in site-packages

2017-08-25 Thread Jim Fulton

New submission from Jim Fulton:

I'm having an issue importing from namespaces packages whose directories are 
added to sys.path and have other packages from the same namespace in 
site-packages.

To reproduce:

- Create a virtualenv and install zc.buildout in it (``envdir/bin/pip install 
zc.buildout``).

- Run the attached script with the virtual environment (``envdir/bin/python 
z.py``).

Note that scenarios like https://www.python.org/dev/peps/pep-0420/#id3 work 
fine.  This seems to related to having namespace packages in site-packages, or, 
presumably anywhere on the default path.

I've verified this with Python 3.4, 3.5, and 3.6.

If y'all agree that this is a bug, then I'll attempt debug it and come up with 
a PR.

--
messages: 300856
nosy: j1m
priority: normal
severity: normal
status: open
title: Namespace packages in directories added to path aren't importable if 
packages from the same namespace are in site-packages
versions: Python 3.4, Python 3.5, Python 3.6

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue31280>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25910] Fixing links in documentation

2017-06-05 Thread Jim Fulton

Jim Fulton added the comment:

+1

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25910>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25910] Fixing links in documentation

2017-06-03 Thread Jim Fulton

Jim Fulton added the comment:

Zope Corporation no longer exists. Any references to it should be in the past 
tense and without a link.

(The http://www.zope.org is for the Zope Foundation, which is a different 
thing.)

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25910>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-09-26 Thread Jim Fulton

Jim Fulton added the comment:

This is arguably a security issue because it's a DoS vector.

I don't feel strongly about it though.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27386>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-09-17 Thread Jim Fulton

Jim Fulton added the comment:

Yes, that change addresses this issue. Thanks!

Will this be backported?

--
resolution:  -> fixed

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27386>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27391] server_hostname should only be required when checking host names

2016-09-16 Thread Jim Fulton

Jim Fulton added the comment:

I'm not ignoring anything AFAICT.

There are applications where server hostname isn't useful (no virtual hosts, 
client has server's public key).

I'm not positive we're disagreeing, so let me put this another way.

1. If the given SSL context has check_hostname set to False,
   then ``create_connection`` should not not require a value for
   ``server_hostname``, regardless of the value of ``host``.

   Do you agree?

2. If the given SSL context has check_hostname set to True,
   then ``create_connection`` should not accept an empty string
   to disable hostname checks.

   Do you agree? I'm wondering is this is what you're referring to
   as a bug.

   Personally, this only bothers me from a TOOWTDI perspective.
   I can imagine (always a dangerous word :)) people wanting to 
   reuse an SSL context but disable host name checking. In any case,
   "fixing" this would likely be a breaking change.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27391>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-09-16 Thread Jim Fulton

Jim Fulton added the comment:

Cool, I will verify soon.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27386>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27391] server_hostname should only be required when checking host names

2016-09-15 Thread Jim Fulton

Jim Fulton added the comment:

SSL is used for more than just HTTP.  The are applications in which clients 
have server public keys that they use to authenticate servers rather than using 
certificate authorities.  For these applications, server host names are 
irrelevant.  This is why it makes sense to have an option on the SSL context to 
disable host name checking.  Removing this ability would break some 
applications.

If the option to check host names is provided as false on the SSL context, it 
makes no sense to check whether the host name, which isn't going to be used, is 
not None.  It's just silly, but not a huge deal one way or the other, because 
there are actually *two* ways to disable host name checking; you can also pass 
'' as the hostname, which is why this isn't a big deal and why I haven't gotten 
around to making a PR yet.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27391>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27392] Add a server_side keyword parameter to create_connection

2016-08-09 Thread Jim Fulton

Jim Fulton added the comment:

+1 restricting uvloop to AF_INET or AF_UNIX and SOCK_STREAM, at least until 
someone requests something else.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27392>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27392] Add a server_side keyword parameter to create_connection

2016-08-09 Thread Jim Fulton

Jim Fulton added the comment:

WRT boolean for SSL, I think it's very common for clients to verify server 
certificates, but relatively uncommon for servers to require client 
certificates.  The impression I have from reading docs and stack overflow posts 
that the most common use case for the SSL module is connection to HTTPS sites. 
For this use case, using a default context makes a lot of sense.

It seems extremely unlikely to me for a server to use a default context.

But I'm not an SSL expert.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27392>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27392] Add a server_side keyword parameter to create_connection

2016-08-08 Thread Jim Fulton

Jim Fulton added the comment:

idk if the patch got merged.

I just added the last comment for informational purposes. :)

Perhaps this issue can be closed.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27392>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27392] Add a server_side keyword parameter to create_connection

2016-08-07 Thread Jim Fulton

Jim Fulton added the comment:

FTR another use case for this. :)

We have a ZEO applications where individual database users authenticate via 
self-signed certs. The server's SSL connection has to have this collection of 
certs. User CRUD operations can add and remove certs to authenticate against.  
SSL contexts don't provide an API for removing (or even clearing) CAs used for 
authentication, so we need to create new SSL contexts when the set of valid 
certs change.  There's no way to update the SSL context used by a server, so 
we're wrapping accepted sockets ourselves, so we can use dynamic SSL contexts.

Some alternatives:

- Add an SSLContext API for removing or clearing CAs

- Add a Server API to update the SSL context used for new connections.  (I may 
pursue this at some point. I spent a few minutes trying to find where a 
Server's SSL context is stored, but failed and can't spend more time ATM.)

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27392>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27392] Add a server_side keyword parameter to create_connection

2016-07-18 Thread Jim Fulton

Jim Fulton added the comment:

Does the draft doc change look OK?

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27392>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27392] Add a server_side keyword parameter to create_connection

2016-07-14 Thread Jim Fulton

Jim Fulton added the comment:

Here's a daft doc update.

--
keywords: +patch
Added file: http://bugs.python.org/file43718/connect_accepted_socket-doc.patch

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27392>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27392] Add a server_side keyword parameter to create_connection

2016-07-09 Thread Jim Fulton

Jim Fulton added the comment:

> Why can't `wrap_socket` be used for wrapping client sockets? 

TOOWTDI and create_connection.  

I suppose we could remove (unadvertise) this functionality from 
create_connection.  Then we'd have code bloat because backward compatibility.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27392>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27392] Add a server_side keyword parameter to create_connection

2016-07-09 Thread Jim Fulton

Jim Fulton added the comment:

We need an executive (Guido) decision on the name of the new API. Yury wants 
wrap_socket.

I don't like wrap_socket because:

- It implies that it's for wrapping client and server sockets.
  (It shouldn't be for wrapping client sockets because TOOWTDI
   and create_connection.)

- I prefer names that are about goal rather than mechanism.

But I can live with anything.

I'll defer to Yury unless Guido voices an opinion.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27392>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27392] Add a server_side keyword parameter to create_connection

2016-07-09 Thread Jim Fulton

Jim Fulton added the comment:

I'd still like to find a way to handle already accepted server sockets.

Can we decide on either:

- a server_side flag to create_connection or

- A new interface for handling an already accepted socket? I would
  call this handle_connection, but I'll take any name. :)

I'm fine with and willing to implement either alternative.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27392>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27456] TCP_NODELAY

2016-07-07 Thread Jim Fulton

Jim Fulton added the comment:

I missed the point that you can get a transport's socket using get_extra_info. 
IMO, this provides an adequate escape from the default and qualifies as a 
"proper way to set it".

I still think the default should be to enable TCP_NODELAY.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27456>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-07-06 Thread Jim Fulton

Changes by Jim Fulton <j...@jimfulton.info>:


--
type: behavior -> security

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27386>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27456] TCP_NODELAY

2016-07-05 Thread Jim Fulton

Jim Fulton added the comment:

Yury, I'd be fine with you making a PR. :)

Is there a similar update that can be made to uvloop?

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27456>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27456] TCP_NODELAY

2016-07-05 Thread Jim Fulton

Jim Fulton added the comment:

I forgot to switch to the asyncio branch of ZEO when testing on the 
Amazon/RedHat linux. When I do, the tests run slow there too. Asyncio is dog 
slow on every linux I've tried.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27456>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27456] TCP_NODELAY

2016-07-05 Thread Jim Fulton

Jim Fulton added the comment:

Gaaa, forgot to set meta data.

--
components: +asyncio
nosy: +gvanrossum, haypo, yselivanov
type:  -> performance
versions: +Python 3.4, Python 3.5

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27456>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27456] TCP_NODELAY

2016-07-05 Thread Jim Fulton

New submission from Jim Fulton:

tl;dr TCP_NODELAY should be set by default and/or there should be a
  proper way to set it.

I've ported ZEO, ZODB's client-server networking layer to asyncio.
Things were going pretty well.  I've been developing on a
Mac. Yesterday, I ran some performance measurements on Linux and found
some tests ran 30x slower.

After some digging, I came across this:

https://github.com/python/asyncio/issues/311

Then led me to try setting TCP_NODELAY, which provided Linux
performance comparable to Mac OS performance.

Issue 311 suggested that this was a kernal-version issue.  I think
this is a failure to set, or at least provide a way to set a "don't be
stupid" option.

I originally tried this on Ubuntu 14.04, with kernal
3.13.0-74-generic.  I then tried Ubuntu 16.04, in a docker image, with
kernal 4.4.12-boot2docker. For both of these, performance for the
write tests were 30x slower unless I set TCP_NODELAY.

Finally, I tried an Amazon standard AMI, which runs some version of
RedHat, with kernal 4.4.11-23.53.amzn1.x86_64.  On that system,
performance of the tests was similar to Mac OS X without setting
TCP_NODELAY.

Note that the non-slow kernal version was lower than the slow (Ubuntu)
one. I don't think this is mearly a kernal version issue, nor do I
think this should have been dismissed as one.

I couldn't find a way to set TCP_NODELAY cleanly. Did I miss something?
https://github.com/python/asyncio/issues/286 suggests there isn't one.

I ended up having to set the option on _sock transport attributes,
which is dirty and, I assume, won't work with uvloop. (BTW, uvloop was
only ~15x slower on linux systems with this problem.)

I think TCP_NODELAY should be set by default.  Perhaps it shouldn't be
set on mobile, by everywhere else, I think it's a "don't be stupid"
option.

I also think there should be a way to set it cleanly.

IMO, this is extremely important. Linux is a wildly important platform
for networking applications and Python, and, for better or worse,
Ubuntu is a very commonly used distribution.  Having asyncio, perform
so poorly on these platforms is a big deal.

--
messages: 269826
nosy: j1m
priority: normal
severity: normal
status: open
title: TCP_NODELAY

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27456>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27392] Add a server_side keyword parameter to create_connection

2016-06-29 Thread Jim Fulton

Jim Fulton added the comment:

:)

I'm not a fan of monkey patching code in production, unless the code I'm monkey 
patching is code I control. (And since releasing code now is a lot easier than 
it used to be, I have much less occasion to monkey-patch code I control.)

(I'm a big fan of and am also terrified by gevent and I generally avoid it's 
use of monkey patching.)

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27392>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27392] Add a server_side keyword parameter to create_connection

2016-06-29 Thread Jim Fulton

Jim Fulton added the comment:

With SSL, the protocol is a little different clients and servers, although that 
may just be in the handshake. I'm no SSL expert by any means.  When you call 
wrap_socket on an SSLContext, you can pass server_side, which defaults to 
False. If you get this wrong, you end up with an SSL protocol error.

FWIW, here's my awful monkey patch to work around this experimentally in ZEO:

https://github.com/zopefoundation/ZEO/pull/32/commits/daca97cb4292ad9a316a1924960a5fbf54d3622b#diff-248404a51b1503a38c3319c85e6c1c5aR174

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27392>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-06-29 Thread Jim Fulton

Jim Fulton added the comment:

WRT CPython/sockets this problem doesn't happen if I use asyncore to accept 
connections and hand them off to create_connection. :)

It also doesn't occur with uvloop, which I assume still uses sockets.

Also, FWIW, the relevant ZEO test passes if I use SSL, which is how I'm working 
around this now for the tests.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27386>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-06-29 Thread Jim Fulton

Jim Fulton added the comment:

Yuri, right you are. Thanks.

Марк, see https://bugs.launchpad.net/zodb/+bug/135108/comments/9

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27386>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27392] Add a server_side keyword parameter to create_connection

2016-06-29 Thread Jim Fulton

Jim Fulton added the comment:

Sorry, ignore my last message

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27392>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27392] Add a server_side keyword parameter to create_connection

2016-06-29 Thread Jim Fulton

Jim Fulton added the comment:

See: https://bugs.launchpad.net/zodb/+bug/135108/comments/9

Sorry, I should have sent that link sooner. In my flailing to come up with a 
simple case, I forgot the importance of that setting.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27392>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27392] Add a server_side keyword parameter to create_connection

2016-06-29 Thread Jim Fulton

Jim Fulton added the comment:

>> Yury, I'm curious what you think the socket argument to create_connection is 
>> about.
>
> :)  The current intended purpose of create_connection is to create a client 
> connection.  You're proposing to add a new argument -- server_side -- which I 
> think will confuse the users of create_connection.

Perhaps. I'll note that the word "client" appears nowhere in the documentation 
of create_connection. I needed a way to wrap a socket and create_connection 
took one. Wrapping a server socket seemed to be to be the most likely use case 
for it. 



>
> What I'm saying is that we may consider creating a low-level 
> loop.wrap_socket, which would be generic and suitable to be used for both 
> client and server connections.  We could even refactor create_connection to 
> use wrap_socket when 'sock' argument is passed to it.
>
> We already have something similar, although it's a private API -- 
> _make_socket_transport.

Right. That's what I'm monkey-patching now to work around this, mostly as an 
experiment.

>
>> BTW, a problem with this proposal that I realized after submitting it is 
>> that it changes an API that has multiple implementations, including 
>> implementations outside of the Python codebase.  Arguably, this would 
>> require a PEP, at which point the change is no-longer trivial. :)
>
> No need for a PEP; Guido's approval is enough usually.

/me holds breath

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27392>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-06-29 Thread Jim Fulton

Jim Fulton added the comment:

Here's a version sans prints

--
Added file: http://bugs.python.org/file43581/echo-no-print.py

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27386>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-06-29 Thread Jim Fulton

Changes by Jim Fulton <j...@jimfulton.info>:


Removed file: http://bugs.python.org/file43540/echo.py

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27386>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27392] Add a server_side keyword parameter to create_connection

2016-06-29 Thread Jim Fulton

Jim Fulton added the comment:

BTW, a problem with this proposal that I realized after submitting it is that 
it changes an API that has multiple implementations, including implementations 
outside of the Python codebase.  Arguably, this would require a PEP, at which 
point the change is no-longer trivial. :)

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27392>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27392] Add a server_side keyword parameter to create_connection

2016-06-29 Thread Jim Fulton

Jim Fulton added the comment:

Yury, I'm curious what you think the socket argument to create_connection is 
about.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27392>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27391] server_hostname should only be required when checking host names

2016-06-29 Thread Jim Fulton

Jim Fulton added the comment:

OK, sure, I'll make a PR.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27391>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27391] server_hostname should only be required when checking host names

2016-06-29 Thread Jim Fulton

Jim Fulton added the comment:

No need to apologize!  My capitulation was just due to the fact that this isn't 
a big deal. (My tone probably came across as cranky; sorry)

WRT backward compatibility, I suspect that there's a bit of wiggle here between 
loop implementations and I doubt this would be noticed. For example, uvloop 
errors if you pass None for both server_hostname and ssl. 

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27391>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27391] server_hostname should only be required when checking host names

2016-06-29 Thread Jim Fulton

Jim Fulton added the comment:

Consider this a suggestion. Do with it what you will. I'm closing this as I 
don't want to spend more time on it other than creating a PR if requested.

--
status: open -> closed

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27391>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27391] server_hostname should only be required when checking host names

2016-06-29 Thread Jim Fulton

Jim Fulton added the comment:

I'm not sure I understand your question.

The documentation for create_connection, 
https://docs.python.org/3/library/asyncio-eventloop.html#creating-connections 
states that server_hostname is required if the host is empty. (I'm generalizing 
"empty" to include None.)

SSL contexts, https://docs.python.org/3/library/ssl.html#ssl-contexts,
have an attribute, check_hostname, which controls whether hostname checking is 
required. If set to false in a context passed to create_connection, then it 
makes no sense to require server_hostname under any circumstances.

Note that this is easy to work around by passing an empty string, it just seems 
pointless to make people do that if you're already controlling this via the SSL 
context.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27391>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27392] Add a server_side keyword parameter to create_connection

2016-06-29 Thread Jim Fulton

Jim Fulton added the comment:

I agree that if create_server (or asyncio.Server) is buggy, it should be fixed!

However, IMO, it's useful to be able to accept a connection outside of an 
asyncio event loop and then hand the loop the connected socket.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27392>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27392] Add a server_side keyword parameter to create_connection

2016-06-29 Thread Jim Fulton

Jim Fulton added the comment:

Guido, IMO, there's value in having the ability to accept connections 
independently of handling them.

It wasn't clear to me from reading the documentation that create_connection is 
only meant for making client connections, especially given that it can take an 
already connected socket.  It works well for non-SSL server sockets and would 
work for SSL with a trivial change.

This issue was discussed on the tulip list or issue tracker a couple of years 
ago. (Sorry, I can't find the link ATM.) I think it was dismissed because no 
one felt like looking into it and because you asserted that it makes no sense 
to use an async library when handling each connection in a separate thread.

IMO, async loop is useful even for a single connection when reading and writing 
are not purely synchronous. In ZEO it's very useful that that the server can 
send data to a client independent of requests the client is making.  
(Technically, under the hood this often means that there are really 2 I/O 
channels, the client's TCP connection and whatever mechanism the loop uses to 
allow itself to be woken asynchronously as in call_soon_threadsafe.)

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27392>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27392] Add a server_side keyword parameter to create_connection

2016-06-29 Thread Jim Fulton

Jim Fulton added the comment:

Tests are also unstable with uvloop. (Although uvloop doesn't have 
http://bugs.python.org/issue27386 at least.)

I was eventually able to wrestle the test into submission using asyncio.Server. 
I suspect that some of this had to do with issues closing connections at the 
end of tests.  I made my close logic more paranoid and that *seemed* to help.  
Some of the instability was due to test bugs that were activated by the 
different timing characteristics of using asyncio.Server.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27392>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-06-29 Thread Jim Fulton

Jim Fulton added the comment:

This is already pretty minimal. There are no external dependencies.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27386>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27391] server_hostname should only be required when checking host names

2016-06-29 Thread Jim Fulton

Jim Fulton added the comment:

It's not bug, it's a misfeature, IMO.

If you pass an SSL context and either don't pass a hostname or pass an empty 
string, then server_hostname is required, even if check_hostname is false for 
the context.

The fix is trivial. I'd be happy to provide a PR.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27391>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27392] Add a server_side keyword parameter to create_connection

2016-06-26 Thread Jim Fulton

New submission from Jim Fulton:

The event loop create_connection method can take a socket to create a 
connection on an existing socket, including sockets obtained via an external 
listener.  If an SSL context is provided, however, it assumes it's creating a 
client connection, making it impossible to use it in a server.

I've recently ported ZEO to asyncio. My original implementation used a separate 
thread for each connection and a thread for listening for connections.  I think 
there are cases where this makes a lot of sense.  Blocky operations only affect 
one client and, IMO, using an asynchronous model can simplify networking code 
even when there's only one connection. Unfortunately, this didn't work on Linux 
with SSL due to issues with SSL and non-blocking sockets. (Oddly, it worked 
fine on Mac OS X.)

I've switched my code to use create_server, but this has led to stability 
problems.  Beyond http://bugs.python.org/issue27386, I'm seeing a lot of test 
instability.  I can't get through the ZEO tests without some test failing, 
although the tests pass when run individually. I suspect that this is due to a 
problem in my error handling, asyncio's error handling, or likely both.

Note that the ZEO test suite is pretty ruthless, doing whatever they can to 
break ZEO servers and clients.

I have a version of my multi-threaded code that monkey-patches loop instances 
to pass server_side=True to _make_ssl_transport.  With that awful hack, I can 
use an external listener and tests usually run without errors. :)

I'd be more than happy to create a PR that adds this option (including test and 
docs). Please just give me the word. :)

--
components: asyncio
messages: 269293
nosy: gvanrossum, haypo, j1m, yselivanov
priority: normal
severity: normal
status: open
title: Add a server_side keyword parameter to create_connection
type: enhancement
versions: Python 3.4, Python 3.5, Python 3.6

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27392>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27391] server_hostname should only be required when checking host names

2016-06-26 Thread Jim Fulton

New submission from Jim Fulton:

If the given ssl context has check_hostname set to False, then the 
server_hostname shouldn't be required.

--
components: asyncio
messages: 269292
nosy: gvanrossum, haypo, j1m, yselivanov
priority: normal
severity: normal
status: open
title: server_hostname should only be required when checking host names
type: behavior
versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27391>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-06-25 Thread Jim Fulton

New submission from Jim Fulton:

I recently ported ZEO to asyncio.

We'd had a bug in our old asyncore-based server where the server would hang if 
several connections were made and then immediately disconnected on Mac OS X.  
This was due to an error-handling bug in our code that we fixed.  We have a 
regression test for this case.

The regression test for this case fails using asyncio.Server.

I've attached a (ZEO-independent) script that demonstrates the problem.

If you run the script with Python 3.4 or 3.5, I expect the script will hang. It 
does for me on Mac OS X 10.10.5 and Ubuntu 14.04.

--
components: asyncio
files: echo.py
messages: 269256
nosy: gvanrossum, haypo, j1m, yselivanov
priority: normal
severity: normal
status: open
title: Asyncio server hang when clients connect and immediately disconnect
type: behavior
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file43540/echo.py

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27386>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14279] packaging.pypi should support flat directories of distributions

2012-03-15 Thread Jim Fulton

Jim Fulton j...@zope.com added the comment:

Note that ala a directory of files wasn't meant to imply local files.
It could be a directory of files served via a HTTP (or sftp) server.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14279
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14280] packaging.pypi should not require checksums

2012-03-15 Thread Jim Fulton

Jim Fulton j...@zope.com added the comment:

I just clarified that 14279 doesn't imply local files.

I'd be fine with a warning about lack of checksums for downloads.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14280
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14279] simple indexes (in wrappers) should support flat directories of distributions

2012-03-12 Thread Jim Fulton

New submission from Jim Fulton j...@zope.com:

Currently, distutils2.pypi.wrapper has a notion of a simple index, which has 
subdirectories for each project as pypi/simple does. This is good.  It should 
also support flat indexes ala a directory of files.

--
assignee: eric.araujo
components: Distutils2
messages: 155537
nosy: alexis, eric.araujo, j1m, tarek
priority: normal
severity: normal
status: open
title: simple indexes (in wrappers) should support flat directories of 
distributions

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14279
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14280] simple indexes (in wrappers) should not require md5 hashes

2012-03-12 Thread Jim Fulton

New submission from Jim Fulton j...@zope.com:

Requiring md5s makes it hard to implement simple indexes with simple web 
servers, where simple indexes include flat directories of distributions.

--
assignee: eric.araujo
components: Distutils2
messages: 155542
nosy: alexis, eric.araujo, j1m, tarek
priority: normal
severity: normal
status: open
title: simple indexes (in wrappers) should not require md5 hashes

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14280
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9736] doctest.DocTestSuite doesn't handle test globs correctly

2010-11-02 Thread Jim Fulton

Jim Fulton j...@zope.com added the comment:

On Tue, Nov 2, 2010 at 5:55 PM, Éric Araujo rep...@bugs.python.org wrote:

 Éric Araujo mer...@netwok.org added the comment:

 Would you like to work on a patch?

Sure.

Jim

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9736
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9734] ABC issubclass/isinstance leaks in Python 2

2010-09-01 Thread Jim Fulton

New submission from Jim Fulton j...@zope.com:

I assume ABCs use some sort of cache for issubclass checks.

I also assume the cache doesn't use weakrefs, leading to leaks in classes 
created on the fly (as is common in tests).

The attached script demonstrates the leak.

The leak doesn't seem to occur in Python 3.1.2.

--
files: abc_issubclass_leak.py
messages: 115323
nosy: j1m
priority: normal
severity: normal
status: open
title: ABC issubclass/isinstance leaks in Python 2
versions: Python 2.6, Python 2.7
Added file: http://bugs.python.org/file18703/abc_issubclass_leak.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9734
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9736] doctest.DocTestSuite doesn't handle test globs correctly

2010-09-01 Thread Jim Fulton

New submission from Jim Fulton j...@zope.com:

We often run test suites repeatedly using a debug build of python
to look for memory leaks.

We also got in the bad habit of using a fork of doctest. Recently, we've 
switched away from our fork and have noticed a problem with the standard 
doctest's handling of test globs (globals).

DocTestSuite gets an initial set of globals from the module the doctest's came 
from.  After running the tests, it seems to clear these, leading to errors if 
the tests are run again.

I've attached a script that illustrates the problem.  The script runs a simple 
test twice and gets a spurious failure the second time.

--
components: Library (Lib)
files: doctest_DocTestSuite_globs_breakage.py
messages: 115326
nosy: j1m
priority: normal
severity: normal
status: open
title: doctest.DocTestSuite doesn't handle test globs correctly
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1
Added file: 
http://bugs.python.org/file18704/doctest_DocTestSuite_globs_breakage.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9736
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9220] Modules no longer usable as context managers

2010-07-10 Thread Jim Fulton

New submission from Jim Fulton j...@zope.com:

In python 2.7 a module can't be used as a context manager.

For example, given the module, t.py:

def __enter__(*args):
print 'enter', args

def __exit__(*args):
print 'exit', args

In Python 2.6:

 import t
 with t: pass
... 
enter ()
exit (None, None, None)

In Python 2.7:

 import t
 with t: pass
... 
Traceback (most recent call last):
  File stdin, line 1, in module
AttributeError: __exit__

--
components: Interpreter Core
messages: 109920
nosy: j1m
priority: normal
severity: normal
status: open
title: Modules no longer usable as context managers
type: behavior
versions: Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9220
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9220] Modules no longer usable as context managers

2010-07-10 Thread Jim Fulton

Jim Fulton j...@zope.com added the comment:

On Sat, Jul 10, 2010 at 4:08 PM, Éric Araujo rep...@bugs.python.org wrote:

 Éric Araujo mer...@netwok.org added the comment:

 Confirmed: http://docs.python.org/reference/datamodel#specialnames
 Closing. Sorry! (BTW, using import hackery and a custom module type, you 
 could achieve your goal.)

Yes, I'll have to use a custom module type and import hackery to get
code that worked before working again in Python 2.7.

Jim

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9220
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8501] --dry-run option doesn't work

2010-04-22 Thread Jim Fulton

New submission from Jim Fulton j...@zope.com:

The --dry-run option is ignored by the install command.
It leads to an error when used as a global option.

It should be fixed or removed.  I vote for removal, but don't really care. 
Removal seems easier. :)

To reproduce, create the simple project:

  http://docs.python.org/distutils/introduction.html#a-simple-example

and then try the option.

See also:

  http://mail.python.org/pipermail/distutils-sig/2010-April/016000.html

--
assignee: tarek
components: Distutils
messages: 103979
nosy: j1m, tarek
severity: normal
status: open
title: --dry-run option doesn't work
type: behavior
versions: Python 2.5, Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8501
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7372] Regression in pstats

2010-01-26 Thread Jim Fulton

Jim Fulton j...@zope.com added the comment:

On Mon, Jan 25, 2010 at 7:35 PM, Ezio Melotti rep...@bugs.python.org wrote:

 Ezio Melotti ezio.melo...@gmail.com added the comment:

 See also #7372.

 AFAIU add_callers can receive either a tuple or an int (and this is what is 
 not working now). When I looked at #7372 I wasn't able to find out why it 
 might receive two different objects and not always the same (i.e. always a 
 tuple, possibly with only one int). From the first message it seems that 
 cProfile returns the tuple of 4 ints and profile returns a single int.
 Can profile be fixed to return a tuple (of 4 or 1 ints) too?

Ah interesting.  I ran into this recently when I noticed that some
analysis tools I'd written a while back no longer worked and had to be
updated because data that were ints were now tuples.

Aside from these particular issues, it would be really great if the
profiler stats data structure was specified. :)

Jim

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7372
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6710] hotshot stats load causes TypeError when multiple files are loaded

2009-08-15 Thread Jim Fulton

New submission from Jim Fulton j...@zope.com:

I've attached a script that demonstrates the problem.  When run with
Python 2.5, it outputs statistics.  When run with Python 2.6.2 it
generates a TypeError:

python2.6 hotshotbug.py
Traceback (most recent call last):
  File hotshotbug.py, line 5, in module
stats.add(hotshot.stats.load('p2'))
  File /usr/local/python/2.6/lib/python2.6/pstats.py, line 171, in add
self.stats[func] = add_func_stats(old_func_stat, stat)
  File /usr/local/python/2.6/lib/python2.6/pstats.py, line 516, in
add_func_stats
add_callers(t_callers, callers))
  File /usr/local/python/2.6/lib/python2.6/pstats.py, line 526, in
add_callers
zip(caller, new_callers[func])])
TypeError: zip argument #1 must support iteration

--
components: Library (Lib)
files: hotshotbug.py
messages: 91619
nosy: j1m
severity: normal
status: open
title: hotshot stats load causes TypeError when multiple files are loaded
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file14734/hotshotbug.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6710
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6710] hotshot stats load causes TypeError when multiple files are loaded

2009-08-15 Thread Jim Fulton

Jim Fulton j...@zope.com added the comment:

Fred might be interested. :)

--
nosy: +fdrake

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6710
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1641] asyncore delayed calls feature

2009-04-02 Thread Jim Fulton

Jim Fulton j...@zope.com added the comment:

 Looking back, I think Zope and Medusa should have adopted and evolved
 their own copy of asynchat a long time ago...

This statement is puzzling.  No big deal, but I'm curious why you say
this.

--
nosy: +j1m

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1641
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1641] asyncore delayed calls feature

2009-04-02 Thread Jim Fulton

Jim Fulton j...@zope.com added the comment:

For the record, afaict, Zope wasn't broken by this. Supervisor isn't
part of Zope.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1641
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1641] asyncore delayed calls feature

2009-04-02 Thread Jim Fulton

Jim Fulton j...@zope.com added the comment:

On Apr 2, 2009, at 1:27 PM, Guido van Rossum wrote:


 Guido van Rossum gu...@python.org added the comment:

 [Guido]
 Looking back, I think Zope and Medusa should have adopted and  
 evolved
 their own copy of asynchat a long time ago...

 [Jim]
 This statement is puzzling.  No big deal, but I'm curious why you say
 this.

 ISTR that Zope has or had significant monkeypatches to at least one of
 asyncore/asynchat.

Not that I'm aware of.  I did add the ability to pass in alternative  
map objects, which is the only change we needed that I'm aware of. I  
think I made that change before or soon after asyncore was added to  
the standard library.

 The resulting coupling between Zope and asyn* has
 meant that the de-facto API of asyn* was much more than the documented
 API.

If we were monkey patching it, it would be at our own risk, which is  
why we'd copy the module if we needed to.  That has its own problems  
of course. I rue the day I forked doctest. :(

 IMO that's a sign of a poorly designed API (in asyn*). If Zope
 had had its own copy of asyn* (under a different name of course) that
 relied only on lower-level APIs (sockets and select), it could have
 evolved that copy directly without the need for monkeypatching.

I've read a good argument that subclassing across implementation  
packages is a bad idea. If a framework offers features through  
subclassing, it should define the subclassing interface very  
carefully, which asyncore doesn't.

Jim

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1641
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1641] asyncore delayed calls feature

2009-04-02 Thread Jim Fulton

Jim Fulton j...@zope.com added the comment:

On Apr 2, 2009, at 3:35 PM, Josiah Carlson wrote:


 Josiah Carlson josiahcarl...@users.sourceforge.net added the  
 comment:

 I'm not defending the documentation, I'm merely reposting it.

 The documentation for asyncore says, The full set of methods that can
 be overridden in your subclass follows:

 The documentation for asynchat says, To make practical use of the  
 code
 you must subclass async_chat, providing meaningful
 collect_incoming_data() and found_terminator() methods. The
 asyncore.dispatcher methods can be used, although not all make sense  
 in
 a message/response context.

 How can we make the documentation better?  I'm too close to the
 documentation to really know how to improve it.  Ideas?

Actually, the documentation is better than I remember it to be. The  
problem is that subclassing is a much more intimate interface between  
components that a call interface.  In the case of asyncore, the  
methods being overridden have non-trivial default implementations.  
Overriding methods often entails studying the base-class code to get  
an idea how it should be done. The subclassing interface for asynchat  
appears to be much cleaner, but even then, you need to study the base  
class code to make sure you haven't accidentally overridden any base  
class attributes.  I wish classes that exposed subclassing interfaces  
were more careful with their internal names.

Jim

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1641
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com