From: <bu...@us...> - 2009-08-30 00:36:57
|
Revision: 735 http://fail2ban.svn.sourceforge.net/fail2ban/?rev=735&view=rev Author: buanzo Date: 2009-08-30 00:36:40 +0000 (Sun, 30 Aug 2009) Log Message: ----------- Fix for python 2.6 / 3.0 incompatibility Modified Paths: -------------- branches/FAIL2BAN-0_8/server/asyncserver.py Modified: branches/FAIL2BAN-0_8/server/asyncserver.py =================================================================== --- branches/FAIL2BAN-0_8/server/asyncserver.py 2009-08-28 22:26:17 UTC (rev 734) +++ branches/FAIL2BAN-0_8/server/asyncserver.py 2009-08-30 00:36:40 UTC (rev 735) @@ -132,7 +132,8 @@ # Sets the init flag. self.__init = True # TODO Add try..catch - asyncore.loop(use_poll = True) + # There's a bug report for Python 2.6/3.0 that use_poll=True yields some 2.5 incompatibilities: + asyncore.loop(use_poll = False) # fixes the "Unexpected communication problem" issue on Python 2.6. ## # Stops the communication server. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bu...@us...> - 2009-08-30 13:28:00
|
Revision: 736 http://fail2ban.svn.sourceforge.net/fail2ban/?rev=736&view=rev Author: buanzo Date: 2009-08-30 13:27:52 +0000 (Sun, 30 Aug 2009) Log Message: ----------- added python version detection to asyncore.loop(use_poll=True|False) Modified Paths: -------------- branches/FAIL2BAN-0_8/server/asyncserver.py Modified: branches/FAIL2BAN-0_8/server/asyncserver.py =================================================================== --- branches/FAIL2BAN-0_8/server/asyncserver.py 2009-08-30 00:36:40 UTC (rev 735) +++ branches/FAIL2BAN-0_8/server/asyncserver.py 2009-08-30 13:27:52 UTC (rev 736) @@ -133,7 +133,12 @@ self.__init = True # TODO Add try..catch # There's a bug report for Python 2.6/3.0 that use_poll=True yields some 2.5 incompatibilities: - asyncore.loop(use_poll = False) # fixes the "Unexpected communication problem" issue on Python 2.6. + if (sys.version_info[0] == 2 and sys.version_info[1] == 6) or (sys.version_info[0] == 3): # if python 2.6 or 3.*... + logSys.debug("Detected Python 2.6 or 3.*. asyncore.loop() not using poll") + asyncore.loop(use_poll = False) # fixes the "Unexpected communication problem" issue on Python 2.6 and 3.0 + else: + logSys.debug("NOT Python 2.6/3.* - asyncore.loop() using poll") + asyncore.loop(use_poll = True) ## # Stops the communication server. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bu...@us...> - 2009-08-30 13:32:30
|
Revision: 737 http://fail2ban.svn.sourceforge.net/fail2ban/?rev=737&view=rev Author: buanzo Date: 2009-08-30 13:32:19 +0000 (Sun, 30 Aug 2009) Log Message: ----------- more readable code for python version comparison Modified Paths: -------------- branches/FAIL2BAN-0_8/server/asyncserver.py Modified: branches/FAIL2BAN-0_8/server/asyncserver.py =================================================================== --- branches/FAIL2BAN-0_8/server/asyncserver.py 2009-08-30 13:27:52 UTC (rev 736) +++ branches/FAIL2BAN-0_8/server/asyncserver.py 2009-08-30 13:32:19 UTC (rev 737) @@ -133,8 +133,8 @@ self.__init = True # TODO Add try..catch # There's a bug report for Python 2.6/3.0 that use_poll=True yields some 2.5 incompatibilities: - if (sys.version_info[0] == 2 and sys.version_info[1] == 6) or (sys.version_info[0] == 3): # if python 2.6 or 3.*... - logSys.debug("Detected Python 2.6 or 3.*. asyncore.loop() not using poll") + if sys.version_info >= (2, 6): # if python 2.6 or greater... + logSys.debug("Detected Python 2.6 or greater. asyncore.loop() not using poll") asyncore.loop(use_poll = False) # fixes the "Unexpected communication problem" issue on Python 2.6 and 3.0 else: logSys.debug("NOT Python 2.6/3.* - asyncore.loop() using poll") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bu...@us...> - 2009-08-30 13:36:12
|
Revision: 738 http://fail2ban.svn.sourceforge.net/fail2ban/?rev=738&view=rev Author: buanzo Date: 2009-08-30 13:36:04 +0000 (Sun, 30 Aug 2009) Log Message: ----------- added missing import sys to asyncserver.py Modified Paths: -------------- branches/FAIL2BAN-0_8/server/asyncserver.py Modified: branches/FAIL2BAN-0_8/server/asyncserver.py =================================================================== --- branches/FAIL2BAN-0_8/server/asyncserver.py 2009-08-30 13:32:19 UTC (rev 737) +++ branches/FAIL2BAN-0_8/server/asyncserver.py 2009-08-30 13:36:04 UTC (rev 738) @@ -25,7 +25,7 @@ __license__ = "GPL" from pickle import dumps, loads, HIGHEST_PROTOCOL -import asyncore, asynchat, socket, os, logging +import asyncore, asynchat, socket, os, logging, sys # Gets the instance of the logger. logSys = logging.getLogger("fail2ban.server") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bu...@us...> - 2009-09-01 17:33:14
|
Revision: 750 http://fail2ban.svn.sourceforge.net/fail2ban/?rev=750&view=rev Author: buanzo Date: 2009-09-01 17:33:04 +0000 (Tue, 01 Sep 2009) Log Message: ----------- added traceback to asyncserver.py's import. Modified Paths: -------------- branches/FAIL2BAN-0_8/server/asyncserver.py Modified: branches/FAIL2BAN-0_8/server/asyncserver.py =================================================================== --- branches/FAIL2BAN-0_8/server/asyncserver.py 2009-08-31 14:42:45 UTC (rev 749) +++ branches/FAIL2BAN-0_8/server/asyncserver.py 2009-09-01 17:33:04 UTC (rev 750) @@ -26,7 +26,7 @@ from pickle import dumps, loads, HIGHEST_PROTOCOL from common import helpers -import asyncore, asynchat, socket, os, logging, sys +import asyncore, asynchat, socket, os, logging, sys, traceback # Gets the instance of the logger. logSys = logging.getLogger("fail2ban.server") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |