2012-09-17 11 views
7

मैं अपने ओपन-सोर्स प्रोजेक्ट, Melopy वितरित करने के लिए प्रयास कर रहा हूँ, लेकिन पैकेज प्रबंधन मुझे समस्याओं दे रहा है के बाद से मैं शुरू कर दिया। आज, मैंने पीईपीआई के लिए पंजीकरण किया है, लेकिन python setup.py sdist upload चलाने पर मुझे निम्न त्रुटि का सामना करना पड़ रहा है।पीआईपी के साथ यूनिकोड डीकोड त्रुटि?

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' फ़ाइल की सामग्री क्या है? यदि उस फ़ाइल में गैर-असीसी वर्ण हैं तो आपको 'codecs.open' का उपयोग करना चाहिए और सही एन्कोडिंग का उपयोग करना चाहिए। – Bakuriu

उत्तर

4

ऐसा लगता है कि आपको this bug द्वारा मारा जा रहा है। सिद्धांत रूप में समस्या को नियमित स्ट्रिंग के रूप में संस्करण पास करके तय किया जाना चाहिए।

+1

धन्यवाद, मुझे बस 'setup.py' की कॉन्फ़िगरेशन की सभी सामग्री से यूनिकोड को हटाना पड़ा। मुझे यकीन नहीं है कि वे पहले स्थान पर थे ... –

संबंधित मुद्दे