TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How py.path ate my files

2 pointsby thepainabout 9 years ago

1 comment

thepainabout 9 years ago
Update: there is an error in the write-up:<p><pre><code> print p </code></pre> actually returns the path string. However since I was using IPython, showing `p` without printing it displays the object representation:<p><pre><code> In [20]: p Out[20]: local(&#x27;&#x2F;home&#x2F;user&#x27;) </code></pre> This story is nothing I am proud of, but I wanted to share it anyway, I think there are a few interesting facets to this, e.g. how I got there:<p>- not discovering the solution through the documentation,<p>- hacking away instead of asking,<p>- lack of attention to detail when hacking through it (do I really wanna do this on my homefolder???),<p>- also: forgetting about the incident right away<p>I guess that makes me look bad, but I believe such errors happen everywhere and all the time. So there is the question, why did the solution not occur to me? Am I really just stupid and I am the only one? Or should the `__str__` method be included in API-documentation?<p>I don&#x27;t know, but I&#x27;d like to hear your thoughts!<p>(edit: formatting)