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 in cssreformatter: -5 #394

Closed
mrprobert opened this issue Feb 17, 2019 · 9 comments
Closed

Error in cssreformatter: -5 #394

mrprobert opened this issue Feb 17, 2019 · 9 comments

Comments

@mrprobert
Copy link

Environment: Windows 10 Pro 64-bit version 1809
Sigil 0.9.11
Qt 5.11.2

I upgraded from 0.9.10 to 0.9.11. Opened an existing epub2 (passed FlightCrew and W3C checks.) Reformatting the stylesheet fails.

Embedded Python Error
Error in cssreformatter: -5

Traceback (most recent call last):

File "C:/Program Files/Sigil/python3lib\cssreformatter.py", line 191, in reformat_css
new_css_string = parsed_css.cssText.decode('utf-8', errors='replace')

File "C:/Program Files/Sigil/plugin_launchers/python\css_parser\css\cssstylesheet.py", line 139, in _getCssText
return css_parser.ser.do_CSSStyleSheet(self)

File "C:/Program Files/Sigil/python3lib\cssreformatter.py", line 42, in do_CSSStyleSheet
cssText = rule.cssText

File "C:/Program Files/Sigil/plugin_launchers/python\css_parser\css\cssfontfacerule.py", line 76, in _getCssText
return css_parser.ser.do_CSSFontFaceRule(self)

File "C:/Program Files/Sigil/python3lib\cssreformatter.py", line 68, in do_CSSFontFaceRule
out = cssparser.serialize.Out(self)

NameError: name 'cssparser' is not defined

@dougmassay
Copy link
Contributor

dougmassay commented Feb 17, 2019

Well that certainly sucks. I've not had a bit of trouble reformatting any css in any version of Windows (Windows 10 included).

I see the problem, but I can't fix it without changing the source. And that means retagging and making a new release for an underscore character.

If you can change line 68 of C:\Program Files\Sigil\python3lib\cssreformatter.py from:
out = cssparser.serialize.Out(self)

to:
out = css_parser.serialize.Out(self)

You should be able to get by until we get it fixed.

You'll need to have elevated privileges to write to that file.

@kevinhendricks
Copy link
Contributor

kevinhendricks commented Feb 17, 2019 via email

@dougmassay
Copy link
Contributor

Should be able to fix it on Windows, too. They'll just need to open an editor as admin to be able to make the changes.

@dougmassay
Copy link
Contributor

Let's push the fix so Linux distros can cherry-pick it if they want.

@eli-schwartz
Copy link
Contributor

I can cherry-pick a fix while releasing, although most Windows/macOS users would probably appreciate a bugfix release; still, your choice whether to immediately tag a new release for one fix or to hold off and see if any other post-release bugs crop up first.

At least it was found quickly, proving it's popular enough to get lots of immediate use. :D

dougmassay added a commit that referenced this issue Feb 17, 2019
@dougmassay
Copy link
Contributor

I pushed a fix for this particular bug: a7b465e

But I think we're going to wait a day or two before putting out a new release just in case some other issues happen to shake out.

@mrprobert
Copy link
Author

mrprobert commented Feb 17, 2019 via email

@mapreri
Copy link
Contributor

mapreri commented Feb 17, 2019

FWIW, I had already uploded 0.9.11 to debian unstable yesterday.

Since we already started the freeze for the next stable and will be a bit of a mess to do big updates (like 0.9.10 → 0.9.11) after the March 2nd, I plan to wait until the current (buggy) upload migrate to testing in 9 days, so that even if I end up needing to ask for an exception after March 2nd is easier to get it granted.

Hopefully by then if there are more deep hidden regressions in 0.9.11 they will be found and a fixup 0.9.12 will appear :)

@dougmassay
Copy link
Contributor

Closing as this is fixed in 0.9.12

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

5 participants