Skip to content
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

Error: module curses has no attribute A_ITALIC #40

Open
poetaman opened this issue Nov 21, 2021 · 4 comments
Open

Error: module curses has no attribute A_ITALIC #40

poetaman opened this issue Nov 21, 2021 · 4 comments

Comments

@poetaman
Copy link

When I open a epub or mobi, I get the following error. I have not updated epy in my other machine, this does not happen there. Am using the current version of pip3 while reporting this on my current machine.

❯ epy ~/Desktop/Books/Effective_Writing.epub
Traceback (most recent call last):
  File "/opt/homebrew/bin/epy", line 8, in <module>
    sys.exit(main())
  File "/opt/homebrew/lib/python3.9/site-packages/epy.py", line 3358, in main
    curses.wrapper(preread, filepath)
  File "/opt/homebrew/Cellar/python@3.9/3.9.8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
  File "/opt/homebrew/lib/python3.9/site-packages/epy.py", line 3215, in preread
    reading_state = reader.read(reading_state)
  File "/opt/homebrew/lib/python3.9/site-packages/epy.py", line 2501, in read
    text_structure = parse_html(
  File "/opt/homebrew/lib/python3.9/site-packages/epy.py", line 1407, in parse_html
    return parser.get_structured_text(textwidth, starting_line)
  File "/opt/homebrew/lib/python3.9/site-packages/epy.py", line 831, in get_structured_text
    attr=curses.A_ITALIC,
AttributeError: module 'curses' has no attribute 'A_ITALIC'

@wustho
Copy link
Owner

wustho commented Nov 21, 2021

Hello there, current version of epy only supported for python 3.7 or above which support italic in curses and stuff... So really sorry for this, unless you upgrade to latest python, you might need to use older version of epy:

pip install epr-reader==2021.8.14

@poetaman
Copy link
Author

poetaman commented Nov 21, 2021

@wustho I am using python 3.9.8. I checked that on my system python pointed to version 2.something, so aliased python to python3, but I still get the same error.

Perhaps somewhere in epy-reader, you might want to refer to python3 directly?? I mean change any reference of python to python3?

Update: I opened epy file, it looks like following, so not sure why the error about A_ITALIC.

#!/opt/homebrew/opt/python@3.9/bin/python3.9
# -*- coding: utf-8 -*-
import re
import sys
from epy import main
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

@wustho
Copy link
Owner

wustho commented Nov 21, 2021

@reportaman this is weird... I just read your traceback more thoroughly, and it is indeed using correct python version... So as you guessed, the issue is within the epy, it should handle unavailable italic... I will fix it soon... Thanks for detailed traceback btw.

@wustho
Copy link
Owner

wustho commented Dec 18, 2021

@reportaman Hey there just fixed this in v2021.12.18, you can upgrade it via pip. And let me know if the issue still persists... Thanks

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