It is not a bug. Python displays \ as \\

sage: '\\'
'\\'
sage: len('\\')
1

What is wrong is that you should not copy paste this string to another software but instead do

sage: print G.sparse6_string()
:~?@M_GEA_w?C`WGEaOOGaWWI_OmGBGKL`w}OcXINCxQGCPUWCp]WdPeOEh[Zc`q^Fh}_gXwagyAfGaYfhAa^IYEgIyqlji}ojREqfa{rlbCtljKvjbatMYWv_Jq|hBy{hSAdn{M\OCRAeRtEa_wVlSHBhagjkBgzpCY}OSr

Vincent

On 02/06/2017 23:21, J Kinable wrote:
There seems to be a bug in the sparse6 string generator.

sage: G=graphs.EllinghamHorton78Graph()
sage: G.sparse6_string()
':~?@M_GEA_w?C`WGEaOOGaWWI_OmGBGKL`w}OcXINCxQGCPUWCp]WdPeOEh[Zc`q^Fh}_gXwagyAfGaYfhAa^IYEgIyqlji}ojREqfa{rlbCtljKvjbatMYWv_Jq|hBy{hSAdn{M
*\\*OCRAeRtEa_wVlSHBhagjkBgzpCY}OSr'

Notice the "\\" in the above string. This should have been "\" instead,
i.e. one backslash instead of 2. Normally sparse6 encoded graphs are stored
in a "myFile.s6" file. Storing the above String in a file, and then reading
it with another piece of software produces incorrect results, due to the
additional "\".

Note however that in the following command is correct:
sage:
F=Graph(':~?@M_GEA_w?C`WGEaOOGaWWI_OmGBGKL`w}OcXINCxQGCPUWCp]WdPeOEh[Zc`q^Fh}_gXwagyAfGaYfhAa^IYEgIyqlji}ojREqfa{rlbCtljKvjbatMYWv_Jq|hBy{hSAdn{M
*\\*OCRAeRtEa_wVlSHBhagjkBgzpCY}OSr')
Here, the extra "\" is indeed required since the graph is constructed from
a String.

Joris Kinable


--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to