2012-09-17 4 views
7

오픈 소스 프로젝트 Melopy을 배포하려고 시도하고 있지만 패키지 관리는 시작한 이래로 문제가되고 있습니다. 오늘 PyPI에 등록했지만 python setup.py sdist upload을 실행하면 다음 오류가 발생합니다.PIP가 적용된 UnicodeDecodeError?

running sdist 
running check 
reading manifest template 'MANIFEST.in' 
not writing to manually maintained manifest file 'MANIFEST' 
making hard links in Melopy-0.1.0... 
Creating tar archive 
Traceback (most recent call last): 
    File "setup.py", line 19, in <module> 
    setup(**config) 
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup 
    dist.run_commands() 
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands 
    self.run_command(cmd) 
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command 
    cmd_obj.run() 
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/sdist.py", line 168, in run 
    self.make_distribution() 
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/sdist.py", line 448, in make_distribution 
    owner=self.owner, group=self.group) 
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 392, in make_archive 
    owner=owner, group=group) 
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/archive_util.py", line 237, in make_archive 
    filename = func(base_name, base_dir, **kwargs) 
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/archive_util.py", line 101, in make_tarball 
    tar = tarfile.open(archive_name, 'w|%s' % tar_compression[compress]) 
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py", line 1687, in open 
    _Stream(name, filemode, comptype, fileobj, bufsize), 
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py", line 431, in __init__ 
    self._init_write_gz() 
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py", line 459, in _init_write_gz 
    self.__write(self.name + NUL) 
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py", line 475, in __write 
    self.buf += s 
UnicodeDecodeError: 'ascii' codec can't decode byte 0x8b in position 1: ordinal not in range(128) 

setup.py의 내용은 다음과 같습니다.

#!/usr/bin/env python 
# -*- coding: utf-8 -*- 

from distutils.core import setup 

config = { 
    'name': u'Melopy', 
    'author': u'Jordan Scales', 
    'author_email': u'[email protected]', 
    'description': u'Python music library', 
    'long_description': open(u'README.txt').read(), 
    'packages': ['melopy'], 
    'version': u'0.1.0', 
    'url': u'https://github.com/prezjordan/Melopy', 
    'license': 'LICENSE.txt', 
    'classifiers': [] 
} 

setup(**config) 

# Licensed under The MIT License (MIT) 
# See LICENSE file for more 
+0

'README.txt'파일의 내용은 무엇입니까? 이 파일에 ascii가 아닌 문자가 있으면'codecs.open'을 사용하고 올바른 인코딩을 사용해야합니다. – Bakuriu

답변

4

this bug에 의해 피해를 입은 것 같습니다. 이론적으로 문제는 버전을 일반 문자열로 전달하여 해결해야합니다.

+1

고마워, 나는'setup.py' config의 모든 내용에서 unicode를 삭제해야했습니다. 그들이 처음에 어디에 있었는지 모르겠습니다 ... –

관련 문제