<div dir="ltr">But that use case is not about an empty file. It's about finding nothing at the current position where something was expected. This is similar to the original use case for EOFError, which was raised by input() (or rather, raw_input()) when there was no more data on sys.stdin.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jun 26, 2016 at 5:22 PM, Rob Cliffe <span dir="ltr"><<a href="mailto:rob.cliffe@btinternet.com" target="_blank">rob.cliffe@btinternet.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <p>So how about an EmptyFileError (or similar name) as a subclass of
      EOFError?<br>
    </p><div><div class="h5">
    <br>
    <div>On 26/06/2016 21:42, Guido van Rossum
      wrote:<br>
    </div>
    </div></div><blockquote type="cite"><div><div class="h5">
      <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 href="mailto:nd@perlig.de" target="_blank">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 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 href="mailto:Python-Dev@python.org" target="_blank">Python-Dev@python.org</a><br>
          <a 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 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></fieldset>
      <br>
      </div></div><pre><div><div class="h5">_______________________________________________
Python-Dev mailing list
<a href="mailto:Python-Dev@python.org" target="_blank">Python-Dev@python.org</a>
<a href="https://mail.python.org/mailman/listinfo/python-dev" target="_blank">https://mail.python.org/mailman/listinfo/python-dev</a></div></div>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/rob.cliffe%40btinternet.com" target="_blank">https://mail.python.org/mailman/options/python-dev/rob.cliffe%40btinternet.com</a>
</pre>
    </blockquote>
    <br>
  </div>

<br>_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
<a 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 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>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div>