<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>methane</author_name>
  <author_url>https://blog.hatena.ne.jp/methane/</author_url>
  <blog_title>methaneのブログ</blog_title>
  <blog_url>https://methane.hatenablog.jp/</blog_url>
  <categories>
    <anon>python</anon>
  </categories>
  <description>Pythonでサブプロセスと対話する - 西尾泰和のはてなダイアリーPython のファイルは、通常のファイルの読み込みの効率を考えて大きめ(8192バイト)のバッファリングを行っているので、ソケット通信やパイプで問題になるケースがある。問題になるケースの一つがファイルオブジェクトをイテレータとして使って行単位の処理をする場合で、 for line in fileobj: do_something(line) のようなコードを書くと、実際には fileobj の中にあるCのFILEから一気に読み込み、その中から改行文字を探して切り出していくので、8192バイト読み出せるかファイルの終端に到達す…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmethane.hatenablog.jp%2Fentry%2F20110418%2F1303128576&quot; title=&quot; Python でファイルを直接イテレータとして使うのが適切でない場合 - methaneのブログ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2011-04-18 21:09:36</published>
  <title> Python でファイルを直接イテレータとして使うのが適切でない場合</title>
  <type>rich</type>
  <url>https://methane.hatenablog.jp/entry/20110418/1303128576</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
