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

Sintax Highlighter dead on click #1106

Closed
ghost opened this issue Feb 17, 2013 · 18 comments
Closed

Sintax Highlighter dead on click #1106

ghost opened this issue Feb 17, 2013 · 18 comments
Assignees
Milestone

Comments

@ghost
Copy link

ghost commented Feb 17, 2013

Sintax Highlighter dead on click, drop to plain color, massive error messages on stdout,
IDE still works but without highlights, with Python files ( *.py ), the error is per-Tab,
only happens on click at text editor area (on change cursor position via mouse click),
1 line .py files is enough to make highlighter die.

Ninja-IDE Daily from PPA ( ninja-ide_2.1.1+r521~raring1 ) , Qt 4.8.4, Python 2.7.3, running on Ubuntu 13.04 64Bit, tested with Guest user and no extensions.

Full Traceback: http://paste.ubuntu.com/1667475/ (the more files more output)

I think there are a Bug Report already of this but maybe is Closed or Deleted or something
( https://github.com/ninja-ide/ninja-ide/issues/search?q=highlight&state=open&assignee= )

@sh4nks
Copy link

sh4nks commented Feb 26, 2013

I also have this bug on archlinux

@ghost
Copy link
Author

ghost commented Feb 26, 2013

Do you have Python 2.x and 3.x installed system wide ?, I think theres something with this

@sh4nks
Copy link

sh4nks commented Feb 26, 2013

I have python3.3 and python2.7.3

This bug occured after the system update (pacman -Syu) on monday. Here is my pacman logfile from the updated packages on monday: Click!. I hope this can help you

@ghost
Copy link
Author

ghost commented Feb 27, 2013

Me too, is possible somehow that mess things up ? :(

@sh4nks
Copy link

sh4nks commented Feb 28, 2013

This is the error output when opening a python file (I have started ninja-ide from terminal):

AttributeError: 'QTextBlockUserData' object has no attribute 'clear_data'
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ninja_ide/gui/editor/editor.py", line 265, in show_static_errors
    self._sync_tab_icon_notification_signal()
  File "/usr/lib/python2.7/site-packages/ninja_ide/gui/editor/editor.py", line 280, in _sync_tab_icon_notification_signal
    self.highlighter.rehighlight_lines(lines)
  File "/usr/lib/python2.7/site-packages/ninja_ide/gui/editor/highlighter.py", line 419, in rehighlight_lines
    errors_lines = self._get_errors_lines()
  File "/usr/lib/python2.7/site-packages/ninja_ide/gui/editor/highlighter.py", line 412, in _get_errors_lines
    if (user_data is not None) and (user_data.error == True):
AttributeError: 'QTextBlockUserData' object has no attribute 'error'
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ninja_ide/gui/editor/highlighter.py", line 244, in highlightBlock
    self.highlight_function(text)
  File "/usr/lib/python2.7/site-packages/ninja_ide/gui/editor/highlighter.py", line 326, in realtime_highlight
    user_data.clear_data()
AttributeError: 'QTextBlockUserData' object has no attribute 'clear_data'

@yatharth
Copy link

yatharth commented Mar 1, 2013

I think the issue you're talking about is #1083. @nelsam submitted Pull Request #1123 for the problem. The problem seemed to be b'coz of an incorrect install of SIP or PyQt. Maybe the update changed things?

@ghost
Copy link
Author

ghost commented Mar 1, 2013

I dont have PySide, but I have Ubuntu-SDK which installs Qt5 (?)

@nelsam
Copy link

nelsam commented Mar 1, 2013

Yeah, that's the issue I was talking about. Thanks for getting it all
linked and junk - I've been using git for ages, but only recently started
using github, so I'm unaware of how to use a lot of the features on the
website.

Improperly installed PyQt or SIP is not the issue on my system - I have
PyQt 4.9.6 and SIP 4.14.3 on my arch system, installed using the pacman
package manager, and I'm hitting the issue. It's the same on my Funtoo
system, at home - with PyQt and SIP installed from portage (not sure which
versions, but they're probably similarly bleeding edge). I'm seeing the
same behavior as poolshrk noticed - whenever block.userData() does NOT
return None, it instead returns an empty object (printing out
user_data.dict would print {}) of type QTextBlockUserData. Honestly, I
mainly commented and uploaded my fix to github because poolshrk didn't seem
like he had found a fix, according to his last comment on the issue. Since
I tossed together a fix that works, I figured at the very least he might
find it useful.

That said, I'm sure that it's entirely possible that this could relate to a
bug in recent versions of PyQt - maybe block.userData() has a regression.
I can actually test that tonight on my Funtoo system - since portage has
many different versions in the repos, I can try going back to older
versions of PyQt to see if they exhibit the same behavior. If it works on
older versions of PyQt, I can walk forward through the versions to see
which version of PyQt breaks it.

Anyway, I'm not exactly determined for my patch to be accepted, but I did
fix the issue for systems similar to mine, and I wanted to make the fix
available somewhere. Even if this just works around some bug in PyQt or
SIP, it's still useful to me (because I'm not going to start installing
PyQt and SIP manually, even if it would fix the issue - I would rather
maintain my little workaround than manually install libraries that are used
by dozens of programs on my system). And I wanted to put my fix up
somewhere in case it's useful for other people, too.

-Sam

"As an adolescent I aspired to lasting fame, I craved factual certainty, and
I thirsted for a meaningful vision of human life -- so I became a scientist.
This is like becoming an archbishop so you can meet girls."
-- Matt Cartmill

On Fri, Mar 1, 2013 at 1:47 AM, Juan notifications@github.com wrote:

I dont have PySide, but I have Ubuntu-SDK which installs Qt5 (?)


Reply to this email directly or view it on GitHubhttps://github.com//issues/1106#issuecomment-14278260
.

@diegosarmentero
Copy link
Member

I'll work on this issue during the weekend.

@ghost ghost assigned diegosarmentero Mar 1, 2013
@ghost
Copy link
Author

ghost commented Mar 1, 2013

I think that I cant make quotes " " on new files after the highlighter die (?)

@poolshrk
Copy link

poolshrk commented Mar 5, 2013

Thanks everyone for looking into this... I haven't had time to look into this much further. I have rebuilt all the packages on my Gentoo system with a newer version of gcc and I'm still seeing this.

My best guess is that there is a bug somewhere in sip/PyQt4/qt or the behaviour has recently changed for some reason. If I get a chance I'll try downgrading some packages to see if that helps.

@poolshrk
Copy link

poolshrk commented Mar 7, 2013

I tried PyQt4 version 4.10 and this made no difference

@poolshrk
Copy link

poolshrk commented Mar 7, 2013

I tried sip version 4.14.2 with PyQt 4.9.6 and this FIXED the issue for me.

(I had to go back to PyQt 4.9.6 since 4.10 requires sip 4.14.3)

So it seems that sip 4.14.3 is broken. Perhaps someone should let them know if someone else can confirm that sip is in fact to blame here.

@diegosarmentero
Copy link
Member

No, the problem has already been found in the code and is going to be fixed soon (next week for sure)

@ghost
Copy link
Author

ghost commented Mar 8, 2013

Thanks for the efforts, despite the IDE keep working its really annoying...

@kensington
Copy link

When you say the code has been fixed, do you mean in ninja-ide or sip?

@wbsoft
Copy link

wbsoft commented Mar 12, 2013

Just stumbled on the same problem in my application Frescobaldi.

I reported the issue (that QTextBlockUserData instances forget their python wrappers) to the PyQt4 authors and Phil Thomson replied that it was a PyQt4 bug, and that he'd fixed it tonight:
http://www.riverbankcomputing.com/pipermail/pyqt/2013-March/032457.html

@diegosarmentero
Copy link
Member

Fixed

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

7 participants