I suspect this is a known issue, but it just came up on the rpy2 issue tracker. On windows, argparse appears to strip double quotes out everywhere.
There is an OLD issue on the python issue tracker about problems with double quotes, but the OP couldn't reproduce. I think it's an obscure corner-case, as it's a PITA to get double-quotes to pass through the windows shell to python from the command line.
In any case, is there any interest in fixing this bug at the IPython level? I am less familiar with the nuances of argparse, so I'm starting here. Perhaps it's a bug for the core python devs.
For reference, here's an easy way to elicit the bug on windows (the error is somewhat inscrutable, but you'll see the reported R code is lacking the quotes):
In : %load_ext rpy2.ipython
In : %R formatC(c(3.24, 2.3e-6), format = "f")
Yuck. There are definitely times when we regret the way that magics mix command line syntax and programming languages.
Does this only affect magics using argparse? Can someone try on Windows with e.g. %timeit, which uses the simpler self.parse_options() mechanism.