handling of non-ASCII filenames?

Chris Angelico rosuav at gmail.com
Wed Nov 18 15:29:24 EST 2015


On Thu, Nov 19, 2015 at 5:09 AM, Ulli Horlacher
<framstag at rus.uni-stuttgart.de> wrote:
> Chris Angelico <rosuav at gmail.com> wrote:
>
>> > As I am Python newbie I have not quite understood the Python character
>> > encoding scheme :-}
>> >
>> > Where can I find a good introduction of this topic?
>>
>> Here are a couple of articles on the basics of Unicode:
>>
>> http://www.joelonsoftware.com/articles/Unicode.html
>
> I do Unicode programming for over 20 years. So, I do have a basic
> understanding of it. I am just new to Python.

Ah, okay. When you said you didn't understand the character encoding
scheme, I thought you meant Unicode itself. In any case, I make no
apology for recommending those two articles to people... at very worst
you already know that stuff :)

>> http://nedbatchelder.com/text/unipain.html
>
> Thanks. I will read it.

That's a great talk, and has the coolness of having zero pictures on
its slides. I love it.

>> If you can use Python 3
>
> I cannot use it, because the Python compiler pyinstaller does not work
> with it on Windows:
>
> S:\python>pyinstaller.exe --onefile tk.py
> Traceback (most recent call last):
>   File "C:\Python35\Scripts\pyinstaller-script.py", line 9, in <module>
>     load_entry_point('PyInstaller==3.0', 'console_scripts', 'pyinstaller')()
>   File "c:\python35\lib\site-packages\pkg_resources\__init__.py", line 558, in l
> oad_entry_point
>     return get_distribution(dist).load_entry_point(group, name)
>   File "c:\python35\lib\site-packages\pkg_resources\__init__.py", line 2682, in
> load_entry_point
>     return ep.load()
>   File "c:\python35\lib\site-packages\pkg_resources\__init__.py", line 2355, in
> load
>     return self.resolve()
>   File "c:\python35\lib\site-packages\pkg_resources\__init__.py", line 2361, in
> resolve
>     module = __import__(self.module_name, fromlist=['__name__'], level=0)
>   File "c:\python35\lib\site-packages\PyInstaller\__main__.py", line 21, in <mod
> ule>
>     import PyInstaller.building.build_main
>   File "c:\python35\lib\site-packages\PyInstaller\building\build_main.py", line
> 31, in <module>
>     from ..depend import bindepend
>   File "c:\python35\lib\site-packages\PyInstaller\depend\bindepend.py", line 40,
>  in <module>
>     from ..utils.win32.winmanifest import RT_MANIFEST
>   File "c:\python35\lib\site-packages\PyInstaller\utils\win32\winmanifest.py", l
> ine 97, in <module>
>     from PyInstaller.utils.win32 import winresource
>   File "c:\python35\lib\site-packages\PyInstaller\utils\win32\winresource.py", l
> ine 20, in <module>
>     import pywintypes
>   File "c:\python35\lib\site-packages\win32\lib\pywintypes.py", line 124, in <mo
> dule>
>     __import_pywin32_system_module__("pywintypes", globals())
>   File "c:\python35\lib\site-packages\win32\lib\pywintypes.py", line 64, in __im
> port_pywin32_system_module__
>     import _win32sysloader
> ImportError: DLL load failed: The specified module could not be found.
>
>
> With python 2.7, pyinstaller runs without problems.

Hmm. That's a separate consideration. If you take a step back and ask
the broader question "How can I package my Python 3.5 script into a
.exe file?", I'm pretty sure there is an answer; maybe pyinstaller
isn't the way to do it. (I'm not an expert on exe file production.)
Does your script run happily in 3.5 if it isn't packaged into an exe?

ChrisA



More information about the Python-list mailing list