<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>shiba_yu36</author_name>
  <author_url>https://blog.hatena.ne.jp/shiba_yu36/</author_url>
  <blog_title>$shibayu36-&gt;blog;</blog_title>
  <blog_url>https://blog.shibayu36.org/</blog_url>
  <categories>
    <anon>tech</anon>
  </categories>
  <description>https://github.com/shibayu36/chat-hatenablog を使っていて、途中でC-cなどでプロセスをterminateした時にpickleファイルが壊れることがあった。pickleファイルが壊れると、次のpickle.load時に EOFError: Ran out of input のようなエラーが出て、再度作り直しとなってしまう。これはかなり辛い。 色々調べているとファイル操作をatomicになるようにすることで、pickleファイルを壊れないようにできたので、そのやり方をメモしておく。間違えている部分があれば指摘してください。 なぜ壊れるか たとえば pi…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.shibayu36.org%2Fentry%2F2023%2F04%2F24%2F180000&quot; title=&quot;Pythonのpickleファイルが壊れないようにatomicに処理する - $shibayu36-&amp;gt;blog;&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>https://cdn-ak.f.st-hatena.com/images/fotolife/s/shiba_yu36/20230421/20230421095501.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2023-04-24 18:00:00</published>
  <title>Pythonのpickleファイルが壊れないようにatomicに処理する</title>
  <type>rich</type>
  <url>https://blog.shibayu36.org/entry/2023/04/24/180000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
