I'll give it a try, and create a unit test at the same time. Should the unit tests cover other possibilites such as \t, \r and so on?

Jim

Gregory (Grisha) Trubetskoy wrote:

I think the fix to that may be inserting


<TEXT>"\\n" {
    psp_string_appendl(&PSP_PG(pycode), STATIC_STR("\\\\n"));
}


into psp_parser.l - could someone try it?

The explanation is that it looks like compile() treats '\n' specially. BTW, there may be other sequnces that it treats specially, e.g. \t ?

s = 'print """TEST\n\\n\nTEST2\n\n"""\n'
c = compile(s, "blah", "exec")
c

<code object ? at 0xb7ce5a20, file "blah", line 1>

exec c

TEST


TEST2


s2 = 'print """TEST\n\\\\n\nTEST2\n\n"""\n'
c2 = compile(s2, "blah", "exec")
exec c2

TEST
\n
TEST2



Grisha


On Tue, 8 Nov 2005, Anton Kuzmin (JIRA) wrote:

LF character
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

psp_parser: replaces "\n" on \n
LF character
---------------------------------------------

        Key: MODPYTHON-87
        URL: http://issues.apache.org/jira/browse/MODPYTHON-87
    Project: mod_python
       Type: Bug
   Versions: 3.2
Environment: Debian unstable, mod_python/3.2.0b Python/2.3.5
   Reporter: Anton Kuzmin


$ cat mptest.psp
<html>
<body>

You see (&#92;n) in the test result. If you see () then the test fails.<br />

BEGIN TEST<br />
(\n)
<br />END TEST

</body>
</html>

The result on the screen is:
You see (\n) in the test result. If you see () then the test fails.
BEGIN TEST
( )
END TEST

$ cat .htaccess
AddHandler mod_python .psp
PythonHandler mod_python.psp
PythonDebug On

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
  http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
  http://www.atlassian.com/software/jira



Reply via email to