possible fix to
@@ -86,26 +86,29 @@ def merge_tablemaps(*maplist):
ret = big
return ret
-
def bar_escape(item):
- return str(item).replace('|', '||')
+ item = str(item).replace('|', '||')
+ if item.startswith('||'): item='\x00%s' % item
+ if item.endswith('||'): item='%s\x00' % item
+ return item
+def bar_unescape(item):
+ item = item.replace('||','|')
+ if item.startwith('\x00'): item = item[1:]
+ if item.endswith('\x00'): item = item[:-1]
+ return item
def bar_encode(items):
return '|%s|' % '|'.join(bar_escape(item) for item in items if str(item).strip())
-
def bar_decode_integer(value):
long = integer_types[-1]
if not hasattr(value, 'split') and hasattr(value, 'read'):
value = value.read()
return [long(x) for x in value.split('|') if x.strip()]
-
def bar_decode_string(value):
- return [x.replace('||', '|') for x in
- REGEX_UNPACK.split(value[1:-1]) if x.strip()]
-
+ return [bar_unescape(x) for x in REGEX_UNPACK.split(value[1:-1]) if x.strip()]
def archive_record(qset, fs, archive_table, current_record):
tablenames = qset.db._adapter.tables(qset.query)
