(core) Remaining Python 3 compatibility changes

Summary: Biggest change is turning everything to unicode

Test Plan: The tests

Reviewers: dsagal, paulfitz

Reviewed By: dsagal

Differential Revision: https://phab.getgrist.com/D2875
This commit is contained in:
Alex Hall
2021-06-24 14:23:33 +02:00
parent 1af99e9567
commit 305b133c59
30 changed files with 276 additions and 177 deletions

View File

@@ -109,8 +109,7 @@ def prepare_acl_col_renames(docmodel, useractions, col_renames_dict):
# Go through again checking if anything in ACL formulas is affected by the rename.
for rule_rec in docmodel.aclRules.all:
if rule_rec.aclFormula:
# Positions are obtained from unicode version of formulas, so that's what we must patch
formula = rule_rec.aclFormula.decode('utf8')
formula = rule_rec.aclFormula
patches = []
for entity in parse_acl_grist_entities(rule_rec.aclFormula):
@@ -129,7 +128,7 @@ def prepare_acl_col_renames(docmodel, useractions, col_renames_dict):
patches.append(patch)
replacer = textbuilder.Replacer(textbuilder.Text(formula), patches)
txt = replacer.get_text().encode('utf8')
txt = replacer.get_text()
rule_updates.append((rule_rec, {'aclFormula': txt,
'aclFormulaParsed': parse_acl_formula_json(txt)}))