On Wed, 2011-07-27 at 17:43 +0200, Hartmut Goebel wrote:
> Am 27.07.2011 17:26, schrieb Giovanni Bajo:
> > What invokation of subprocess are you thinking of?
> I'm not sure, I understood your question, but I try to answers:
> 
> If PyInstaller is installed/unpacked into
> 
>   c:\Some Ugly Path\With weird\and\Unicode\Characters  
> 
> then hookutils.django_dottedstring_imports() passes the path to
> $PYINSTALLERHOME/hooke/django-import-finder.py in an argument.
> 
> Problems may also exist in:
>       * build.checkCache(), for the users Home directory (or %APPDIR%
>         on windows) (passed as argument)
>       * configure.test_UPX() for the UPX-path (path to exec)
>       * hookutils.exec_statement() for the path of the Python
>         interpreter (path to exec)
>       * bindepend._getImports_otool(), binsdepend._getImports_ldd(),
>         bindepend.getSoname() for any some library file residing in a
>         unicode path (passed as argument)

There is no problem with non-ASCII paths. Windows have a
locale-dependent 8-bit encoding called "mbcs" that is used by default
for everything, including paths found in os.environ, through sys.argv[0]
or os.listdir. In the above case, you don't pass Unicode strings to
subprocess/spawn: you just pass them 8-bit string in mbcs encoding.

The problems only arise if there are paths which are not encodable
through mbcs. For instance, in an Italian Windows installation, mbcs is
latin-1, which can encode the full Italian language (and most
Western-European languages). But if you create a Japanese directory on a
NTFS filesystem, then you can't name that directory through latin-1, and
thus you can't encode it in a 8-bit string with mbcs. 

This means that the *whole* Win32 ANSI API can't work on that directory;
most Windows applications (included some by MS) fail to handle files in
such a directory. Python itself can't run a .py file stored in that
directory[1] (unless you use a relative path of course).

So what subprocess fixes is that it calls the Win32 Unicode API and
correctly supports Python unicode strings, in a way that you can
represent a Japanese directory on an Italian Windows correctly.

I can't think it's a problem for PyInstaller. Obviously, I can be proven
wrong, but I would like to examine a reproducible bug report to be
convinced otherwise.

[1] Hardly a surprise, given that Python 2.x on Windows doesn't even
fully work if you install it in a directory containing a space in the
path, which is embarrassing especially given that people expect to
install programs under "Program Files"...
-- 
Giovanni Bajo   ::  [email protected]
Develer S.r.l.  ::  http://www.develer.com

My Blog: http://giovanni.bajo.it

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pyinstaller?hl=en.

Reply via email to