Skip to content

Commit cd0ba32

Browse files
author
Richard Jones
committed
*** empty log message ***
1 parent abd70fd commit cd0ba32

File tree

5 files changed

+18
-24
lines changed

5 files changed

+18
-24
lines changed

CHANGES.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ are given with the most recent entry first.
55
- plugged cross-site-scripting hole (thanks Jeff Epler)
66
- handle deprecation of FCNTL in python2.2+ (sf bug 756756)
77
- handle missing Subject: line (sf bug 755331)
8-
- handle New User creation (sf bug 754510)
8+
- fix New User creation (sf bug 754510)
99
- fix hackish message escaping (sf bug 757128)
1010
- fix :required ordering problem (sf bug 740214)
1111
- audit some user properties for valid values (roles, address) (sf bugs
1212
742968 and 739653)
1313
- fix HTML file detection (hence history xref linking) (sf bug 741478)
1414
- session database caches it's type, rather than calling whichdb each time
1515
around.
16-
- changed rdbms_common to fix sql backends under Py2.3
16+
- changed rdbms_common to fix sql backends for new Boolean types under Py2.3
1717

1818

1919
2003-06-10 0.6.0b3

roundup/backends/locking.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,14 @@
1919
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2020
# SOFTWARE.
2121

22-
# $Id: locking.py,v 1.6 2003-02-20 22:56:49 richard Exp $
22+
# $Id: locking.py,v 1.7 2003-07-03 23:43:46 richard Exp $
2323

2424
'''This module provides a generic interface to acquire and release
2525
exclusive access to a file.
2626
2727
It should work on Unix and Windows.
2828
'''
2929

30-
# portalocker has a 0xffff0000 constant, and I don't need to know about it
31-
# being positive in 2.4+ :)
32-
try:
33-
x=FutureWarning
34-
import warnings
35-
warnings.filterwarnings("ignore",
36-
r'hex/oct constants > sys\.maxint .*', FutureWarning,
37-
'portalocker', 0)
38-
del x
39-
except:
40-
pass
41-
4230
import portalocker
4331

4432
def acquire_lock(path, block=1):

roundup/backends/portalocker.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Requires python 1.5.2 or better.
33

44
# ID line added by richard for Roundup file tracking
5-
# $Id: portalocker.py,v 1.5 2003-02-20 22:56:49 richard Exp $
5+
# $Id: portalocker.py,v 1.6 2003-07-03 23:43:46 richard Exp $
66

77
""" Cross-platform (posix/nt) API for flock-style file locking.
88
@@ -60,14 +60,16 @@
6060
raise RuntimeError("PortaLocker only defined for nt and posix platforms")
6161

6262
if os.name == 'nt':
63+
# eugh, but trying to suppress the warning doesn't work :(
64+
FFFF0000 = 0xffff000 << 4
6365
def lock(file, flags):
6466
hfile = win32file._get_osfhandle(file.fileno())
6567
# LockFileEx is not supported on all Win32 platforms (Win95, Win98, WinME).
6668
# If it's not supported, win32file will raise an exception.
6769
# Try LockFileEx first, as it has more functionality and handles
6870
# blocking locks more efficiently.
6971
try:
70-
win32file.LockFileEx(hfile, flags, 0, 0xffff0000, __overlapped)
72+
win32file.LockFileEx(hfile, flags, 0, FFFF0000, __overlapped)
7173
except win32file.error, e:
7274
import winerror
7375
# Propagate upwards all exceptions other than not-implemented.
@@ -82,14 +84,14 @@ def lock(file, flags):
8284
warnings.warn("PortaLocker does not support shared locking on Win9x", RuntimeWarning)
8385
# LockFile only supports immediate-fail locking.
8486
if flags & LOCK_NB:
85-
win32file.LockFile(hfile, 0, 0, 0xffff0000, 0)
87+
win32file.LockFile(hfile, 0, 0, FFFF0000, 0)
8688
else:
8789
# Emulate a blocking lock with a polling loop.
8890
import time
8991
while 1:
9092
# Attempt a lock.
9193
try:
92-
win32file.LockFile(hfile, 0, 0, 0xffff0000, 0)
94+
win32file.LockFile(hfile, 0, 0, FFFF0000, 0)
9395
break
9496
except win32file.error, e:
9597
# Propagate upwards all exceptions other than lock violation.
@@ -104,7 +106,7 @@ def unlock(file):
104106
# UnlockFileEx is not supported on all Win32 platforms (Win95, Win98, WinME).
105107
# If it's not supported, win32file will raise an api_error exception.
106108
try:
107-
win32file.UnlockFileEx(hfile, 0, 0xffff0000, __overlapped)
109+
win32file.UnlockFileEx(hfile, 0, FFFF0000, __overlapped)
108110
except win32file.error, e:
109111
import winerror
110112
# Propagate upwards all exceptions other than not-implemented.
@@ -113,7 +115,7 @@ def unlock(file):
113115

114116
# UnlockFileEx is not supported. Use UnlockFile.
115117
# Care: the low/high length params are reversed compared to UnLockFileEx.
116-
win32file.UnlockFile(hfile, 0, 0, 0xffff0000, 0)
118+
win32file.UnlockFile(hfile, 0, 0, FFFF0000, 0)
117119

118120
elif os.name =='posix':
119121
def lock(file, flags):

roundup/backends/rdbms_common.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: rdbms_common.py,v 1.56 2003-06-24 08:06:27 anthonybaxter Exp $
1+
# $Id: rdbms_common.py,v 1.57 2003-07-03 23:43:46 richard Exp $
22
''' Relational database (SQL) backend common code.
33
44
Basics:
@@ -1741,7 +1741,10 @@ def getnodeids(self, retired=None):
17411741
'''
17421742
# flip the sense of the 'retired' flag if we don't want all of them
17431743
if retired is not None:
1744-
args = (((retired==0) and 1) or 0, )
1744+
if retired:
1745+
args = (0, )
1746+
else:
1747+
args = (1, )
17451748
sql = 'select id from _%s where __retired__ <> %s'%(self.classname,
17461749
self.db.arg)
17471750
else:

roundup/cgi/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: client.py,v 1.124 2003-06-24 05:00:43 richard Exp $
1+
# $Id: client.py,v 1.125 2003-07-03 23:43:47 richard Exp $
22

33
__doc__ = """
44
WWW request handler (also used in the stand-alone server).
@@ -319,6 +319,7 @@ def determine_user(self):
319319
'''
320320
# clean age sessions
321321
self.clean_sessions()
322+
322323
# make sure we have the session Class
323324
sessions = self.db.sessions
324325

0 commit comments

Comments
 (0)