2 new revisions:
Revision: 00d6a78a44cf
Branch: default
Author: Dirkjan Ochtman <
dir...@ochtman.nl>
Date: Fri Sep 21 00:53:53 2012
Log: Rip out validate_dbname(), leave validation to the server (fixes
issue...
http://code.google.com/p/couchdb-python/source/detail?r=00d6a78a44cf
Revision: 852174ba733b
Branch: default
Author: Dirkjan Ochtman <
dir...@ochtman.nl>
Date: Fri Sep 21 00:54:03 2012
Log: Update the changelog a bit more.
http://code.google.com/p/couchdb-python/source/detail?r=852174ba733b
==============================================================================
Revision: 00d6a78a44cf
Branch: default
Author: Dirkjan Ochtman <
dir...@ochtman.nl>
Date: Fri Sep 21 00:53:53 2012
Log: Rip out validate_dbname(), leave validation to the server (fixes
issue 188).
http://code.google.com/p/couchdb-python/source/detail?r=00d6a78a44cf
Modified:
/ChangeLog.txt
/couchdb/client.py
=======================================
--- /ChangeLog.txt Sat Oct 29 07:20:48 2011
+++ /ChangeLog.txt Fri Sep 21 00:53:53 2012
@@ -1,6 +1,8 @@
Version 0.9 (not released)
--------------------------
+ * Don't validate database names on the client side. This means some
methods
+ dealing with database names can return different exceptions than before.
* Use HTTP socket more efficiently to avoid the Nagle algorithm, greatly
improving performace. Note: add the {nodelay, true} option to the
CouchDB
server's httpd/socket_options config.
=======================================
--- /couchdb/client.py Fri Sep 21 00:41:23 2012
+++ /couchdb/client.py Fri Sep 21 00:53:53 2012
@@ -90,7 +90,7 @@
:return: `True` if a database with the name exists, `False`
otherwise
"""
try:
- self.resource.head(validate_dbname(name))
+ self.resource.head(name)
return True
except http.ResourceNotFound:
return False
@@ -122,7 +122,7 @@
:param name: the name of the database
:raise ResourceNotFound: if no database with that name exists
"""
- self.resource.delete_json(validate_dbname(name))
+ self.resource.delete_json(name)
def __getitem__(self, name):
"""Return a `Database` object representing the database with the
@@ -133,7 +133,7 @@
:rtype: `Database`
:raise ResourceNotFound: if no database with that name exists
"""
- db = Database(self.resource(name), validate_dbname(name))
+ db = Database(self.resource(name), name)
db.resource.head() # actually make a request to the database
return db
@@ -198,7 +198,7 @@
:rtype: `Database`
:raise PreconditionFailed: if a database with that name already
exists
"""
- self.resource.put_json(validate_dbname(name))
+ self.resource.put_json(name)
return self[name]
def delete(self, name):
@@ -1193,13 +1193,3 @@
doc = self.get('doc')
if doc:
return Document(doc)
-
-
-SPECIAL_DB_NAMES = set(['_users', '_replicator'])
-VALID_DB_NAME = re.compile(r'^[a-z][a-z0-9_$()+-/]*$')
-def validate_dbname(name):
- if name in SPECIAL_DB_NAMES:
- return name
- if not VALID_DB_NAME.match(name):
- raise ValueError('Invalid database name')
- return name
==============================================================================
Revision: 852174ba733b
Branch: default
Author: Dirkjan Ochtman <
dir...@ochtman.nl>
Date: Fri Sep 21 00:54:03 2012
Log: Update the changelog a bit more.
http://code.google.com/p/couchdb-python/source/detail?r=852174ba733b
Modified:
/ChangeLog.txt
=======================================
--- /ChangeLog.txt Fri Sep 21 00:53:53 2012
+++ /ChangeLog.txt Fri Sep 21 00:54:03 2012
@@ -18,8 +18,11 @@
* Enhance Database.info() so it can also be used to get info for a design
doc.
* Add view definition options, e.g. collation.
- * Protect ResourceBody from being iterated/closed multiple times.
+ * Protect ResponseBody from being iterated/closed multiple times.
+ * Rename iteration method for ResponseBody chunks to iterchunks() to
+ prevent usage for non-chunked responses.
* JSON encoding exception are no longer masked, giving clearer errors.
+ * cjson support is now deprecated.
* Fix Row.value and Row.__repr__ to never raise exceptions.
* Fix Python view server's reduce to handle empty map results list.
* Don't require setuptools/distribute to install the core package. (Still