Re: install error CherryPy 7.1.0 on Windows using pip

young-kyun Kim <[email protected]>
Newsgroups gmane.comp.python.cherrypy
Message-ID <[email protected]>
I do more analyze this issue.

D:\app\python\src\CherryPy-7.1.0>setup.py build bdist_wininst
running build
running build_py
...
creating dist
removing 'build\bdist.win32\wininst' (and everything under it)
CherryPy-7.1.0.win32.exe is created and installed successfully.
So, I think that wheel installer only have the problem.

It seems that IOError raised because of filename - 
"cherrypy/test/static/Слава Україні.html" 

The filename is passed as "utf-8" encoding.
>>> print 'd:\\users\\me\\appdata\\local\\temp\\pip-build-esnrji\\CherryPy\\cherrypy/test/static/\xd0\xa1\xd0\xbb\xd0\xb0\xd0\xb2\xd0\xb0 
\xd0\xa3\xd0\xba\xd1\x80\xd0\xb0\xd1\x97\xd0\xbd\xd1\x96.html'.decode(
"utf-8")
d:\users\me\appdata\local\temp\pip-build-esnrji\CherryPy\cherrypy/test/
static/Слава Україні.html

But, the default encoding on windows is not "utf-8".
>>> sys.getdefaultencoding()
'ascii'
>>> sys.getfilesystemencoding()
'mbcs'

the default encoding on korean windows is "cp949".
So, DecodeError raised.
print 'd:\\users\\me\\appdata\\local\\temp\\pip-build-esnrji\\CherryPy\\cherrypy/test/static/\xd0\xa1\xd0\xbb\xd0\xb0\xd0\xb2\xd0\xb0 
\xd0\xa3\xd0\xba\xd1\x80\xd0\xb0\xd1\x97\xd0\xbd\xd1\x96.html'.decode(
"cp949")

Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    print 'd:\\users\\me\\appdata\\local\\temp\\pip-build-esnrji\\CherryPy\\cherrypy/test/static/\xd0\xa1\xd0\xbb\xd0\xb0\xd0\xb2\xd0\xb0 
\xd0\xa3\xd0\xba\xd1\x80\xd0\xb0\xd1\x97\xd0\xbd\xd1\x96.html'.decode(
"cp949")
UnicodeDecodeError: 'cp949' codec can't decode bytes in position 99-100: 
illegal multibyte sequence
>>> print 'd:\\users\\me\\appdata\\local\\temp\\pip-build-esnrji\\CherryPy\\cherrypy/test/static/\xd0\xa1\xd0\xbb\xd0\xb0\xd0\xb2\xd0\xb0 
\xd0\xa3\xd0\xba\xd1\x80\xd0\xb0\xd1\x97\xd0\xbd\xd1\x96.html'.decode(
"cp949", "ignore")
d:\users\me\appdata\local\temp\pip-build-esnrji\CherryPy\cherrypy/test/
static/鬼剋逵勻逵 叫克逵戟.html

NAME INVALID error  found in process monitor log.
오후 1:19:58.3672120    python.exe    4616    CreateFile    D:\Users\me\
AppData\Local\Temp\pip-build-esnrji\CherryPy\cherrypy\test\static\鬼剋逵勻逵 
叫克?逵?戟?.html    NAME INVALID    Desired Access: Generic Write, Read 
Attributes, Disposition: OverwriteIf, Options: Synchronous IO Non-Alert, Non
-Directory File, Attributes: N, ShareMode: Read, Write, AllocationSize: 0


2016년 7월 26일 화요일 오후 12시 27분 36초 UTC+9, young-kyun Kim 님의 말:
>
> Hi!
>
> When CherryPy 7.1.0 is installed on Windows using pip, IOError raised.
> Windows 10 64bit Korean, Python 2.7.12 32bit, pip 8.1.2.
>
> Below is the detail error message.
> D:\pydevenv\win32>pip install -U CherryPy
> Collecting CherryPy
>   Using cached CherryPy-7.1.0.tar.gz
> Exception:
> Traceback (most recent call last):
>   File "d:\devtool\py27x86\lib\site-packages\pip\basecommand.py", line 215
> , in main
>     status = self.run(options, args)
>   File "d:\devtool\py27x86\lib\site-packages\pip\commands\install.py", 
> line 299, in run
>     requirement_set.prepare_files(finder)
>   File "d:\devtool\py27x86\lib\site-packages\pip\req\req_set.py", line 370
> , in prepare_files
>     ignore_dependencies=self.ignore_dependencies))
>   File "d:\devtool\py27x86\lib\site-packages\pip\req\req_set.py", line 587
> , in _prepare_file
>     session=self.session, hashes=hashes)
>   File "d:\devtool\py27x86\lib\site-packages\pip\download.py", line 810, 
> in unpack_url
>     hashes=hashes
>   File "d:\devtool\py27x86\lib\site-packages\pip\download.py", line 653, 
> in unpack_http_url
>     unpack_file(from_path, location, content_type, link)
>   File "d:\devtool\py27x86\lib\site-packages\pip\utils\__init__.py", line 
> 605, in unpack_file
>     untar_file(filename, location)
>   File "d:\devtool\py27x86\lib\site-packages\pip\utils\__init__.py", line 
> 577, in untar_file
>     with open(path, 'wb') as destfp:
> IOError: [Errno 22] invalid mode ('wb') or filename: 'd:\\users\\me\\appdata\\local\\temp\\pip-build-0vvcm3\\CherryPy\\cherrypy/test/static/\xd0\xa1\xd0\xbb\xd0\xb0\xd0\xb2\xd0\xb0 
> \xd0\xa3\xd0\xba\xd1\x80\xd0\xb0\xd1\x97\xd0\xbd\xd1\x96.html'
>
>

-- 
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cherrypy-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
To post to this group, send email to cherrypy-users-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
Visit this group at https://groups.google.com/group/cherrypy-users.
For more options, visit https://groups.google.com/d/optout.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.