2021年1月19日星期二

Pathlib concatenation mutates value unpredictably

I have a class that uses some member variables to form strings. In part of the code it does something like this:

print(self.outfolder)  output_location = self.outfolder / f"{workable}_{i}.wav"  print(output_location)  

The terminal prints this however:

/Users/james/Cloud/Projects/ElectroMagnetic/dump/segments  /Users/james/Cloud/Projects/ElectroMagnetic/reaper/highgain_source/bounces/Kindle_04.wav  

I cannot for the life of me figure out why this value is mutating in such a way from the concatenation. The path the does get formed looks a lot like a completely different member variable that is stored in the class is being used so its not unrelated, but it is completely unpredictable. I've gone through and print() debugged as much as I can but I am tearing my hair out trying to understand why the path is being concatenated incorrectly.

Any pointers?

https://stackoverflow.com/questions/65802509/pathlib-concatenation-mutates-value-unpredictably January 20, 2021 at 11:04AM

没有评论:

发表评论