[ZCM] [ZC] 443/ 2 Reject "Fixes for stock Zope (zope-2.5.0-143) on SuSE 8.0 when running under Python 2.2.1 (and not stock 2.2 - python-2.2-166)"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin@zope.org
Fri, 17 Jan 2003 09:13:22 -0500


Issue #443 Update (Reject) "Fixes for stock Zope (zope-2.5.0-143) on SuSE 8.0 when running under Python 2.2.1 (and not stock 2.2 - python-2.2-166)"
 Status Rejected, ZServer/bug+solution low
To followup, visit:
  http://collector.zope.org/Zope/443

==============================================================
= Reject - Entry #2 by regebro on Jan 17, 2003 9:13 am

 Status: Pending => Rejected

Zope 2.5.0 is not supported on Python 2.2.1. The latest Zope releases seem to work well with Python 2.2.3, though (although it's not officially supported anyway).
________________________________________
= Request - Entry #1 by Anonymous User on Jun 26, 2002 6:14 am

[ Thought I'd send this SuSE feedback to Zope feedback, too ]
Dear reader,

I have upgraded to Python 2.2.1 (from SuSE's stock 2.2) on a
SuSE 8.0 system. However, the stock Zope (zope-2.5.0-143) gives:

    # rczope start
    Starting zope/usr/lib/python2.2/FCNTL.py:7: DeprecationWarning: the FCNTL module is deprecated; please use fcntl
    DeprecationWarning)
                                                                     done
    # /usr/lib/python2.2/FCNTL.py:7: DeprecationWarning: the FCNTL module is deprecated; please use fcntl
    DeprecationWarning)

I was able to fix this (diff -u) as follows then rczope start went ok:

File 1/2.
---cut---
# cd /opt/zope
# diff -u ./ZServer/medusa/thread/thread_channel.py.ORIG  ./ZServer/medusa/thread/thread_channel.py
--- ./ZServer/medusa/thread/thread_channel.py.ORIG      Tue May  1 13:45:27 2001
+++ ./ZServer/medusa/thread/thread_channel.py   Tue Jun 25 21:35:34 2002
@@ -14,7 +14,6 @@
 import asynchat

 import fcntl
-import FCNTL
 import os
 import socket
 import string
@@ -42,8 +41,8 @@
         # The read side of the pipe is set to non-blocking I/O; it is
         # 'owned' by medusa.

-        flags = fcntl.fcntl (rfd, FCNTL.F_GETFL, 0)
-        fcntl.fcntl (rfd, FCNTL.F_SETFL, flags | FCNTL.O_NDELAY)
+        flags = fcntl.fcntl (rfd, fcntl.F_GETFL, 0)
+        fcntl.fcntl (rfd, fcntl.F_SETFL, flags | fcntl.O_NDELAY)

         # The write side of the pipe is left in blocking mode; it is
         # 'owned' by the thread.  However, we wrap it up as a file object.
---cut---

File 2/2.
---cut---
# cd /opt/zope
# diff -u ./ZServer/__init__.py.ORIG ./ZServer/__init__.py
--- ./ZServer/__init__.py.ORIG  Fri Dec 21 22:17:51 2001
+++ ./ZServer/__init__.py       Tue Jun 25 21:36:33 2002
@@ -18,10 +18,7 @@
 # brokenness in the Python 2.1 version. We need to do some funny business
 # to make this work, as a 2.2-ism crept into the asyncore code.
 if os.name == 'posix':
-    import fcntl, FCNTL
-    if not hasattr(fcntl, 'F_GETFL'):
-        fcntl.F_GETFL = FCNTL.F_GETFL
-        fcntl.F_SETFL = FCNTL.F_SETFL
+    import fcntl

 from medusa import asyncore
 sys.modules['asyncore'] = asyncore
@@ -64,10 +61,10 @@
 # on exec. This makes it easier for folks who spawn long running
 # processes from Zope code. Thanks to Dieter Maurer for this.
 try:
-    import fcntl, FCNTL
-    FCNTL.F_SETFD; FCNTL.FD_CLOEXEC
+    import fcntl
+    fcntl.F_SETFD; fcntl.FD_CLOEXEC
     def requestCloseOnExec(sock):
-        try:    fcntl.fcntl(sock.fileno(), FCNTL.F_SETFD, FCNTL.FD_CLOEXEC)
+        try:    fcntl.fcntl(sock.fileno(), fcntl.F_SETFD, fcntl.FD_CLOEXEC)
         except: pass

 except (ImportError, AttributeError):
---cut---

Kind regards,

Eric Maryniak
-- 
Eric Maryniak <e.maryniak@pobox.com>
WWW homepage: http://pobox.com/~e.maryniak/
Mobile phone: +31 6 52047532, or (06) 520 475 32 in NL.

==============================================================