dreamworksanimation / usdmanager

USD Manager
http://www.usdmanager.org
Apache License 2.0
321 stars 60 forks source link

WINDOWS 10: errors with utils.generateTemporaryUsdFile when trying to open binary usd #10

Closed bblackbourn closed 5 years ago

bblackbourn commented 5 years ago

As above. Trying to "double click open" a binary usd file in usdmanager left hand panel produces error about unable to rename the temp file to usd, It does create the usd as 0KB file but can't write to it.

Sorry for hacking away again Mark, but I noticed that, when using the same logic during the saveAs process, around line 992 in init.py, the temp file is closed before calling utils.usdcat

I moved the os.close in utils.py from the finally: (around line 154 ish) to line 150, just after the tempfile call and before the try: usdcat call.

Seems to work.

Being a noob, I don't really understand the finally: thing, so I just commented out the existing os.close and stuck in a print statement of the tmpFileName for now...so that it didn't give me a syntrax error.

Hope this is useful.

cheer mate B

mds-dwa commented 5 years ago

Good catch! We'll get this patched up soon. Gotta love Windows vs. Unix differences...

Note to self: Switching from tempfile.mkstemp to tempfile.NamedTemporaryFile may be a better long-term plan.

mds-dwa commented 5 years ago

This should now be resolved in 0.6.0.

bblackbourn commented 5 years ago

Works for me.  Thanks Mark! B

---- On Tue, 09 Jul 2019 19:13:53 +0000 Mark Sandell notifications@github.com wrote ----

This should now be resolved in 0.6.0.

— You are receiving this because you authored the thread. Reply to this email directly, https://github.com/dreamworksanimation/usdmanager/issues/10?email_source=notifications&email_token=AGJJOBDMHWJV7CO6GFX5KDDP6TPPDA5CNFSM4H5IDTQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZRHV4I#issuecomment-509770481, or https://github.com/notifications/unsubscribe-auth/AGJJOBBT3MQVQQLMHCJJ763P6TPPDANCNFSM4H5IDTQQ.