Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extending compatiblity with older asyncore/python versions #16

Closed
giampaolo opened this issue May 28, 2014 · 10 comments
Closed

Extending compatiblity with older asyncore/python versions #16

giampaolo opened this issue May 28, 2014 · 10 comments
Labels
Component-Library enhancement imported imported from old googlecode site and very likely outdated

Comments

@giampaolo
Copy link
Owner

From billiej...@gmail.com on July 10, 2007 03:35:34

By using Python versions prior to 2.4 pyftpdlib fails starting on systems
where poll() is not available.

<snippet>
Traceback (most recent call last):
   File "/ffs/lib/python2.3/site-packages/pyftpdlib/FTPServer.py", line
1206, in serve_forever
    asyncore.loop(timeout=1, use_poll=True)
  File "/tgtsvr/lib/python2.3/asyncore.py", line 193, in loop
  File "/tgtsvr/lib/python2.3/asyncore.py", line 128, in poll2
ImportError: No module named poll
</snippet>

This does not happen with newer asyncore versions (included with Python 2.4
and higher) which first check if poll() is available or not, in which case
select() is silently used.
Instead of telling asyncore to use poll by default we should first check if
poll is available or not by simply using the following statement:

>>> asyncore.loop(timeout=1, use_poll=hasattr(asyncore.select, 'poll'))

This should grant backward compatibility with older asyncore versions
included with Python 2.2, 2.3 and 2.4.


Thanks to Greg Copeland (GCopeland AT efjohnson DOT com) for having
submitted such report.

Original issue: http://code.google.com/p/pyftpdlib/issues/detail?id=16

@giampaolo
Copy link
Owner Author

From billiej...@gmail.com on July 17, 2007 08:35:24

Owner: billiejoex
Cc: -aleaxit jloden yanraber

@giampaolo
Copy link
Owner Author

From billiej...@gmail.com on July 19, 2007 19:20:38

Fixed in SVN, revision #13

Status: Finished

@giampaolo
Copy link
Owner Author

From jlo...@gmail.com on July 24, 2007 00:59:27

Setting this value to True breaks OS X systems due to the differing 
implementation of
select.poll() versus asyncore.poll()

However, setting it to False does not appear to break any test systems on any OS or
version of Python. I would recommend in that light that rather than 
implementing this
fix, we actually just set use_poll to False to allow asyncore to use it's own
internal implementation of poll()

@giampaolo
Copy link
Owner Author

From jlo...@gmail.com on July 24, 2007 08:02:49

Fixed in SVN, set use_poll to False for compatibility with older Python 
versions and
to avoid OS X bug ( Issue #26 )

@giampaolo
Copy link
Owner Author

From jlo...@gmail.com on July 24, 2007 08:04:12

Fixed in Revision 47

@giampaolo
Copy link
Owner Author

From jlo...@gmail.com on July 24, 2007 08:10:10

Status: Obsoleted

@giampaolo
Copy link
Owner Author

From billiej...@gmail.com on October 25, 2007 06:50:22

Labels: -Usability Compatibility

@giampaolo
Copy link
Owner Author

From billiej...@gmail.com on May 02, 2008 11:31:13

Labels: Version-0.1.1 Milestone-0.2.0

@giampaolo
Copy link
Owner Author

From billiej...@gmail.com on October 13, 2008 12:13:13

Labels: Component-Library

@giampaolo
Copy link
Owner Author

From g.rodola on August 11, 2010 15:17:12

Owner: ---
Labels: Python-2.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component-Library enhancement imported imported from old googlecode site and very likely outdated
Projects
None yet
Development

No branches or pull requests

1 participant