harlowja / fasteners

A python package that provides useful locks.
Apache License 2.0
246 stars 45 forks source link

Crash when called from Google app engine emulator (localhost). (via ctypes) #46

Closed dgaedcke closed 3 years ago

dgaedcke commented 4 years ago

Do you guys have any guess why I'm getting this crash? Or if not, is there any way to fork this library in a way that does not depend upon monotonic?

Thanks for any thoughts you have ... I'm in quite a bind:

File "/Users/dgaedcke/dev/gaeStdEndptTestcase/lib/apitools/base/py/credentials_lib.py", line 44, in import fasteners File "/Users/dgaedcke/dev/gaeStdEndptTestcase/lib/fasteners/init.py", line 23, in from fasteners.lock import locked # noqa File "/Users/dgaedcke/dev/gaeStdEndptTestcase/lib/fasteners/lock.py", line 24, in from fasteners import _utils File "/Users/dgaedcke/dev/gaeStdEndptTestcase/lib/fasteners/_utils.py", line 39, in from monotonic import monotonic as now # noqa File "/Users/dgaedcke/dev/gaeStdEndptTestcase/lib/monotonic.py", line 50, in import ctypes File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/init.py", line 29, in if int(_os.uname()[2].split('.')[0]) < 8: ValueError: invalid literal for int() with base 10: ''

psarka commented 3 years ago

Yes, it is possible, and monotinic should not be a dependency (it is only used for testing)

Scratch that, it is used in the code as well. However, monotonic time is in stdlib for 3.5+, so I guess we will not fix this, and just move to stdlib function, as the older python versions are no longer officially supported.

psarka commented 3 years ago

Done by https://github.com/harlowja/fasteners/pull/40