Crash when msvcrt.locking

Crash when msvcrt.locking

icapathos
Advocate Advocate
351 Views
2 Replies
Message 1 of 3

Crash when msvcrt.locking

icapathos
Advocate
Advocate

I have been worked in Maya 2019.

I tried to "LOCK a file handle" using msvcrt.locking, but it crashed!

 

Before run in Maya2019, I tested in a native python and it works.

I don't know the differences between Mayapy and Native Python.

 

I used portalocker as below

https://pypi.org/project/portalocker/1.7.1/ 

0 Likes
352 Views
2 Replies
Replies (2)
Message 2 of 3

Kahylan
Advisor
Advisor

Hi!

 

I'm not familiar with portalocker and it doesn't support my OS so I can't test it.

 

But from the documentation on portalocker it looks like it is meant to be run from a console and not from within a file.

 

Why exactly do you want to run your script from inside Maya?

0 Likes
Message 3 of 3

icapathos
Advocate
Advocate

I create a script to logging some stats in A FILE.

When a certain mount of people use the script simultaneously, it ocurrs a broken data.

So I tried to lock file occupation in some ways.