Skip to content

Commit 66f92bc

Browse files
author
Richard Jones
committed
fixed anydbm sorting with None values [SF#952853]
1 parent 3c9d810 commit 66f92bc

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

CHANGES.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ Feature:
77
- added support for HTTP charset selection
88

99

10+
2004-05-?? 0.7.2
11+
Fixed:
12+
- fixed anydbm sorting with None values (sf bug 952853)
13+
14+
1015
2004-05-10 0.7.1
1116
Fixed:
1217
- several temp files made it into the source distribution (sf bug 949243)

doc/index.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ Jeffrey P Shell,
121121
Klamer Schutte,
122122
Joel Shprentz,
123123
Terrel Shumway,
124+
Alexander Smishlajev,
124125
Nathaniel Smith,
125126
Mike Thompson,
126127
Darryl VanDorp,

roundup/backends/back_anydbm.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
#$Id: back_anydbm.py,v 1.146 2004-05-05 01:52:34 richard Exp $
18+
#$Id: back_anydbm.py,v 1.147 2004-05-12 22:27:17 richard Exp $
1919
'''This module defines a backend that saves the hyperdatabase in a
2020
database chosen by anydbm. It is guaranteed to always be available in python
2121
versions >2.1.1 (the dumbdbm fallback in 2.1.1 and earlier has several
@@ -1766,6 +1766,11 @@ def filter(self, search_matches, filterspec, sort=(None,None),
17661766
entry.insert(0, v)
17671767
continue
17681768

1769+
# missing (None) values are always sorted first
1770+
if v is None:
1771+
entry.insert(0, v)
1772+
continue
1773+
17691774
if isinstance(propclass, String):
17701775
# it might be a string that's really an integer
17711776
try: tv = int(v)

0 commit comments

Comments
 (0)