[modwsgi] Re: WSGIScriptAlias contains russian characters in directory part

2009-07-23 Thread Graham Dumpleton

2009/7/22 Graham Dumpleton graham.dumple...@gmail.com:
 Can you try attached binary and let me know if it works. Don't have
 enough time tonight to set up example with Unicode filenames. At least
 still works for hello world with normal file names.

Unless I have done something stupid in way I am testing it, this
updated .so doesn't work. :-(

Not sure what to do next except add debugging to make sure am doing
the right thing.

Graham

 2009/7/22 Mike Plavsky supermapl...@gmail.com:

 Was using mod_wsgi 2.3, checked with mod_wsgi 2.5 and Python 2.6.1 -
 the result is the same. So yes, probably the issue is Windows
 specific. BTW do you test mod_wsgi on Windows?

 On Jul 21, 12:01 pm, Graham Dumpleton graham.dumple...@gmail.com
 wrote:
 What version of mod_wsgi are you using?

 If you are mod_wsgi 2.3 or older, ensure you upgrade to mod_wsgi 2.5.
 This will mean you will have to use Python 2.6 as no binaries for
 older Python versions.

 I cannot duplicate the problem you are having on MacOS X, with it
 working for me.

 WSGIScriptAlias /echo2 /Users/grahamd/Sites/русский апач/echo.wsgi

 SCRIPT_FILENAME:
 '/Users/grahamd/Sites/\xd1\x80\xd1\x83\xd1\x81\xd1\x81\xd0\xba\xd0\xb8\xd0\ 
 xb9
 \xd0\xb0\xd0\xbf\xd0\xb0\xd1\x87/echo.wsgi'

 I am wandering whether you are being affected by a variation of the
 configuration corruption problem for which that fopen() error was one
 of the problems seen, although the path still seems correct.

 http://code.google.com/p/modwsgi/issues/detail?id=78can=1

 It could also be that the issue is Windows specific.

 Graham

 2009/7/21 Mike Plavsky supermapl...@gmail.com:





  Good suggestion re static files. I've done it myself. And Apache works
  with no issues. So definitely it supports not only latin-1 in conf
  files. Actually the complete story was if I stored conf file as ANSI,
  Apache didn't work. It complained:

  C:\Documents and Settings\MPlavsky\My Documents\projects\русский апач
  \conf..\bi
  n\httpd.exe
  httpd.exe: Syntax error on line 1 of C:/Documents and Settings/
  MPlavsky/My Docum
  ents/projects/\xd1\x80\xd1\x83\xd1\x81\xd1\x81\xd0\xba\xd0\xb8\xd0\xb9
  \xd0\xb0\
  xd0\xbf\xd0\xb0\xd1\x87/conf/httpd.conf: ServerRoot must be a valid
  directory

  But as soon as I saved conf file as UTF8 file, Apache started working
  fine. So I was able to get this jpg for example.

 http://spb9503:8080/static/search.jpg

  Here is conf file w/o mod_wsgi:

  ServerRoot C:\Documents and Settings\MPlavsky\My Documents\projects
  \русский апач
  ServerName 'spb9503:8080'
  ServerSignature Off
  ServerTokens Prod
  DocumentRoot 'py_sa_search'
  Listen '8080'

  LoadModule wsgi_module modules/mod_wsgi.so
  LoadModule actions_module modules/mod_actions.so
  LoadModule alias_module modules/mod_alias.so
  LoadModule asis_module modules/mod_asis.so
  LoadModule dir_module modules/mod_dir.so
  LoadModule env_module modules/mod_env.so
  LoadModule log_config_module modules/mod_log_config.so
  LoadModule mime_module modules/mod_mime.so
  LoadModule setenvif_module modules/mod_setenvif.so

  Alias /static/ C:\Documents and Settings\MPlavsky\My Documents
  \projects\русский апач\py_sa_search\static\

  ErrorLog logs/error.log
  LogLevel debug
  DefaultType text/plain

  As soon as I returned mod_wsgi back, it stoped working.

  Here is conf:

  ServerRoot C:\Documents and Settings\MPlavsky\My Documents\projects
  \русский апач
  ServerName 'spb9503:8080'
  ServerSignature Off
  ServerTokens Prod
  DocumentRoot 'py_sa_search'
  Listen '8080'

  LoadModule wsgi_module modules/mod_wsgi.so
  LoadModule actions_module modules/mod_actions.so
  LoadModule alias_module modules/mod_alias.so
  LoadModule asis_module modules/mod_asis.so
  LoadModule dir_module modules/mod_dir.so
  LoadModule env_module modules/mod_env.so
  LoadModule log_config_module modules/mod_log_config.so
  LoadModule mime_module modules/mod_mime.so
  LoadModule setenvif_module modules/mod_setenvif.so

  WSGIScriptAlias / C:/Documents and Settings/MPlavsky/My Documents/
  projects/русский апач/py_sa_search/sa_search.py
  WSGIPythonPath C:/Documents and Settings/MPlavsky/My Documents/
  projects/русский апач/py_sa_search
  WSGIRestrictStdout Off

  Alias /static/ C:\Documents and Settings\MPlavsky\My Documents
  \projects\русский апач\py_sa_search\static\

  ErrorLog logs/error.log
  LogLevel debug
  DefaultType text/plain

  So IMHO Apache works great with this but mod_wsgi doesn't :(

  On Jul 18, 6:26 am, Graham Dumpleton graham.dumple...@gmail.com
  wrote:
  2009/7/17 Mike Plavsky supermapl...@gmail.com:

   Hi Guys,

   My application is located here C:\Documents and Settings\MPlavsky\My
   Documents\projects\русский апач, lats part is Russian.

   Does anyone know if it has to work? I am getting this errors:

   [Fri Jul 17 16:39:31 2009] [info] [client 10.30.36.245] mod_wsgi
   (pid=520, process='', application='spb9503:8080|'): Loading WSGI
   script 'C:/Documents and Settings/MPlavsky/My Documents/projects/
   

[modwsgi] Re: WSGIScriptAlias contains russian characters in directory part

2009-07-23 Thread Mike Plavsky

The same result. It doesn't work :( Still says fopen failed
Shouldn't you have used something like _wfopen?

On Jul 23, 11:37 am, Graham Dumpleton graham.dumple...@gmail.com
wrote:
 2009/7/22 Graham Dumpleton graham.dumple...@gmail.com:

  Can you try attached binary and let me know if it works. Don't have
  enough time tonight to set up example with Unicode filenames. At least
  still works for hello world with normal file names.

 Unless I have done something stupid in way I am testing it, this
 updated .so doesn't work. :-(

 Not sure what to do next except add debugging to make sure am doing
 the right thing.

 Graham



  2009/7/22 Mike Plavsky supermapl...@gmail.com:

  Was using mod_wsgi 2.3, checked with mod_wsgi 2.5 and Python 2.6.1 -
  the result is the same. So yes, probably the issue is Windows
  specific. BTW do you test mod_wsgi on Windows?

  On Jul 21, 12:01 pm, Graham Dumpleton graham.dumple...@gmail.com
  wrote:
  What version of mod_wsgi are you using?

  If you are mod_wsgi 2.3 or older, ensure you upgrade to mod_wsgi 2.5.
  This will mean you will have to use Python 2.6 as no binaries for
  older Python versions.

  I cannot duplicate the problem you are having on MacOS X, with it
  working for me.

  WSGIScriptAlias /echo2 /Users/grahamd/Sites/русский апач/echo.wsgi

  SCRIPT_FILENAME:
  '/Users/grahamd/Sites/\xd1\x80\xd1\x83\xd1\x81\xd1\x81\xd0\xba\xd0\xb8\xd0\
   xb9
  \xd0\xb0\xd0\xbf\xd0\xb0\xd1\x87/echo.wsgi'

  I am wandering whether you are being affected by a variation of the
  configuration corruption problem for which that fopen() error was one
  of the problems seen, although the path still seems correct.

 http://code.google.com/p/modwsgi/issues/detail?id=78can=1

  It could also be that the issue is Windows specific.

  Graham

  2009/7/21 Mike Plavsky supermapl...@gmail.com:

   Good suggestion re static files. I've done it myself. And Apache works
   with no issues. So definitely it supports not only latin-1 in conf
   files. Actually the complete story was if I stored conf file as ANSI,
   Apache didn't work. It complained:

   C:\Documents and Settings\MPlavsky\My Documents\projects\русский апач
   \conf..\bi
   n\httpd.exe
   httpd.exe: Syntax error on line 1 of C:/Documents and Settings/
   MPlavsky/My Docum
   ents/projects/\xd1\x80\xd1\x83\xd1\x81\xd1\x81\xd0\xba\xd0\xb8\xd0\xb9
   \xd0\xb0\
   xd0\xbf\xd0\xb0\xd1\x87/conf/httpd.conf: ServerRoot must be a valid
   directory

   But as soon as I saved conf file as UTF8 file, Apache started working
   fine. So I was able to get this jpg for example.

  http://spb9503:8080/static/search.jpg

   Here is conf file w/o mod_wsgi:

   ServerRoot C:\Documents and Settings\MPlavsky\My Documents\projects
   \русский апач
   ServerName 'spb9503:8080'
   ServerSignature Off
   ServerTokens Prod
   DocumentRoot 'py_sa_search'
   Listen '8080'

   LoadModule wsgi_module modules/mod_wsgi.so
   LoadModule actions_module modules/mod_actions.so
   LoadModule alias_module modules/mod_alias.so
   LoadModule asis_module modules/mod_asis.so
   LoadModule dir_module modules/mod_dir.so
   LoadModule env_module modules/mod_env.so
   LoadModule log_config_module modules/mod_log_config.so
   LoadModule mime_module modules/mod_mime.so
   LoadModule setenvif_module modules/mod_setenvif.so

   Alias /static/ C:\Documents and Settings\MPlavsky\My Documents
   \projects\русский апач\py_sa_search\static\

   ErrorLog logs/error.log
   LogLevel debug
   DefaultType text/plain

   As soon as I returned mod_wsgi back, it stoped working.

   Here is conf:

   ServerRoot C:\Documents and Settings\MPlavsky\My Documents\projects
   \русский апач
   ServerName 'spb9503:8080'
   ServerSignature Off
   ServerTokens Prod
   DocumentRoot 'py_sa_search'
   Listen '8080'

   LoadModule wsgi_module modules/mod_wsgi.so
   LoadModule actions_module modules/mod_actions.so
   LoadModule alias_module modules/mod_alias.so
   LoadModule asis_module modules/mod_asis.so
   LoadModule dir_module modules/mod_dir.so
   LoadModule env_module modules/mod_env.so
   LoadModule log_config_module modules/mod_log_config.so
   LoadModule mime_module modules/mod_mime.so
   LoadModule setenvif_module modules/mod_setenvif.so

   WSGIScriptAlias / C:/Documents and Settings/MPlavsky/My Documents/
   projects/русский апач/py_sa_search/sa_search.py
   WSGIPythonPath C:/Documents and Settings/MPlavsky/My Documents/
   projects/русский апач/py_sa_search
   WSGIRestrictStdout Off

   Alias /static/ C:\Documents and Settings\MPlavsky\My Documents
   \projects\русский апач\py_sa_search\static\

   ErrorLog logs/error.log
   LogLevel debug
   DefaultType text/plain

   So IMHO Apache works great with this but mod_wsgi doesn't :(

   On Jul 18, 6:26 am, Graham Dumpleton graham.dumple...@gmail.com
   wrote:
   2009/7/17 Mike Plavsky supermapl...@gmail.com:

Hi Guys,

My application is located here C:\Documents and Settings\MPlavsky\My
Documents\projects\русский апач, lats part is 

[modwsgi] Re: WSGIScriptAlias contains russian characters in directory part

2009-07-23 Thread Graham Dumpleton

2009/7/23 Graham Dumpleton graham.dumple...@gmail.com:
 2009/7/23 Mike Plavsky supermapl...@gmail.com:

 The same result. It doesn't work :( Still says fopen failed
 Shouldn't you have used something like _wfopen?

 I did use _wfopen(). The fopen() message is mine and I didn't distinguish.

 I think I know what the issue is. The filename string at that point
 isn't actually UTF-8, but an ASCII representation of it, with values
 greater than 127, represented as \xnn.

Actually, it is the Apache error logging functions which do that. The
raw value looks correct:

FILENAME='C:/Program Files/Apache Software
Foundation/Apache2.2/htdocs/русский апач/hello.wsgi'

If you stick that in Windows Explorer, it will correctly open it.

So, even more confused now as to why it isn't working.

Graham

 This is why it displays that
 way in the log file. If it was UTF-8, then one would expect it to
 display correctly in the log file. I can only think at this point that
 for case where system has Unicode filesystem paths that Apache
 represents filenames that way.

 Anyway, am going to try with the utf8_to_unicode_path() function that
 Apache itself uses to decode the filenames. Hope to know whether this
 works in about an hour or so.

 Graham

 On Jul 23, 11:37 am, Graham Dumpleton graham.dumple...@gmail.com
 wrote:
 2009/7/22 Graham Dumpleton graham.dumple...@gmail.com:

  Can you try attached binary and let me know if it works. Don't have
  enough time tonight to set up example with Unicode filenames. At least
  still works for hello world with normal file names.

 Unless I have done something stupid in way I am testing it, this
 updated .so doesn't work. :-(

 Not sure what to do next except add debugging to make sure am doing
 the right thing.

 Graham



  2009/7/22 Mike Plavsky supermapl...@gmail.com:

  Was using mod_wsgi 2.3, checked with mod_wsgi 2.5 and Python 2.6.1 -
  the result is the same. So yes, probably the issue is Windows
  specific. BTW do you test mod_wsgi on Windows?

  On Jul 21, 12:01 pm, Graham Dumpleton graham.dumple...@gmail.com
  wrote:
  What version of mod_wsgi are you using?

  If you are mod_wsgi 2.3 or older, ensure you upgrade to mod_wsgi 2.5.
  This will mean you will have to use Python 2.6 as no binaries for
  older Python versions.

  I cannot duplicate the problem you are having on MacOS X, with it
  working for me.

  WSGIScriptAlias /echo2 /Users/grahamd/Sites/русский апач/echo.wsgi

  SCRIPT_FILENAME:
  '/Users/grahamd/Sites/\xd1\x80\xd1\x83\xd1\x81\xd1\x81\xd0\xba\xd0\xb8\xd0\
   xb9
  \xd0\xb0\xd0\xbf\xd0\xb0\xd1\x87/echo.wsgi'

  I am wandering whether you are being affected by a variation of the
  configuration corruption problem for which that fopen() error was one
  of the problems seen, although the path still seems correct.

 http://code.google.com/p/modwsgi/issues/detail?id=78can=1

  It could also be that the issue is Windows specific.

  Graham

  2009/7/21 Mike Plavsky supermapl...@gmail.com:

   Good suggestion re static files. I've done it myself. And Apache works
   with no issues. So definitely it supports not only latin-1 in conf
   files. Actually the complete story was if I stored conf file as ANSI,
   Apache didn't work. It complained:

   C:\Documents and Settings\MPlavsky\My Documents\projects\русский апач
   \conf..\bi
   n\httpd.exe
   httpd.exe: Syntax error on line 1 of C:/Documents and Settings/
   MPlavsky/My Docum
   ents/projects/\xd1\x80\xd1\x83\xd1\x81\xd1\x81\xd0\xba\xd0\xb8\xd0\xb9
   \xd0\xb0\
   xd0\xbf\xd0\xb0\xd1\x87/conf/httpd.conf: ServerRoot must be a valid
   directory

   But as soon as I saved conf file as UTF8 file, Apache started working
   fine. So I was able to get this jpg for example.

  http://spb9503:8080/static/search.jpg

   Here is conf file w/o mod_wsgi:

   ServerRoot C:\Documents and Settings\MPlavsky\My Documents\projects
   \русский апач
   ServerName 'spb9503:8080'
   ServerSignature Off
   ServerTokens Prod
   DocumentRoot 'py_sa_search'
   Listen '8080'

   LoadModule wsgi_module modules/mod_wsgi.so
   LoadModule actions_module modules/mod_actions.so
   LoadModule alias_module modules/mod_alias.so
   LoadModule asis_module modules/mod_asis.so
   LoadModule dir_module modules/mod_dir.so
   LoadModule env_module modules/mod_env.so
   LoadModule log_config_module modules/mod_log_config.so
   LoadModule mime_module modules/mod_mime.so
   LoadModule setenvif_module modules/mod_setenvif.so

   Alias /static/ C:\Documents and Settings\MPlavsky\My Documents
   \projects\русский апач\py_sa_search\static\

   ErrorLog logs/error.log
   LogLevel debug
   DefaultType text/plain

   As soon as I returned mod_wsgi back, it stoped working.

   Here is conf:

   ServerRoot C:\Documents and Settings\MPlavsky\My Documents\projects
   \русский апач
   ServerName 'spb9503:8080'
   ServerSignature Off
   ServerTokens Prod
   DocumentRoot 'py_sa_search'
   Listen '8080'

   LoadModule wsgi_module modules/mod_wsgi.so
   LoadModule 

[modwsgi] Re: WSGIScriptAlias contains russian characters in directory part

2009-07-22 Thread Nimrod A. Abing

On Wed, Jul 22, 2009 at 8:17 PM, Graham
Dumpletongraham.dumple...@gmail.com wrote:

 2009/7/22 Nimrod A. Abing nimrod.ab...@gmail.com:

 2009/7/22 Graham Dumpleton graham.dumple...@gmail.com:

 2009/7/22 Mike Plavsky supermapl...@gmail.com:

 Was using mod_wsgi 2.3, checked with mod_wsgi 2.5 and Python 2.6.1 -
 the result is the same. So yes, probably the issue is Windows
 specific. BTW do you test mod_wsgi on Windows?

 I have only recently starting compiling mod_wsgi on Windows myself.
 About all I do is a hello world test. Bulk of recent changes are to
 daemon mode and so aren't relevant to Windows.

 At a guess, I would say that the problem is that I am using plain old
 fopen(). Apache on the other hand uses apr_file_open() which on
 Windows does some madness with converting path from UTF-8 to Unicode
 and then using CreateFileW().

 The problem is that PyParser_SimpleParseFile(), as used by mod_wsgi,
 in Python expects a FILE pointer. I am not sure I can get a FILE
 pointer out of the native OS file handle that would be created by
 apr_file_open()/CreateFileW() on Windows.

 The question is, if one passed UTF-8 string file filename to fopen()
 on Windows, what happens? Should I be converting the UTF-8 string to
 Unicode and using _wfopen() instead?

 The APR library has a semi private function utf8_to_unicode_path()
 which they use for doing this, but is there an official Window
 function that can use to convert UTF-8 string to wide string for
 _wfopen().

 Anyone with Windows programming knowledge who can advise what should be 
 done?


 _wfopen() and fopen() are deprecated Win32 CRT functions. Use
 _wfopen_s() and fopen_s() instead. As for converting between UTF-8 and
 wchar_t it needs a bit of strong arming to get it done and normally
 you would just use iconv for it but there is a lightweight library for
 doing just that: http://www.bsdua.org/libbsdua.html#utf8

 How about mbstowcs(). That is what I already use for a few things for
 Python 3.X support.

That should work too and is locale aware, but that's also deprecated.
Use mbstowcs_s instead. I think for string functions you are
recommended to use the *_s versions now. I posted the other
lightweight utf8 conversion lib because I was considering portability.
-- 
Best Regards,
Nimrod A. Abing

W http://arsenic.ph/
W http://preownedcar.com/
W http://preownedbike.com/
W http://abing.gotdns.com/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modwsgi@googlegroups.com
To unsubscribe from this group, send email to 
modwsgi+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en
-~--~~~~--~~--~--~---



[modwsgi] Re: WSGIScriptAlias contains russian characters in directory part

2009-07-22 Thread Graham Dumpleton

2009/7/23 Nimrod A. Abing nimrod.ab...@gmail.com:

 On Wed, Jul 22, 2009 at 8:17 PM, Graham
 Dumpletongraham.dumple...@gmail.com wrote:

 2009/7/22 Nimrod A. Abing nimrod.ab...@gmail.com:

 2009/7/22 Graham Dumpleton graham.dumple...@gmail.com:

 2009/7/22 Mike Plavsky supermapl...@gmail.com:

 Was using mod_wsgi 2.3, checked with mod_wsgi 2.5 and Python 2.6.1 -
 the result is the same. So yes, probably the issue is Windows
 specific. BTW do you test mod_wsgi on Windows?

 I have only recently starting compiling mod_wsgi on Windows myself.
 About all I do is a hello world test. Bulk of recent changes are to
 daemon mode and so aren't relevant to Windows.

 At a guess, I would say that the problem is that I am using plain old
 fopen(). Apache on the other hand uses apr_file_open() which on
 Windows does some madness with converting path from UTF-8 to Unicode
 and then using CreateFileW().

 The problem is that PyParser_SimpleParseFile(), as used by mod_wsgi,
 in Python expects a FILE pointer. I am not sure I can get a FILE
 pointer out of the native OS file handle that would be created by
 apr_file_open()/CreateFileW() on Windows.

 The question is, if one passed UTF-8 string file filename to fopen()
 on Windows, what happens? Should I be converting the UTF-8 string to
 Unicode and using _wfopen() instead?

 The APR library has a semi private function utf8_to_unicode_path()
 which they use for doing this, but is there an official Window
 function that can use to convert UTF-8 string to wide string for
 _wfopen().

 Anyone with Windows programming knowledge who can advise what should be 
 done?


 _wfopen() and fopen() are deprecated Win32 CRT functions. Use
 _wfopen_s() and fopen_s() instead. As for converting between UTF-8 and
 wchar_t it needs a bit of strong arming to get it done and normally
 you would just use iconv for it but there is a lightweight library for
 doing just that: http://www.bsdua.org/libbsdua.html#utf8

 How about mbstowcs(). That is what I already use for a few things for
 Python 3.X support.

 That should work too and is locale aware, but that's also deprecated.
 Use mbstowcs_s instead. I think for string functions you are
 recommended to use the *_s versions now. I posted the other
 lightweight utf8 conversion lib because I was considering portability.

Only need it on Windows and even though deprecated, isn't going to go
away. Python itself internally uses these functions still as well.

Graham

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modwsgi@googlegroups.com
To unsubscribe from this group, send email to 
modwsgi+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en
-~--~~~~--~~--~--~---



[modwsgi] Re: WSGIScriptAlias contains russian characters in directory part

2009-07-21 Thread Graham Dumpleton

What version of mod_wsgi are you using?

If you are mod_wsgi 2.3 or older, ensure you upgrade to mod_wsgi 2.5.
This will mean you will have to use Python 2.6 as no binaries for
older Python versions.

I cannot duplicate the problem you are having on MacOS X, with it
working for me.

WSGIScriptAlias /echo2 /Users/grahamd/Sites/русский апач/echo.wsgi

SCRIPT_FILENAME:
'/Users/grahamd/Sites/\xd1\x80\xd1\x83\xd1\x81\xd1\x81\xd0\xba\xd0\xb8\xd0\xb9
\xd0\xb0\xd0\xbf\xd0\xb0\xd1\x87/echo.wsgi'

I am wandering whether you are being affected by a variation of the
configuration corruption problem for which that fopen() error was one
of the problems seen, although the path still seems correct.

http://code.google.com/p/modwsgi/issues/detail?id=78can=1

It could also be that the issue is Windows specific.

Graham

2009/7/21 Mike Plavsky supermapl...@gmail.com:

 Good suggestion re static files. I've done it myself. And Apache works
 with no issues. So definitely it supports not only latin-1 in conf
 files. Actually the complete story was if I stored conf file as ANSI,
 Apache didn't work. It complained:

 C:\Documents and Settings\MPlavsky\My Documents\projects\русский апач
 \conf..\bi
 n\httpd.exe
 httpd.exe: Syntax error on line 1 of C:/Documents and Settings/
 MPlavsky/My Docum
 ents/projects/\xd1\x80\xd1\x83\xd1\x81\xd1\x81\xd0\xba\xd0\xb8\xd0\xb9
 \xd0\xb0\
 xd0\xbf\xd0\xb0\xd1\x87/conf/httpd.conf: ServerRoot must be a valid
 directory

 But as soon as I saved conf file as UTF8 file, Apache started working
 fine. So I was able to get this jpg for example.

 http://spb9503:8080/static/search.jpg

 Here is conf file w/o mod_wsgi:

 ServerRoot C:\Documents and Settings\MPlavsky\My Documents\projects
 \русский апач
 ServerName 'spb9503:8080'
 ServerSignature Off
 ServerTokens Prod
 DocumentRoot 'py_sa_search'
 Listen '8080'

 LoadModule wsgi_module modules/mod_wsgi.so
 LoadModule actions_module modules/mod_actions.so
 LoadModule alias_module modules/mod_alias.so
 LoadModule asis_module modules/mod_asis.so
 LoadModule dir_module modules/mod_dir.so
 LoadModule env_module modules/mod_env.so
 LoadModule log_config_module modules/mod_log_config.so
 LoadModule mime_module modules/mod_mime.so
 LoadModule setenvif_module modules/mod_setenvif.so

 Alias /static/ C:\Documents and Settings\MPlavsky\My Documents
 \projects\русский апач\py_sa_search\static\

 ErrorLog logs/error.log
 LogLevel debug
 DefaultType text/plain

 As soon as I returned mod_wsgi back, it stoped working.

 Here is conf:

 ServerRoot C:\Documents and Settings\MPlavsky\My Documents\projects
 \русский апач
 ServerName 'spb9503:8080'
 ServerSignature Off
 ServerTokens Prod
 DocumentRoot 'py_sa_search'
 Listen '8080'

 LoadModule wsgi_module modules/mod_wsgi.so
 LoadModule actions_module modules/mod_actions.so
 LoadModule alias_module modules/mod_alias.so
 LoadModule asis_module modules/mod_asis.so
 LoadModule dir_module modules/mod_dir.so
 LoadModule env_module modules/mod_env.so
 LoadModule log_config_module modules/mod_log_config.so
 LoadModule mime_module modules/mod_mime.so
 LoadModule setenvif_module modules/mod_setenvif.so

 WSGIScriptAlias / C:/Documents and Settings/MPlavsky/My Documents/
 projects/русский апач/py_sa_search/sa_search.py
 WSGIPythonPath C:/Documents and Settings/MPlavsky/My Documents/
 projects/русский апач/py_sa_search
 WSGIRestrictStdout Off

 Alias /static/ C:\Documents and Settings\MPlavsky\My Documents
 \projects\русский апач\py_sa_search\static\

 ErrorLog logs/error.log
 LogLevel debug
 DefaultType text/plain

 So IMHO Apache works great with this but mod_wsgi doesn't :(

 On Jul 18, 6:26 am, Graham Dumpleton graham.dumple...@gmail.com
 wrote:
 2009/7/17 Mike Plavsky supermapl...@gmail.com:







  Hi Guys,

  My application is located here C:\Documents and Settings\MPlavsky\My
  Documents\projects\русский апач, lats part is Russian.

  Does anyone know if it has to work? I am getting this errors:

  [Fri Jul 17 16:39:31 2009] [info] [client 10.30.36.245] mod_wsgi
  (pid=520, process='', application='spb9503:8080|'): Loading WSGI
  script 'C:/Documents and Settings/MPlavsky/My Documents/projects/
  \xd1\x80\xd1\x83\xd1\x81\xd1\x81\xd0\xba\xd0\xb8\xd0\xb9
  \xd0\xb0\xd0\xbf\xd0\xb0\xd1\x87/py_sa_search/sa_search.py'.
  [Fri Jul 17 16:39:31 2009] [error] [client 10.30.36.245] (2)No such
  file or directory: mod_wsgi (pid=520, process='',
  application='spb9503:8080|'): Call to fopen() failed for 'C:/Documents
  and Settings/MPlavsky/My Documents/projects/
  \xd1\x80\xd1\x83\xd1\x81\xd1\x81\xd0\xba\xd0\xb8\xd0\xb9
  \xd0\xb0\xd0\xbf\xd0\xb0\xd1\x87/py_sa_search/sa_search.py'.
  [Fri Jul 17 16:39:31 2009] [error] [client 10.30.36.245] mod_wsgi
  (pid=520): Exception occurred processing WSGI script 'C:/Documents and
  Settings/MPlavsky/My Documents/projects/
  \xd1\x80\xd1\x83\xd1\x81\xd1\x81\xd0\xba\xd0\xb8\xd0\xb9
  \xd0\xb0\xd0\xbf\xd0\xb0\xd1\x87/py_sa_search/sa_search.py'.

  You see, Russian characters are UTF8 encoded. Is 

[modwsgi] Re: WSGIScriptAlias contains russian characters in directory part

2009-07-21 Thread Mike Plavsky

Was using mod_wsgi 2.3, checked with mod_wsgi 2.5 and Python 2.6.1 -
the result is the same. So yes, probably the issue is Windows
specific. BTW do you test mod_wsgi on Windows?

On Jul 21, 12:01 pm, Graham Dumpleton graham.dumple...@gmail.com
wrote:
 What version of mod_wsgi are you using?

 If you are mod_wsgi 2.3 or older, ensure you upgrade to mod_wsgi 2.5.
 This will mean you will have to use Python 2.6 as no binaries for
 older Python versions.

 I cannot duplicate the problem you are having on MacOS X, with it
 working for me.

 WSGIScriptAlias /echo2 /Users/grahamd/Sites/русский апач/echo.wsgi

 SCRIPT_FILENAME:
 '/Users/grahamd/Sites/\xd1\x80\xd1\x83\xd1\x81\xd1\x81\xd0\xba\xd0\xb8\xd0\ 
 xb9
 \xd0\xb0\xd0\xbf\xd0\xb0\xd1\x87/echo.wsgi'

 I am wandering whether you are being affected by a variation of the
 configuration corruption problem for which that fopen() error was one
 of the problems seen, although the path still seems correct.

 http://code.google.com/p/modwsgi/issues/detail?id=78can=1

 It could also be that the issue is Windows specific.

 Graham

 2009/7/21 Mike Plavsky supermapl...@gmail.com:





  Good suggestion re static files. I've done it myself. And Apache works
  with no issues. So definitely it supports not only latin-1 in conf
  files. Actually the complete story was if I stored conf file as ANSI,
  Apache didn't work. It complained:

  C:\Documents and Settings\MPlavsky\My Documents\projects\русский апач
  \conf..\bi
  n\httpd.exe
  httpd.exe: Syntax error on line 1 of C:/Documents and Settings/
  MPlavsky/My Docum
  ents/projects/\xd1\x80\xd1\x83\xd1\x81\xd1\x81\xd0\xba\xd0\xb8\xd0\xb9
  \xd0\xb0\
  xd0\xbf\xd0\xb0\xd1\x87/conf/httpd.conf: ServerRoot must be a valid
  directory

  But as soon as I saved conf file as UTF8 file, Apache started working
  fine. So I was able to get this jpg for example.

 http://spb9503:8080/static/search.jpg

  Here is conf file w/o mod_wsgi:

  ServerRoot C:\Documents and Settings\MPlavsky\My Documents\projects
  \русский апач
  ServerName 'spb9503:8080'
  ServerSignature Off
  ServerTokens Prod
  DocumentRoot 'py_sa_search'
  Listen '8080'

  LoadModule wsgi_module modules/mod_wsgi.so
  LoadModule actions_module modules/mod_actions.so
  LoadModule alias_module modules/mod_alias.so
  LoadModule asis_module modules/mod_asis.so
  LoadModule dir_module modules/mod_dir.so
  LoadModule env_module modules/mod_env.so
  LoadModule log_config_module modules/mod_log_config.so
  LoadModule mime_module modules/mod_mime.so
  LoadModule setenvif_module modules/mod_setenvif.so

  Alias /static/ C:\Documents and Settings\MPlavsky\My Documents
  \projects\русский апач\py_sa_search\static\

  ErrorLog logs/error.log
  LogLevel debug
  DefaultType text/plain

  As soon as I returned mod_wsgi back, it stoped working.

  Here is conf:

  ServerRoot C:\Documents and Settings\MPlavsky\My Documents\projects
  \русский апач
  ServerName 'spb9503:8080'
  ServerSignature Off
  ServerTokens Prod
  DocumentRoot 'py_sa_search'
  Listen '8080'

  LoadModule wsgi_module modules/mod_wsgi.so
  LoadModule actions_module modules/mod_actions.so
  LoadModule alias_module modules/mod_alias.so
  LoadModule asis_module modules/mod_asis.so
  LoadModule dir_module modules/mod_dir.so
  LoadModule env_module modules/mod_env.so
  LoadModule log_config_module modules/mod_log_config.so
  LoadModule mime_module modules/mod_mime.so
  LoadModule setenvif_module modules/mod_setenvif.so

  WSGIScriptAlias / C:/Documents and Settings/MPlavsky/My Documents/
  projects/русский апач/py_sa_search/sa_search.py
  WSGIPythonPath C:/Documents and Settings/MPlavsky/My Documents/
  projects/русский апач/py_sa_search
  WSGIRestrictStdout Off

  Alias /static/ C:\Documents and Settings\MPlavsky\My Documents
  \projects\русский апач\py_sa_search\static\

  ErrorLog logs/error.log
  LogLevel debug
  DefaultType text/plain

  So IMHO Apache works great with this but mod_wsgi doesn't :(

  On Jul 18, 6:26 am, Graham Dumpleton graham.dumple...@gmail.com
  wrote:
  2009/7/17 Mike Plavsky supermapl...@gmail.com:

   Hi Guys,

   My application is located here C:\Documents and Settings\MPlavsky\My
   Documents\projects\русский апач, lats part is Russian.

   Does anyone know if it has to work? I am getting this errors:

   [Fri Jul 17 16:39:31 2009] [info] [client 10.30.36.245] mod_wsgi
   (pid=520, process='', application='spb9503:8080|'): Loading WSGI
   script 'C:/Documents and Settings/MPlavsky/My Documents/projects/
   \xd1\x80\xd1\x83\xd1\x81\xd1\x81\xd0\xba\xd0\xb8\xd0\xb9
   \xd0\xb0\xd0\xbf\xd0\xb0\xd1\x87/py_sa_search/sa_search.py'.
   [Fri Jul 17 16:39:31 2009] [error] [client 10.30.36.245] (2)No such
   file or directory: mod_wsgi (pid=520, process='',
   application='spb9503:8080|'): Call to fopen() failed for 'C:/Documents
   and Settings/MPlavsky/My Documents/projects/
   \xd1\x80\xd1\x83\xd1\x81\xd1\x81\xd0\xba\xd0\xb8\xd0\xb9
   \xd0\xb0\xd0\xbf\xd0\xb0\xd1\x87/py_sa_search/sa_search.py'.
   

[modwsgi] Re: WSGIScriptAlias contains russian characters in directory part

2009-07-21 Thread Graham Dumpleton

2009/7/22 Mike Plavsky supermapl...@gmail.com:

 Was using mod_wsgi 2.3, checked with mod_wsgi 2.5 and Python 2.6.1 -
 the result is the same. So yes, probably the issue is Windows
 specific. BTW do you test mod_wsgi on Windows?

I have only recently starting compiling mod_wsgi on Windows myself.
About all I do is a hello world test. Bulk of recent changes are to
daemon mode and so aren't relevant to Windows.

At a guess, I would say that the problem is that I am using plain old
fopen(). Apache on the other hand uses apr_file_open() which on
Windows does some madness with converting path from UTF-8 to Unicode
and then using CreateFileW().

The problem is that PyParser_SimpleParseFile(), as used by mod_wsgi,
in Python expects a FILE pointer. I am not sure I can get a FILE
pointer out of the native OS file handle that would be created by
apr_file_open()/CreateFileW() on Windows.

The question is, if one passed UTF-8 string file filename to fopen()
on Windows, what happens? Should I be converting the UTF-8 string to
Unicode and using _wfopen() instead?

The APR library has a semi private function utf8_to_unicode_path()
which they use for doing this, but is there an official Window
function that can use to convert UTF-8 string to wide string for
_wfopen().

Anyone with Windows programming knowledge who can advise what should be done?

Graham

 On Jul 21, 12:01 pm, Graham Dumpleton graham.dumple...@gmail.com
 wrote:
 What version of mod_wsgi are you using?

 If you are mod_wsgi 2.3 or older, ensure you upgrade to mod_wsgi 2.5.
 This will mean you will have to use Python 2.6 as no binaries for
 older Python versions.

 I cannot duplicate the problem you are having on MacOS X, with it
 working for me.

 WSGIScriptAlias /echo2 /Users/grahamd/Sites/русский апач/echo.wsgi

 SCRIPT_FILENAME:
 '/Users/grahamd/Sites/\xd1\x80\xd1\x83\xd1\x81\xd1\x81\xd0\xba\xd0\xb8\xd0\ 
 xb9
 \xd0\xb0\xd0\xbf\xd0\xb0\xd1\x87/echo.wsgi'

 I am wandering whether you are being affected by a variation of the
 configuration corruption problem for which that fopen() error was one
 of the problems seen, although the path still seems correct.

 http://code.google.com/p/modwsgi/issues/detail?id=78can=1

 It could also be that the issue is Windows specific.

 Graham

 2009/7/21 Mike Plavsky supermapl...@gmail.com:





  Good suggestion re static files. I've done it myself. And Apache works
  with no issues. So definitely it supports not only latin-1 in conf
  files. Actually the complete story was if I stored conf file as ANSI,
  Apache didn't work. It complained:

  C:\Documents and Settings\MPlavsky\My Documents\projects\русский апач
  \conf..\bi
  n\httpd.exe
  httpd.exe: Syntax error on line 1 of C:/Documents and Settings/
  MPlavsky/My Docum
  ents/projects/\xd1\x80\xd1\x83\xd1\x81\xd1\x81\xd0\xba\xd0\xb8\xd0\xb9
  \xd0\xb0\
  xd0\xbf\xd0\xb0\xd1\x87/conf/httpd.conf: ServerRoot must be a valid
  directory

  But as soon as I saved conf file as UTF8 file, Apache started working
  fine. So I was able to get this jpg for example.

 http://spb9503:8080/static/search.jpg

  Here is conf file w/o mod_wsgi:

  ServerRoot C:\Documents and Settings\MPlavsky\My Documents\projects
  \русский апач
  ServerName 'spb9503:8080'
  ServerSignature Off
  ServerTokens Prod
  DocumentRoot 'py_sa_search'
  Listen '8080'

  LoadModule wsgi_module modules/mod_wsgi.so
  LoadModule actions_module modules/mod_actions.so
  LoadModule alias_module modules/mod_alias.so
  LoadModule asis_module modules/mod_asis.so
  LoadModule dir_module modules/mod_dir.so
  LoadModule env_module modules/mod_env.so
  LoadModule log_config_module modules/mod_log_config.so
  LoadModule mime_module modules/mod_mime.so
  LoadModule setenvif_module modules/mod_setenvif.so

  Alias /static/ C:\Documents and Settings\MPlavsky\My Documents
  \projects\русский апач\py_sa_search\static\

  ErrorLog logs/error.log
  LogLevel debug
  DefaultType text/plain

  As soon as I returned mod_wsgi back, it stoped working.

  Here is conf:

  ServerRoot C:\Documents and Settings\MPlavsky\My Documents\projects
  \русский апач
  ServerName 'spb9503:8080'
  ServerSignature Off
  ServerTokens Prod
  DocumentRoot 'py_sa_search'
  Listen '8080'

  LoadModule wsgi_module modules/mod_wsgi.so
  LoadModule actions_module modules/mod_actions.so
  LoadModule alias_module modules/mod_alias.so
  LoadModule asis_module modules/mod_asis.so
  LoadModule dir_module modules/mod_dir.so
  LoadModule env_module modules/mod_env.so
  LoadModule log_config_module modules/mod_log_config.so
  LoadModule mime_module modules/mod_mime.so
  LoadModule setenvif_module modules/mod_setenvif.so

  WSGIScriptAlias / C:/Documents and Settings/MPlavsky/My Documents/
  projects/русский апач/py_sa_search/sa_search.py
  WSGIPythonPath C:/Documents and Settings/MPlavsky/My Documents/
  projects/русский апач/py_sa_search
  WSGIRestrictStdout Off

  Alias /static/ C:\Documents and Settings\MPlavsky\My Documents
  \projects\русский