Skip to content

UnicodeDecodeError with setup.py #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
etfre opened this issue Jan 6, 2014 · 6 comments
Closed

UnicodeDecodeError with setup.py #2

etfre opened this issue Jan 6, 2014 · 6 comments

Comments

@etfre
Copy link

etfre commented Jan 6, 2014

Using setup.py install throws the following error for me in Windows 7.

C:\Users\efredericksen\Documents\GitHub\python-docx>python setup.py install Traceback (most recent call last): File "setup.py", line 24, in <module> LICENSE = open(license).read() File "C:\Users\efredericksen\python33\lib\encodings\cp1252.py", line 23, in de code return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 231: char acter maps to <undefined>

I replaced the “ characters in the LICENSE file with " and the installation ran fine afterwards.

@scanny
Copy link
Contributor

scanny commented Jan 6, 2014

@evfredericksen Thanks for reporting this, I've just pushed an updated release to PyPI.

I wasn't able to reproduce it on my Windows 7 install. Do you think you could try installing the new version to see if it's fixed?

@etfre
Copy link
Author

etfre commented Jan 6, 2014

Now it's throwing the following error:

C:\Users\efredericksen\Documents\GitHub\python-docx>setup.py install Traceback (most recent call last): File "C:\Users\efredericksen\Documents\GitHub\python-docx\setup.py", line 25, in <module> "__version__ = '([^']+)'", text_of('docx/__init__.py') File "C:\Users\efredericksen\Documents\GitHub\python-docx\setup.py", line 18, in text_of text.decode('ascii') # result discarded, just make sure no non-ascii chars AttributeError: 'str' object has no attribute 'decode'

I'm guessing this is due to the fact that I'm trying to install on Python 3.3, and based on a quick scan of some code it looks like you've developed this library for Python 2.

@scanny
Copy link
Contributor

scanny commented Jan 6, 2014

Ah, right, that would do it :)

I haven't gone through to get the Python 3 compatibility in there yet. I've got tox all set up to go, just haven't worked through the errors yet, thought I'd leave that for a week or two.

But I can work on it a bit sooner if you need it. Are you run strictly on Python 3?

@etfre
Copy link
Author

etfre commented Jan 6, 2014

No need to hurry on my behalf. I've developed my own fork of the original python-docx for Python 3, but it looks like you've spent way more time and effort on this than I have. I figured I'll spend some time figuring out the new api and then maybe push a few commits of stuff that I've already written that isn't in here yet if you don't mind people adding content.

@scanny
Copy link
Contributor

scanny commented Jan 6, 2014

Probably best to start off with a conversation on a feature by feature basis, but I'd love having some contributions :)

It's a fairly carefully structured project as I suppose you'll see. So I don't expect to be committing pull requests that come out of the blue. But if you don't mind starting out with a discussion of proposed features and what the API should look like, and you're willing to write the tests to go with it, I'd welcome the help; even more I'd welcome the additional eyes and voice on the project :)

What kinds of things to you use python for with Word?

@scanny
Copy link
Contributor

scanny commented Jan 7, 2014

Python 3 support completed, should fix this. Let me know if it gives any other problems :)

@scanny scanny closed this as completed Jan 7, 2014
Benjamin-T referenced this issue in Benjamin-T/python-docx May 25, 2018
Benjamin-T referenced this issue in Benjamin-T/python-docx May 25, 2018
Sibuken referenced this issue in speechki-book/python-docx May 12, 2020
Added Hyperlink functionality to docx
Benjamin-T referenced this issue in Benjamin-T/python-docx Oct 25, 2021
pix pushed a commit to pix/python-docx that referenced this issue Aug 19, 2022
alberto743 pushed a commit to alberto743/python-docx that referenced this issue Jun 15, 2023
Add custom properties support + unit-tests, feature-tests python-openxml#580
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants