sawyl: (Default)
[personal profile] sawyl
I've finally uncovered the source of the bug that caused my backup script to go horribly wrong. Essentially, it comes down to how the python os.path.join() behaves when given a pair of absolute paths. When the second path element is unqualified, the join function works as expected:

>>> os.path.join("/tmp", "foo")
'/tmp/foo'
>>>

But when the second path element is fully qualified, the join function returns the second path:

>>> os.path.join("/tmp", "/foo")
'/foo'
>>>

I think that explains why my backup script chose to dump all over the root file system instead of putting all the files into a nice little archive directory. Oops.

Profile

sawyl: (Default)
sawyl

August 2018

S M T W T F S
   123 4
5 6 7 8910 11
12131415161718
192021222324 25
262728293031 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 5th, 2026 01:00 am
Powered by Dreamwidth Studios