Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

path.os.abspath returning the wrong path #73

Open
Aedial opened this issue Apr 26, 2018 · 0 comments
Open

path.os.abspath returning the wrong path #73

Aedial opened this issue Apr 26, 2018 · 0 comments

Comments

@Aedial
Copy link

Aedial commented Apr 26, 2018

At the line 61 of unityextract :
def get_output_path(self, filename):
basedir = os.path.abspath(self.args.outdir)
path = os.path.join(basedir, filename)
dirs = os.path.dirname(path)

The os.path.abspath change the self.arg.outdir to an incorrect path. The tests I ran gave me this :
outdir : D:\\Personnel\\Jeux\\Chain Strike\\Extractor\\res\\shaders
basedir : D:\\Personnel\\Jeux\\Chain Strike\\Utility\\ D:\\Personnel\\Jeux\\Chain Strike\\Extractor\\res\\shaders
path : D:\\Personnel\\Jeux\\Chain Strike\\Utility\\ D:\\Personnel\\Jeux\\Chain Strike\\Extractor\\res\\shaders\\Unlit - Transparent Colored.cg
dirs : D:\\Personnel\\Jeux\\Chain Strike\\Utility\\ D:\\Personnel\\Jeux\\Chain Strike\\Extractor\\res\\shaders

The os.path.abspath concatenated the cwd of the file I was running with the correct path. It was messing with the makedirs and returning an error each time (OSError: [WinError 123]).
It's not hard to fix, but quite annoying to find without an accurate debugging.

Edit : I forgot to say that I used subprocess.call / subprocess.Popen to call the command. It works fine with the command-line tool.
Other weird behavior : using "-o path" in the command raise the error, but using "-opath" works just fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant