Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Deprecation warning not showing for .sage script

Hello, Sage Community!

With Sage 9.1, if I write text('$\int$', (0,0)), I get the following deprecation warning:

<input>:1: DeprecationWarning: invalid escape sequence \i
<input>:1: DeprecationWarning: invalid escape sequence \i
<input>:1: DeprecationWarning: invalid escape sequence \i
<ipython-input-2-75ff93257356>:1: DeprecationWarning: invalid escape sequence \i
  text('$\int$', (Integer(0),Integer(0)))

Of course, the solution is to use raw strings: text(r'$\int$', (0,0)).

However, if I move that same command to a .sage script--let's call it deprecation.sage---, and I call sage deprecation.sage, I don't see any warning.

Previously, I had written a whole set of Sage and LaTeX commands for writing books and articles with Sage automatic calculations. These commands should check that the code is correct and no warning is issued by Sage. My problem here is that the commands do show every other types of warning, except for this one.

My question is: Is there a way to activate deprecation warnings when executing .sage scripts?

Thanks in advance for your answers!