changeset 1719:eeb167fb8faf

*** empty log message ***
author Richard Jones <richard@users.sourceforge.net>
date Thu, 03 Jul 2003 23:46:34 +0000
parents 1d93289af20b
children ed2c4f5a27da
files CHANGES.txt roundup/backends/locking.py roundup/backends/portalocker.py roundup/backends/rdbms_common.py roundup/cgi/client.py
diffstat 5 files changed, 18 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES.txt	Tue Jul 01 08:21:57 2003 +0000
+++ b/CHANGES.txt	Thu Jul 03 23:46:34 2003 +0000
@@ -5,7 +5,7 @@
 - plugged cross-site-scripting hole (thanks Jeff Epler)
 - handle deprecation of FCNTL in python2.2+ (sf bug 756756)
 - handle missing Subject: line (sf bug 755331)
-- handle New User creation (sf bug 754510)
+- fix New User creation (sf bug 754510)
 - fix hackish message escaping (sf bug 757128)
 - fix :required ordering problem (sf bug 740214)
 - audit some user properties for valid values (roles, address) (sf bugs
@@ -13,7 +13,7 @@
 - fix HTML file detection (hence history xref linking) (sf bug 741478)
 - session database caches it's type, rather than calling whichdb each time 
   around.
-- changed rdbms_common to fix sql backends under Py2.3
+- changed rdbms_common to fix sql backends for new Boolean types under Py2.3
 
 
 2003-06-10 0.6.0b3
--- a/roundup/backends/locking.py	Tue Jul 01 08:21:57 2003 +0000
+++ b/roundup/backends/locking.py	Thu Jul 03 23:46:34 2003 +0000
@@ -19,7 +19,7 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 # SOFTWARE.
 
-# $Id: locking.py,v 1.6 2003-02-20 22:56:49 richard Exp $
+# $Id: locking.py,v 1.7 2003-07-03 23:43:46 richard Exp $
 
 '''This module provides a generic interface to acquire and release
 exclusive access to a file.
@@ -27,18 +27,6 @@
 It should work on Unix and Windows.
 '''
 
-# portalocker has a 0xffff0000 constant, and I don't need to know about it
-# being positive in 2.4+ :)
-try:
-    x=FutureWarning
-    import warnings
-    warnings.filterwarnings("ignore",
-        r'hex/oct constants > sys\.maxint .*', FutureWarning,
-        'portalocker', 0)
-    del x
-except:
-    pass
-
 import portalocker
 
 def acquire_lock(path, block=1):
--- a/roundup/backends/portalocker.py	Tue Jul 01 08:21:57 2003 +0000
+++ b/roundup/backends/portalocker.py	Thu Jul 03 23:46:34 2003 +0000
@@ -2,7 +2,7 @@
 #                  Requires python 1.5.2 or better.
 
 # ID line added by richard for Roundup file tracking
-# $Id: portalocker.py,v 1.5 2003-02-20 22:56:49 richard Exp $
+# $Id: portalocker.py,v 1.6 2003-07-03 23:43:46 richard Exp $
 
 """ Cross-platform (posix/nt) API for flock-style file locking.
 
@@ -60,6 +60,8 @@
     raise RuntimeError("PortaLocker only defined for nt and posix platforms")
 
 if os.name == 'nt':
+    # eugh, but trying to suppress the warning doesn't work :(
+    FFFF0000 = 0xffff000 << 4
     def lock(file, flags):
         hfile = win32file._get_osfhandle(file.fileno())
         # LockFileEx is not supported on all Win32 platforms (Win95, Win98, WinME).
@@ -67,7 +69,7 @@
         # Try LockFileEx first, as it has more functionality and handles
         # blocking locks more efficiently.
         try:
-            win32file.LockFileEx(hfile, flags, 0, 0xffff0000, __overlapped)
+            win32file.LockFileEx(hfile, flags, 0, FFFF0000, __overlapped)
         except win32file.error, e:
             import winerror
             # Propagate upwards all exceptions other than not-implemented.
@@ -82,14 +84,14 @@
                 warnings.warn("PortaLocker does not support shared locking on Win9x", RuntimeWarning)
             # LockFile only supports immediate-fail locking.
             if flags & LOCK_NB:
-                win32file.LockFile(hfile, 0, 0, 0xffff0000, 0)
+                win32file.LockFile(hfile, 0, 0, FFFF0000, 0)
             else:
                 # Emulate a blocking lock with a polling loop.
                 import time
                 while 1:
                     # Attempt a lock.
                     try:
-                        win32file.LockFile(hfile, 0, 0, 0xffff0000, 0)
+                        win32file.LockFile(hfile, 0, 0, FFFF0000, 0)
                         break
                     except win32file.error, e:
                         # Propagate upwards all exceptions other than lock violation.
@@ -104,7 +106,7 @@
         # UnlockFileEx is not supported on all Win32 platforms (Win95, Win98, WinME).
         # If it's not supported, win32file will raise an api_error exception.
         try:
-            win32file.UnlockFileEx(hfile, 0, 0xffff0000, __overlapped)
+            win32file.UnlockFileEx(hfile, 0, FFFF0000, __overlapped)
         except win32file.error, e:
             import winerror
             # Propagate upwards all exceptions other than not-implemented.
@@ -113,7 +115,7 @@
             
             # UnlockFileEx is not supported. Use UnlockFile.
             # Care: the low/high length params are reversed compared to UnLockFileEx.
-            win32file.UnlockFile(hfile, 0, 0, 0xffff0000, 0)
+            win32file.UnlockFile(hfile, 0, 0, FFFF0000, 0)
 
 elif os.name =='posix':
     def lock(file, flags):
--- a/roundup/backends/rdbms_common.py	Tue Jul 01 08:21:57 2003 +0000
+++ b/roundup/backends/rdbms_common.py	Thu Jul 03 23:46:34 2003 +0000
@@ -1,4 +1,4 @@
-# $Id: rdbms_common.py,v 1.56 2003-06-24 08:06:27 anthonybaxter Exp $
+# $Id: rdbms_common.py,v 1.57 2003-07-03 23:43:46 richard Exp $
 ''' Relational database (SQL) backend common code.
 
 Basics:
@@ -1741,7 +1741,10 @@
         '''
         # flip the sense of the 'retired' flag if we don't want all of them
         if retired is not None:
-            args = (((retired==0) and 1) or 0, )
+            if retired:
+                args = (0, )
+            else:
+                args = (1, )
             sql = 'select id from _%s where __retired__ <> %s'%(self.classname,
                 self.db.arg)
         else:
--- a/roundup/cgi/client.py	Tue Jul 01 08:21:57 2003 +0000
+++ b/roundup/cgi/client.py	Thu Jul 03 23:46:34 2003 +0000
@@ -1,4 +1,4 @@
-# $Id: client.py,v 1.124 2003-06-24 05:00:43 richard Exp $
+# $Id: client.py,v 1.125 2003-07-03 23:43:47 richard Exp $
 
 __doc__ = """
 WWW request handler (also used in the stand-alone server).
@@ -319,6 +319,7 @@
         '''
         # clean age sessions
         self.clean_sessions()
+
         # make sure we have the session Class
         sessions = self.db.sessions
 

Roundup Issue Tracker: http://roundup-tracker.org/