Thanks. I love developer comments -- we've all written things like "this is hacky and ugly" in our code :)
# Note: influxdb-python first replaces each backslash in the username with two backslashes
# and because in influx queries, we have to escape each backslash, overall each backslash
# must be replaced by 4 backslashes. Yes, this is hacky and ugly.
I wrote that comment 3 years ago! It definitely took me a week or two worth of work to figure out what was happening there. The problem was exacerbated by the fact that the influx cli client then had different behaviour compared to the python client. Not sure if that has been fixed, but this isn't code that I'm really proud of. :D