]> granicus.if.org Git - python/commitdiff
Add docs for planned improved handling of the marshalling of
authorGuido van Rossum <guido@python.org>
Wed, 26 Jun 1996 20:20:57 +0000 (20:20 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 26 Jun 1996 20:20:57 +0000 (20:20 +0000)
unmarshallable objects.

Doc/lib/libmarshal.tex
Doc/libmarshal.tex

index 3abcc4291dc98c454ffc7db9b349b6112df33475..58becdb3366bb39a085c91a2b0b354087f1b41ec 100644 (file)
@@ -61,19 +61,27 @@ The module defines these functions:
   \code{sys.stdout} or returned by \code{open()} or
   \code{posix.popen()}.
   
-  If the value has an unsupported type, garbage is written which cannot
-  be read back by \code{load()}.
+  If the value has (or contains an object that has) an unsupported type,
+  a \code{ValueError} exception is raised -- but garbage data will also
+  be written to the file.  The object will not be properly read back by
+  \code{load()}.
 \end{funcdesc}
 
 \begin{funcdesc}{load}{file}
   Read one value from the open file and return it.  If no valid value
   is read, raise \code{EOFError}, \code{ValueError} or
   \code{TypeError}.  The file must be an open file object.
+
+  Warning: If an object containing an unsupported type was marshalled
+  with \code{dump()}, \code{load()} will substitute \code{None} for the
+  unmarshallable type.
 \end{funcdesc}
 
 \begin{funcdesc}{dumps}{value}
   Return the string that would be written to a file by
   \code{dump(value, file)}.  The value must be a supported type.
+  Raise a \code{ValueError} exception if value has (or contains an
+  object that has) an unsupported type.
 \end{funcdesc}
 
 \begin{funcdesc}{loads}{string}
index 3abcc4291dc98c454ffc7db9b349b6112df33475..58becdb3366bb39a085c91a2b0b354087f1b41ec 100644 (file)
@@ -61,19 +61,27 @@ The module defines these functions:
   \code{sys.stdout} or returned by \code{open()} or
   \code{posix.popen()}.
   
-  If the value has an unsupported type, garbage is written which cannot
-  be read back by \code{load()}.
+  If the value has (or contains an object that has) an unsupported type,
+  a \code{ValueError} exception is raised -- but garbage data will also
+  be written to the file.  The object will not be properly read back by
+  \code{load()}.
 \end{funcdesc}
 
 \begin{funcdesc}{load}{file}
   Read one value from the open file and return it.  If no valid value
   is read, raise \code{EOFError}, \code{ValueError} or
   \code{TypeError}.  The file must be an open file object.
+
+  Warning: If an object containing an unsupported type was marshalled
+  with \code{dump()}, \code{load()} will substitute \code{None} for the
+  unmarshallable type.
 \end{funcdesc}
 
 \begin{funcdesc}{dumps}{value}
   Return the string that would be written to a file by
   \code{dump(value, file)}.  The value must be a supported type.
+  Raise a \code{ValueError} exception if value has (or contains an
+  object that has) an unsupported type.
 \end{funcdesc}
 
 \begin{funcdesc}{loads}{string}