<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>So how about an EmptyFileError (or similar name) as a subclass of
EOFError?<br>
</p>
<br>
<div class="moz-cite-prefix">On 26/06/2016 21:42, Guido van Rossum
wrote:<br>
</div>
<blockquote
cite="mid:CAP7+vJKuSeSguU_ttN4TQTA5WtA5AExoNEh5n+hGfT8sseqwyw@mail.gmail.com"
type="cite">
<p dir="ltr">I think this is an interesting idea and quite in line
with the meaning of EOFError.</p>
<p dir="ltr">--Guido (mobile)</p>
<div class="gmail_quote">On Jun 26, 2016 5:02 AM, "André Malo"
<<a moz-do-not-send="true" href="mailto:nd@perlig.de">nd@perlig.de</a>>
wrote:<br type="attribution">
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">* Serhiy
Storchaka wrote:<br>
<br>
> On 22.06.16 19:22, André Malo wrote:<br>
> > I often concatenate multiple pickles into one file.
When reading them,<br>
> > it works like this:<br>
> ><br>
> > try:<br>
> > while True:<br>
> > yield pickle.load(fp)<br>
> > except EOFError:<br>
> > pass<br>
> ><br>
> > In this case the truncation is not really
unexpected. Maybe it should<br>
> > distinguish between truncated-in-the-middle and<br>
> > truncated-because-empty.<br>
> ><br>
> > (Same goes for marshal)<br>
><br>
> This is interesting application, but works only for
non-truncated data.<br>
> If the data is truncated, you just lose the last item
without a notice.<br>
<br>
Yes (as said). In my case it's typically not a problem,
because I write them<br>
myself right before reading them. It's a basically about
spooling data to<br>
disk in order to keep them out of the RAM.<br>
However, because of the truncation issue it would be nice, to
have a<br>
distinction between no-data and truncated-data.<br>
<br>
Cheers,<br>
--<br>
Winnetous Erbe: <<a moz-do-not-send="true"
href="http://pub.perlig.de/books.html#apache2"
rel="noreferrer" target="_blank">http://pub.perlig.de/books.html#apache2</a>><br>
_______________________________________________<br>
Python-Dev mailing list<br>
<a moz-do-not-send="true" href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
<a moz-do-not-send="true"
href="https://mail.python.org/mailman/listinfo/python-dev"
rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a moz-do-not-send="true"
href="https://mail.python.org/mailman/options/python-dev/guido%40python.org"
rel="noreferrer" target="_blank">https://mail.python.org/mailman/options/python-dev/guido%40python.org</a><br>
</blockquote>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Python-Dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Python-Dev@python.org">Python-Dev@python.org</a>
<a class="moz-txt-link-freetext" href="https://mail.python.org/mailman/listinfo/python-dev">https://mail.python.org/mailman/listinfo/python-dev</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="https://mail.python.org/mailman/options/python-dev/rob.cliffe%40btinternet.com">https://mail.python.org/mailman/options/python-dev/rob.cliffe%40btinternet.com</a>
</pre>
</blockquote>
<br>
</body>
</html>