{"action":"created","issue":{"url":"https://api.github.com/repos/pygraphviz/pygraphviz/issues/48","labels_url":"https://api.github.com/repos/pygraphviz/pygraphviz/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/pygraphviz/pygraphviz/issues/48/comments","events_url":"https://api.github.com/repos/pygraphviz/pygraphviz/issues/48/events","html_url":"https://github.com/pygraphviz/pygraphviz/issues/48","id":63297841,"number":48,"title":"escaping bug: \" after \\ isn't correctly escaped...","user":{"login":"joernhees","id":464192,"avatar_url":"https://avatars.githubusercontent.com/u/464192?v=3","gravatar_id":"","url":"https://api.github.com/users/joernhees","html_url":"https://github.com/joernhees","followers_url":"https://api.github.com/users/joernhees/followers","following_url":"https://api.github.com/users/joernhees/following{/other_user}","gists_url":"https://api.github.com/users/joernhees/gists{/gist_id}","starred_url":"https://api.github.com/users/joernhees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joernhees/subscriptions","organizations_url":"https://api.github.com/users/joernhees/orgs","repos_url":"https://api.github.com/users/joernhees/repos","events_url":"https://api.github.com/users/joernhees/events{/privacy}","received_events_url":"https://api.github.com/users/joernhees/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-03-20T20:05:02Z","updated_at":"2015-03-21T13:56:12Z","closed_at":null,"body":"i have a node label containing `\\\"` (so a literal `\\` followed by a `\"`) (don't ask me why, it's real world data :-/ ...)\r\n\r\n```python\r\nIn [1]: from pygraphviz import *\r\n\r\nIn [2]: g = AGraph()\r\n\r\nIn [3]: g.add_edge('foo', '\"bar\\\\\"bar\"')\r\n\r\nIn [4]: g.to_string()\r\nOut[4]: u'strict graph  {\\n\\tfoo -- \"\\\\\"bar\\\\\\\\\"bar\\\\\"\";\\n}\\n'\r\n\r\nIn [5]: print g.to_string()\r\nstrict graph  {\r\n\tfoo -- \"\\\"bar\\\\\"bar\\\"\";\r\n}\r\n```\r\n\r\nIn 5 you can see that the `\\` is correctly escaped for dot, but the following `\"` isn't and will end the node label causing the parsers to fail."},"comment":{"url":"https://api.github.com/repos/pygraphviz/pygraphviz/issues/comments/84344058","html_url":"https://github.com/pygraphviz/pygraphviz/issues/48#issuecomment-84344058","issue_url":"https://api.github.com/repos/pygraphviz/pygraphviz/issues/48","id":84344058,"user":{"login":"joernhees","id":464192,"avatar_url":"https://avatars.githubusercontent.com/u/464192?v=3","gravatar_id":"","url":"https://api.github.com/users/joernhees","html_url":"https://github.com/joernhees","followers_url":"https://api.github.com/users/joernhees/followers","following_url":"https://api.github.com/users/joernhees/following{/other_user}","gists_url":"https://api.github.com/users/joernhees/gists{/gist_id}","starred_url":"https://api.github.com/users/joernhees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joernhees/subscriptions","organizations_url":"https://api.github.com/users/joernhees/orgs","repos_url":"https://api.github.com/users/joernhees/repos","events_url":"https://api.github.com/users/joernhees/events{/privacy}","received_events_url":"https://api.github.com/users/joernhees/received_events","type":"User","site_admin":false},"created_at":"2015-03-21T13:56:12Z","updated_at":"2015-03-21T13:56:12Z","body":"Uhm, i expected pygraphviz to care about its escaping, as otherwise it would be inconsistent with other things it correctly escapes (such as the leading and ending `\"` in my first example)...\r\n\r\nAs a user of the library i expected that it hides the graphviz interna from me (such as correct graphviz specific escaping), so that i could just throw in whatever unicode string i have and it will correctly escape it as a node label. Expecting users to escape the strings themselves seems like a weird approach (you wouldn't accept a csv / json lib that asked you to please correctly escape things first, would you?)\r\n\r\nLast but not least: The graph you printed is not what i'm after either: the lower node should say: `\"bar\\\"bar\"`.\r\n\r\n(I'm not constructing this artificially, it's the RDF N3 representation of string Literals (`\"here is an english literal\"@en`) that i want to be able to distinguish from URIs (`<http://uris.are.in.brackets>`).)"}}