Fixes#10783
Check and Repair tool doesn't fix bad references when the reference handle is an empty string.
Found when rewriting the backlinks scan on same tool. I assumed that the prior checks had already corrected any bad forward references, and did not put in a test for them in my new code. The Travis test failed and when I debugged, I found that the tool had an exception on a handle that consisted of an empty string.
Its interesting to note that when I changed the code, a lot more citation and source references were fixed in the test.
Fixes#10618
* Speed up Check and Repair, backlinks check stage.
* Fix Check and repair; backlinks scan to deal with bad references
which should have been fixed in earlier checks!
Python 3.6 and above has deprecated illegal string escape sequences. Escape sequences are preceded by a '\' and valid ones are "\n\t\r" etc. Illegal ones are not in the list https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals.
Previous to Python 3.6 these illegal sequences were ignored and the '\' was left in place. Pylint has been noting these for a while now.
This PR corrects these sequences in Gramps. I used
find . -name "*.py" | xargs -t -n 1 python3 -Wd -m py_compile 2>&1 | grep Depre
to locate the failing strings.
state & get_primary_mask(another) tested (state & (primary | other)),
which will be true if state matches *either* primary *or* other, but
what is wanted in a not-negated test is state matching all bits of
(primary | other). match_primary_mask does that.
On the other hand there are also cases of "not state & (primary | other)".
no_match_primary_mask handles that, returning true if state matches none
of the bits in (primary | other).
Fixes#10646.