walidazizi / rdflib

Automatically exported from code.google.com/p/rdflib
Other
0 stars 0 forks source link

BNode value not random enough #200

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
When rdflib is used in a application that fork the current Python process, for 
exemple when using flup.server.*_fork, BNode's value generation in these 
processes:
- share the same _prefix
- use independant serial number generators that start with the same value

This means that the parent and child processes will all get the same BNode 
values.

I fixed this issue using "value = _unique_id() + str(random.randint(1, 
99999999))" but there might be a cleaner solution.

Original issue reported on code.google.com by bcq.nng@gmail.com on 23 Dec 2011 at 4:13