Closed Birch-san closed 7 years ago
Did you play around a bit to figure out the problem? On my machine it makes no difference for the call Path("some_folder").is_dir()
if some_folder
has a trailing slash?
I revisited this again today and can no longer reproduce the problem.
I deleted asset_version
to attempt a re-conversion of assets, and it went just fine (even though I omitted the trailing slash).
I did a more specific test, and this worked fine too
➜ ~ python3
Python 3.6.1 (default, Mar 23 2017, 16:49:06)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pathlib import Path
>>> Path("/Users/anon/Documents/age2hd/attempt2").is_dir()
True
>>> Path("/Users/anon/Documents/age2hd/attempt2/").is_dir()
True
Maybe it's a dependency version thing? I think at some point whilst working on openage, I upgraded from Python 3.5 to 3.6 (and also reinstalled dependencies).
Python 3.5 is still on my machine. So I tried there, yet I was unable to reproduce the problem.
Thus the most likely candidate is pathlib. Maybe I once had an old version?
Unlikely that pathlib
is the problem, it's a standard library module and I didn't ready any bugreports about that lately. But who knows :)
This is actually a valid directory. Look what happens if I add a trailing slash:
Here's the part of the code that seems to get confused:
https://github.com/SFTtech/openage/blob/master/openage/convert/main.py#L303
I wonder why it doesn't understand that that Path is a directory (unless you add a trailing slash).