OutputPyImage segmentation fault because of bad uuid library
python uuid library has a known bug that causes it to segv on some systems. This is breaking OutputPyImage.py on my machine at line 75:
self.file_prefix = uuid.uuid4()
Any alternative to this library?
Updated by Rogers, Chris about 12 years ago
Or just use an index; increment by 1 until file doesn't exist... so you get <tag>0.png, <tag>1.png, etc... probably easier on the eye than <tag><30 character hex string>.png or whatever
But have to say, not quite sure what the context in which you are writing is (this is a temp file stored somewhere? or this is a file user wants to read?)
Updated by Jackson, Mike about 12 years ago
No, I'm not thinking, sorry. OutputPyImage doesn't need to increment/maintain a counter. At present the UUID is created in birth if the user hasn't explicitly provided a file name prefix. This prefix is shared by all files created by this worker. The JSON documents provided as input determine the rest of the file name - and it's up to whatever creates those (e.g. ReducePyMatplotlibHistogram) to ensure any numbering scheme is applied. So,
- Just adopt a default string instead of the UUID. The user should configure it if they don't want this default (possibly, by creating their own UUID).
- Update ReducePyMatplotlibHistogram to auto-number as suggested.