From: richard Date: Thu, 3 Jul 2003 23:46:34 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4cea28ed868034b9ee57b3e114f91162346985dd;p=roundup.git *** empty log message *** git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1785 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/CHANGES.txt b/CHANGES.txt index d0fc5c6..9434fe2 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -5,7 +5,7 @@ are given with the most recent entry first. - 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 @@ are given with the most recent entry first. - 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 diff --git a/roundup/backends/locking.py b/roundup/backends/locking.py index 4522328..36833d0 100644 --- a/roundup/backends/locking.py +++ b/roundup/backends/locking.py @@ -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 @@ exclusive access to a file. 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): diff --git a/roundup/backends/portalocker.py b/roundup/backends/portalocker.py index a062701..47ab263 100644 --- a/roundup/backends/portalocker.py +++ b/roundup/backends/portalocker.py @@ -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 @@ else: 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 @@ if os.name == 'nt': # 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 @@ if os.name == 'nt': 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 @@ if os.name == 'nt': # 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 @@ if os.name == 'nt': # 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): diff --git a/roundup/backends/rdbms_common.py b/roundup/backends/rdbms_common.py index cb234ae..9d7f333 100644 --- a/roundup/backends/rdbms_common.py +++ b/roundup/backends/rdbms_common.py @@ -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 @@ class Class(hyperdb.Class): ''' # 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: diff --git a/roundup/cgi/client.py b/roundup/cgi/client.py index 397c2fe..7b7d86c 100644 --- a/roundup/cgi/client.py +++ b/roundup/cgi/client.py @@ -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 @@ class Client: ''' # clean age sessions self.clean_sessions() + # make sure we have the session Class sessions = self.db.sessions