• Jérome Perrin's avatar
    IdTool: Handle group_id on python3 (!1980). · 1f369453
    Jérome Perrin authored
    group_id is used as key of OOBtree and as documented, it's not possible to mix
    keys that can not be compared, so we can not have a mix of string and bytes, for
    consistency with other BTrees, such as the ones used for OFS.
    
    group_id is also used in a SQL column which is BINARY, this is problematic on
    py3 because the selected values will be returned as bytes, but we expect str
    here. Because we don't want to run a data migration, we adjust the select
    methods to convert to str while selecting.
    
    Since years there was a warning that id_group must be a string, now we make it a
    bit stricter, we also enforce that the id_group is valid UTF-8.
    
    A few more tests and assertions were also added.
    1f369453
SQLNonContinuousIncreasingIdGenerator.py 13.8 KB