lanto03 / couchdb-python

Automatically exported from code.google.com/p/couchdb-python
Other
0 stars 0 forks source link

tools/load.py exits after loading a document with an attachment #70

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a document in a db with an attachment.
2. Make sure there is at least one document in the db with an ID that is
greater than the ID of the document with the attachment.
3. Dump the db with tools/dump.py
4. Delete the db
5. Restart couch
6. Load the db with tools/load.py

What is the expected output? What do you see instead?
Expected all documents to be loaded.  Instead, load.py stops after loading
the document with the attachment.

What version of the product are you using? On what operating system?
trunk, on Linux 2.6

Please provide any additional information below.
I fixed this and was able to load dumps of several large dbs with many
attachments.  Here's the change I made:
Index: multipart.py
===================================================================
--- multipart.py    (revision 141)
+++ multipart.py    (working copy)
@@ -62,7 +62,8 @@
                     else:
                         for part in sub_parts:
                             yield part
-                    return
+                    headers.clear()
+                    continue

         elif line == next_boundary:
             # We've reached the start of a new part, as indicated by the

Original issue reported on code.google.com by riv...@gmail.com on 1 Apr 2009 at 11:11

GoogleCodeExporter commented 8 years ago
Oh, I had forgotten about this issue, and fixed the issue independently in r152.

Original comment by cmlenz on 29 Jun 2009 at 1:40