Announcement Announcement Module
Collapse
No announcement yet.
Apache/Mod-WSGI incompatibility Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Apache/Mod-WSGI incompatibility

    Hi,

    I have springpython 1.0.0 RC1 running on an Apache/Mod-WSGI installation.
    The default policy of mod_wsgi is to restrict stdin/stdout/stderr as an application should not require to read/write on these filehandles.

    As springpython uses amara (and amara uses 4suite-xml) the problematic part is

    Ft/Xml/Sax.py", line 247

    where 4suite-xml initializes a SaxPrinter with default filehandle sys.stdout.

    Not really a direct springpython/4suite-xml/mod_wsgi problem
    But it's one

    Current workaround:

    Set "WSGIRestrictStdout Off" in the Apache central module config.

    4suite-xml: 1.0.2-5
    OS: Debian Etch

    Regards

    Sven

  • #2
    Swen,

    I'm glad you found a work around. I have posted a comment on the 4Suite-XML mailing list, linking back to this discussion thread. To be honest, I haven't actually used Spring Python in an apache configuration, so I'm eager to see that it works out well.

    Comment


    • #3
      Originally posted by swilhelm View Post
      Hi,

      I have springpython 1.0.0 RC1 running on an Apache/Mod-WSGI installation.
      The default policy of mod_wsgi is to restrict stdin/stdout/stderr as an application should not require to read/write on these filehandles.

      As springpython uses amara (and amara uses 4suite-xml) the problematic part is

      Ft/Xml/Sax.py", line 247

      where 4suite-xml initializes a SaxPrinter with default filehandle sys.stdout.

      Not really a direct springpython/4suite-xml/mod_wsgi problem
      But it's one

      Current workaround:

      Set "WSGIRestrictStdout Off" in the Apache central module config.

      4suite-xml: 1.0.2-5
      OS: Debian Etch
      I agree that an app shouldn't require use of standard file handles, but there should be no problem with optionally accessing them, and in Amara, it's optional (the default).

      Does the mod_wsgi problem manifest with an error if sys.stdout is even accessed? If so, I think that's overly harsh, and would be a problem for a lot of programs. Even if that's the case, I can place a workaround in Amara, depending on how best to send a signal to Amara through mod_wsgi. For example, is there an environment variable we could check at module level to detect mod_wsgi and avoid touching sys.stdout at all?

      Comment


      • #4
        If it makes you feel any better, there are plans to migrate from amara to elementTree. Several issues have been generated due to the C extensions in amara. a) Can't run SP in google app engine and b) can't run SP in jython.

        See http://jira.springframework.org/brow...INGPYTHONPY-98 for more info.

        Comment


        • #5
          I just configured to spring python 1.0.0 RC1 mine is running on apache/mod –wsg installation. I never thought about this problem until I read your post. but your work around is not working for me, I cant access the apache central module config to turn std out off. Isn’t there a method in spring python to change properties after configuration using after set properties command?

          Comment


          • #6
            Winterman,

            I am curious if you have the same problems working with Apache when using Spring Python 1.2.0.FINAL. There have been considerable changes made, so I don't know the status of running SP inside Apache.

            Comment

            Working...
            X