DOT serialization issue

I have been using graph-tool for almost a year, and I noticed a strange behavior after the last update (I'm currently running version 2.27, on Ubuntu 18.04, in the pre-compiled flavor taken from your repositories). Basically, whenever I serialize a graph in ".dot" format, the file can't be parsed by dot neither can be opened with xdot.

I think that the cause of this is the serialization phase, and not any change that I may apply, since the problem presents even if I simply load and store a simple graph without performing any operation on it.

Specifically, I think that this behavior is caused by the changes introduced in the serialization phase in this commit 544e3624. The function that does the escape of a label, when the regex matches, returns the escaped string after enclosing it in double "", and such a thing is done also when serializing the label, causing the label to be enclosed in double double quotes.

I attach three files, an input example graph (in.dot), a simple script that loads the file and serialize it without performing any operation (load-and-save.py), and the output produced (out.dot). You can see how the labels that are escaped in the output file present a double enclosing double quotes (e.g. color=""0.5 0.0 1.0"").

Let me know if you are able to reproduce the problem, or if this is something that occurs only to me.

Edited by Andrea