Re: [PyQt] A dire warning message
On Fri, 8 Jul 2011 11:52:17 PM Baz Walter wrote: > > but to users it can look like a bug if they are running a non-kde app. > > i re-installed the libkde.so plugin and ran this pure pyqt test script: > > ## > > import sys > > from PyQt4.QtGui import QApplication, QFileDialog, QPushButton > > class Window(QPushButton): > def __init__(self): > QPushButton.__init__(self, 'Open') > self.clicked.connect(self.open) > > def open(self): > dialog = QFileDialog(self, "Open File", '.', "Files (*.*)") > dialog.exec_() > > if __name__ == '__main__': > app = QApplication(sys.argv) > win = Window() > win.show() > sys.exit(app.exec_()) > > ## > > sure enough, when i click the button, a *kde* file dialog appears and i > see the "dire warning". > > however, when i set the following option: > > dialog.setOption(QFileDialog.DontUseNativeDialog) > > a *qt* file dialog appears and there is no "dire warning". > > this using pyqt 4.8.4, qt 4.7.3, and kde-4.8.5 on archlinux. > > (as a further note: with non-kde apps, the kde file dialog can be > annoyingly slow to open compared with the qt one - which is another > reason why i prefer to remove this plugin on my system). > ___ Baz, Looks like the "magic line" (=dialog.setOption(QFileDialog.DontUseNativeDialog)) is the solution - congratulations to you, Baz! I verified your solution on my kubuntu 11.04 "natty" The record of CLI commands and results are: with try1.py Baz's program without the "magic line" ' and try2.py with the "magic line". First, with libkde.so in place: ak@supremo:/dat/work/py3/Baz$ python3 try1.py KGlobal::locale::Warning your global KLocale is being recreated with a valid main component instead of a fake component, this usually means you tried to call i18n related functions before your main component was created. You should not do that since it most likely will not work ak@supremo:/dat/work/py3/Baz$ python3 try2.py With libkde.so removed (no reboot!): ak@supremo:/dat/work/py3/Baz$ python3 try1.py ak@supremo:/dat/work/py3/Baz$ python3 try2.py ak@supremo:/dat/work/py3/Baz$ On your example your suggestion works on natty and python3.2 [SOLVED!] Now why the removal of the libkde.so did not eliminate the problem on my script? Most likely I stuffed something up- will look into it (basically repeat my experiment). Congratulations and thanks to Baz! Al. ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] A dire warning message
On 08/07/11 10:22, Raoul Snyman wrote: On Fri, 8 Jul 2011 19:00:52 +1000, Algis Kabaila wrote: I think it is time to give it rest, unless someone can suggest antother lead. The fun of it begins to feel like bashing one's head against a wall. After all I can live with the "dire warning" message. I don't know why this thread has carried on so long. It has nothing to do with PyQt4, and everything to do with KDE 4 - *all* of my KDE apps issue that warning. Have you seen the number of warnings Kate spawns? well, the point is that pyqt is *not* a kde app - why should users see *kde* warnings when running non-kde apps? In addition to that, it's a warning, not an error. Warnings are non-crucial errors which will not affect how an application runs. Developers should strive to have code that issues no warnings, but as end-users we should not worry about warnings. but to users it can look like a bug if they are running a non-kde app. i re-installed the libkde.so plugin and ran this pure pyqt test script: ## import sys from PyQt4.QtGui import QApplication, QFileDialog, QPushButton class Window(QPushButton): def __init__(self): QPushButton.__init__(self, 'Open') self.clicked.connect(self.open) def open(self): dialog = QFileDialog(self, "Open File", '.', "Files (*.*)") dialog.exec_() if __name__ == '__main__': app = QApplication(sys.argv) win = Window() win.show() sys.exit(app.exec_()) ## sure enough, when i click the button, a *kde* file dialog appears and i see the "dire warning". however, when i set the following option: dialog.setOption(QFileDialog.DontUseNativeDialog) a *qt* file dialog appears and there is no "dire warning". this using pyqt 4.8.4, qt 4.7.3, and kde-4.8.5 on archlinux. (as a further note: with non-kde apps, the kde file dialog can be annoyingly slow to open compared with the qt one - which is another reason why i prefer to remove this plugin on my system). ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] A dire warning message
On Fri, 8 Jul 2011 07:22:04 PM Raoul Snyman wrote: > On Fri, 8 Jul 2011 19:00:52 +1000, Algis Kabaila wrote: > > I think it is time to give it rest, unless someone can suggest antother > > lead. > > The fun of it begins to feel like bashing one's head against a wall. > > After all I can live with the "dire warning" message. > > I don't know why this thread has carried on so long. It has nothing to do > with PyQt4, and everything to do with KDE 4 - *all* of my KDE apps issue > that warning. Have you seen the number of warnings Kate spawns? > > In addition to that, it's a warning, not an error. Warnings are > non-crucial errors which will not affect how an application runs. Thanks for the encouragement! > Developers should strive to have code that issues no warnings, but as > end-users we should not worry about warnings. In a sense, anyone writing a program is a "developer". OSS is development. And you just pointed out that we (the hackers) should worry about the warning messages. The length of the thread? Well, there is a bunch of helpful, nice people here, who are willing to help. Enjoy their company! Thanks for adding a brick to lengthen the thread! OldAl. ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] A dire warning message
On Fri, 8 Jul 2011 19:00:52 +1000, Algis Kabaila wrote: > I think it is time to give it rest, unless someone can suggest antother > lead. > The fun of it begins to feel like bashing one's head against a wall. > After all I can live with the "dire warning" message. I don't know why this thread has carried on so long. It has nothing to do with PyQt4, and everything to do with KDE 4 - *all* of my KDE apps issue that warning. Have you seen the number of warnings Kate spawns? In addition to that, it's a warning, not an error. Warnings are non-crucial errors which will not affect how an application runs. Developers should strive to have code that issues no warnings, but as end-users we should not worry about warnings. -- Raoul Snyman, B.Tech IT (Software Engineering) Saturn Laboratories m: 082 550 3754 e: raoul.sny...@saturnlaboratories.co.za w: www.saturnlaboratories.co.za b: blog.saturnlaboratories.co.za ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] A dire warning message
On Fri, 8 Jul 2011 06:18:53 PM Hans-Peter Jansen wrote: > On Friday 08 July 2011, 08:07:16 Algis Kabaila wrote: > > On Fri, 8 Jul 2011 01:37:35 PM Baz Walter wrote: > > > On 08/07/11 02:36, Algis Kabaila wrote: > > > > On Fri, 8 Jul 2011 03:36:40 AM Baz Walter wrote: > > > you would need to reboot for it to have an effect, as the plugin > > > would still be loaded in memory. > > > > > > in any case, it's not a real solution to your problem - just a > > > possible workaround if you don't want/need the functionality the > > > plugin provides. > > > > > > really, i can't understand why kde chose to force this plugin on > > > users. i appreciate that many people want unified dialogs and so > > > forth, but it's pretty rude not to give users the option to disable > > > something which affects non-kde applications. > > > > Baz, > > > > Good point! > > > > After deleting the plugin and a reboot: > > ak@supremo:~/save$ ls -la /usr/lib/kde4/plugins/gui_platform/ > > total 8 > > drwxr-xr-x 2 root root 4096 2011-07-08 15:02 . > > drwxr-xr-x 9 root root 4096 2011-04-27 21:15 .. > > ak@supremo:~/save$ > > ak@supremo:~/save$ python3 save.py > > KGlobal::locale::Warning your global KLocale is being recreated with > > a valid main component instead of a fake component, this usually > > means you tried to call i18n related functions before your main > > component was created. You should not do that since it most likely > > will not work > > ak@supremo:~/save$ > > Since you're working on an "adult" system, there's probably a 64bit > version of that darn thing hanging around somewhere.. > > Pete In view of the lines below, it would not seem so, unless it has a different name. ak@supremo:/usr$ sudo find ./ libkde.so | grep libkde.so find: `libkde.so': No such file or directory ak@supremo:/usr$ I think it is time to give it rest, unless someone can suggest antother lead. The fun of it begins to feel like bashing one's head against a wall. After all I can live with the "dire warning" message. Thanks for the suggestion, Pete. I also looked for kdelibs4. Seems like I have three languages there - aus English, English, Lithuanian. I don't want to mess it up, as I do not know what I am doing. Al. ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] A dire warning message
On Friday 08 July 2011, 02:01:46 Algis Kabaila wrote: > > @Pete - I really do appreciate your helpful comments. It is people > like you that keep me interested in software issues "at the sunset of > my life" (as my even older sister says - "I don't mind dying, just > not today - and not tomorrow"):) Al, thank you for the kind words. It's people like you, that keep the world turn around. Knowing you age, I can only adhere, that age is mostly a state of mind, and from that POV, you're younger than a lot of people I got to know. Keep your head up, keep up your interests. You're a true gain for our little community (of people, that know who is the real Mc Coy..). Pete ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] A dire warning message
On Friday 08 July 2011, 08:07:16 Algis Kabaila wrote: > On Fri, 8 Jul 2011 01:37:35 PM Baz Walter wrote: > > On 08/07/11 02:36, Algis Kabaila wrote: > > > On Fri, 8 Jul 2011 03:36:40 AM Baz Walter wrote: > > > > you would need to reboot for it to have an effect, as the plugin > > would still be loaded in memory. > > > > in any case, it's not a real solution to your problem - just a > > possible workaround if you don't want/need the functionality the > > plugin provides. > > > > really, i can't understand why kde chose to force this plugin on > > users. i appreciate that many people want unified dialogs and so > > forth, but it's pretty rude not to give users the option to disable > > something which affects non-kde applications. > > Baz, > > Good point! > > After deleting the plugin and a reboot: > ak@supremo:~/save$ ls -la /usr/lib/kde4/plugins/gui_platform/ > total 8 > drwxr-xr-x 2 root root 4096 2011-07-08 15:02 . > drwxr-xr-x 9 root root 4096 2011-04-27 21:15 .. > ak@supremo:~/save$ > ak@supremo:~/save$ python3 save.py > KGlobal::locale::Warning your global KLocale is being recreated with > a valid main component instead of a fake component, this usually > means you tried to call i18n related functions before your main > component was created. You should not do that since it most likely > will not work > ak@supremo:~/save$ Since you're working on an "adult" system, there's probably a 64bit version of that darn thing hanging around somewhere.. Pete ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] A dire warning message
On Fri, 8 Jul 2011 01:37:35 PM Baz Walter wrote: > On 08/07/11 02:36, Algis Kabaila wrote: > > On Fri, 8 Jul 2011 03:36:40 AM Baz Walter wrote: > > you would need to reboot for it to have an effect, as the plugin would > still be loaded in memory. > > in any case, it's not a real solution to your problem - just a possible > workaround if you don't want/need the functionality the plugin provides. > > really, i can't understand why kde chose to force this plugin on users. > i appreciate that many people want unified dialogs and so forth, but > it's pretty rude not to give users the option to disable something which > affects non-kde applications. Baz, Good point! After deleting the plugin and a reboot: ak@supremo:~/save$ ls -la /usr/lib/kde4/plugins/gui_platform/ total 8 drwxr-xr-x 2 root root 4096 2011-07-08 15:02 . drwxr-xr-x 9 root root 4096 2011-04-27 21:15 .. ak@supremo:~/save$ ak@supremo:~/save$ python3 save.py KGlobal::locale::Warning your global KLocale is being recreated with a valid main component instead of a fake component, this usually means you tried to call i18n related functions before your main component was created. You should not do that since it most likely will not work ak@supremo:~/save$ I am leaving the libkde.so in my data partition, just in case.. Thanks for your help. OldAl. ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] A dire warning message
On 08/07/11 02:36, Algis Kabaila wrote: On Fri, 8 Jul 2011 03:36:40 AM Baz Walter wrote: Hmm, at the first glance, this is a KDE problem, since KDE plugs its own file dialog into Qt, but fails to properly deal with locales there after due to them not being initialized correctly. This is going to produce issues, if you're calling QFileDialogs and expects them being localized correctly. It might be possible to circumvent these issues by instancing KApplication instead of QApplication (and doing the proper KDE4 setup sequence). yes, the problem is indirectly caused by a "compatibility" plugin that invokes the kde open-dialog instead of the one provided by qt. the offending plugin is usually installed here: /usr/lib/kde4/plugins/gui_platform/libkde.so personally, i always remove it whenever kde is updated. Baz, Being a careful (and easily rattled) old soul, I did not remove libke.so, but moved it to my data partition, so that I would have a chance to "reinstate" it if it was necessary. Have not noticed any harmful effects - Kmail continued to work, opening and saving files. Unfortunately, it did not have any effect on the "dire warning message", as the following dialog shows: ak@supremo:~/save$ python3 save.py KGlobal::locale::Warning your global KLocale is being recreated with a valid main component instead of a fake component, this usually means you tried to call i18n related functions before your main component was created. You should not do that since it most likely will not work ak@supremo:~/save$ There is no change as far as the little test script shows. Perhaps I am too timid, but I copied back the libkde.so where it was, namely /usr/lib/kde4/plugins/gui_platform/libkde.so you would need to reboot for it to have an effect, as the plugin would still be loaded in memory. in any case, it's not a real solution to your problem - just a possible workaround if you don't want/need the functionality the plugin provides. really, i can't understand why kde chose to force this plugin on users. i appreciate that many people want unified dialogs and so forth, but it's pretty rude not to give users the option to disable something which affects non-kde applications. ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] A dire warning message
On Fri, 8 Jul 2011 03:36:40 AM Baz Walter wrote: > On 07/07/11 13:00, Algis Kabaila wrote: > > On Thu, 7 Jul 2011 09:03:47 PM Hans-Peter Jansen wrote: > >>> On opening a file dialog, I get this warning: > >>> > >>> KGlobal::locale::Warning your global KLocale is being recreated with > >>> a valid main component instead of a fake component, this usually > >>> means you tried to call i18n related functions before your main > >>> component was created. You should not do that since it most likely > >>> will not work > >>> > >>> Search on the net seems to give some grim news: > >>> > >>> > >>> Re: VLC Hangs on Open File dialog > >>> Postby Rémi Denis-Courmont » Sat Jan 29, 2011 11:58 pm > >>> In the mean time, someone in KDE actually looked at the issue. > >>> It turns to be a longstanding known bug in the QProcess class from > >>> Qt4. That bug gets triggered by a new "feature" in KDE 4.6 relative > >>> to MIME types in the Open and Save dialogs, that happens to involve > >>> the QProcess class. > >>> > >>> In the end, VLC is blaming KDE, KDE is blaming Qt, and Qt is blaming > >>> the kernel. > >>> > >>> ''' > > according to that thread, the problem has been fixed in kde-4.6.1. are > you able to upgrade? > > >> Hmm, at the first glance, this is a KDE problem, since KDE plugs its own > >> file dialog into Qt, but fails to properly deal with locales there > >> after due to them not being initialized correctly. This is going to > >> produce issues, if you're calling QFileDialogs and expects them being > >> localized correctly. It might be possible to circumvent these issues by > >> instancing KApplication instead of QApplication (and doing the proper > >> KDE4 setup sequence). > > yes, the problem is indirectly caused by a "compatibility" plugin that > invokes the kde open-dialog instead of the one provided by qt. > > the offending plugin is usually installed here: > > /usr/lib/kde4/plugins/gui_platform/libkde.so > > personally, i always remove it whenever kde is updated. Baz, Being a careful (and easily rattled) old soul, I did not remove libke.so, but moved it to my data partition, so that I would have a chance to "reinstate" it if it was necessary. Have not noticed any harmful effects - Kmail continued to work, opening and saving files. Unfortunately, it did not have any effect on the "dire warning message", as the following dialog shows: ak@supremo:~/save$ python3 save.py KGlobal::locale::Warning your global KLocale is being recreated with a valid main component instead of a fake component, this usually means you tried to call i18n related functions before your main component was created. You should not do that since it most likely will not work ak@supremo:~/save$ There is no change as far as the little test script shows. Perhaps I am too timid, but I copied back the libkde.so where it was, namely /usr/lib/kde4/plugins/gui_platform/libkde.so Thank you again for the interesting suggestion. OldAl. ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] A dire warning message
On Fri, 8 Jul 2011 08:46:24 AM David Boddie wrote: > On Thu, 7 Jul 2011 16:04:29 +0200, Hans-Peter Jansen wrote: > > On Thursday 07 July 2011, 14:00:28 Algis Kabaila wrote: > > > The message does occur exactly the same way when the scripts are > > > fired from CLI. I should try it on a gnome desktop in order to avoid > > > PyKDE4. > > > > No, it's not a PyKDE4 issue. It's triggered deep under the covers > > somewhere between KDE4 and Qt4. We will have to wait for the respective > > people to have it fixed one day. > > Could it be a style issue? There's some interaction between Qt and KDE in > the style engine. > > David @Pete - I really do appreciate your helpful comments. It is people like you that keep me interested in software issues "at the sunset of my life" (as my even older sister says - "I don't mind dying, just not today - and not tomorrow"):) @Baz - yes, I've noticed that "find" in the message. Checked the "help" on my Konqueror. The "about KDE" indicates that KDE is 4.6.2. So one notch newer than the version where the problem has been fixed. The suggestion to remove the "compatibility" plugin is certainly worth trying. I will try it and report back the result. @ David - interesting suggestion, but it leaves me wondering how to make use of it. There is every likelihood that there is "some interaction". Thank you one and all. Greatly appreciated. OldAl. ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] A dire warning message
On Thu, 7 Jul 2011 16:04:29 +0200, Hans-Peter Jansen wrote: > On Thursday 07 July 2011, 14:00:28 Algis Kabaila wrote: > > > The message does occur exactly the same way when the scripts are > > fired from CLI. I should try it on a gnome desktop in order to avoid > > PyKDE4. > > No, it's not a PyKDE4 issue. It's triggered deep under the covers > somewhere between KDE4 and Qt4. We will have to wait for the respective > people to have it fixed one day. Could it be a style issue? There's some interaction between Qt and KDE in the style engine. David ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] A dire warning message
On 07/07/11 13:00, Algis Kabaila wrote: On Thu, 7 Jul 2011 09:03:47 PM Hans-Peter Jansen wrote: On opening a file dialog, I get this warning: KGlobal::locale::Warning your global KLocale is being recreated with a valid main component instead of a fake component, this usually means you tried to call i18n related functions before your main component was created. You should not do that since it most likely will not work Search on the net seems to give some grim news: Re: VLC Hangs on Open File dialog Postby Rémi Denis-Courmont » Sat Jan 29, 2011 11:58 pm In the mean time, someone in KDE actually looked at the issue. It turns to be a longstanding known bug in the QProcess class from Qt4. That bug gets triggered by a new "feature" in KDE 4.6 relative to MIME types in the Open and Save dialogs, that happens to involve the QProcess class. In the end, VLC is blaming KDE, KDE is blaming Qt, and Qt is blaming the kernel. ''' according to that thread, the problem has been fixed in kde-4.6.1. are you able to upgrade? Hmm, at the first glance, this is a KDE problem, since KDE plugs its own file dialog into Qt, but fails to properly deal with locales there after due to them not being initialized correctly. This is going to produce issues, if you're calling QFileDialogs and expects them being localized correctly. It might be possible to circumvent these issues by instancing KApplication instead of QApplication (and doing the proper KDE4 setup sequence). yes, the problem is indirectly caused by a "compatibility" plugin that invokes the kde open-dialog instead of the one provided by qt. the offending plugin is usually installed here: /usr/lib/kde4/plugins/gui_platform/libkde.so personally, i always remove it whenever kde is updated. ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] A dire warning message
On Thursday 07 July 2011, 14:00:28 Algis Kabaila wrote: > On Thu, 7 Jul 2011 09:03:47 PM Hans-Peter Jansen wrote: > > Dear Al, > > > > On Thursday 07 July 2011, 11:22:34 Algis Kabaila wrote: > > > This bothersome warning message probably has nothing to do with > > > PyQt. However, it does occur whenever I use PyQt. No great harm > > > seems to occur and the programs function normally, except for > > > that message. Is there something wrong with my setup or should I > > > just forget all about it? > > > > > > I attach a little test program "open.py". It does not do anything > > > - and just tries to open a file dialog after a click on the > > > pushButton. That produces the error message. > > > > > > The "program" is mainly filled with the message itself and some > > > comments. I would think that this probably has been dealt with, > > > but I will not know if I do not ask... so thanks again for your > > > patience. OTH, may be other people will find this informative, > > > too - or am the only one being subjected to this warning? > > > > > > #!/usr/bin/env python3.2 > > > ''' > > > open.py - a sample program to show the dire warning it generates > > > and every other program that tries to use a file read dialog. > > > Platform - kubuntu 11.04 "natty" > > > Python 3.2 > > > Qt 4.7.2 (from "natty" binaries. > > > PyQt4 4.8.4 - bound to Python 3.2 whilst compiling > > > > > > On opening a file dialog, I get this warning: > > > > > > KGlobal::locale::Warning your global KLocale is being recreated > > > with a valid main component instead of a fake component, this > > > usually means you tried to call i18n related functions before > > > your main component was created. You should not do that since it > > > most likely will not work > > > > > > Search on the net seems to give some grim news: > > > > > > > > > Re: VLC Hangs on Open File dialog > > > Postby Rémi Denis-Courmont » Sat Jan 29, 2011 11:58 pm > > > In the mean time, someone in KDE actually looked at the issue. > > > It turns to be a longstanding known bug in the QProcess class > > > from Qt4. That bug gets triggered by a new "feature" in KDE 4.6 > > > relative to MIME types in the Open and Save dialogs, that happens > > > to involve the QProcess class. > > > > > > In the end, VLC is blaming KDE, KDE is blaming Qt, and Qt is > > > blaming the kernel. > > > > > > ''' > > > > Hmm, at the first glance, this is a KDE problem, since KDE plugs > > its own file dialog into Qt, but fails to properly deal with > > locales there after due to them not being initialized correctly. > > This is going to produce issues, if you're calling QFileDialogs and > > expects them being localized correctly. It might be possible to > > circumvent these issues by instancing KApplication instead of > > QApplication (and doing the proper KDE4 setup sequence). > > > > Detlev is doing a nice trick in eric4: it checks, if PyKDE4 is > > available, and uses it, otherwise it uses plain Qt4. > > > > How this could be related to QProcess escapes me but what do I > > know.. > > > > Pete > > Yes, I recall Detlev putting me right on other issues with PyKDE4 - > requires putting a tick on one of the configuration boxes of eric. I > am using eric5 (that's the python3 version). I will install the > newest version and look for the "box to tick" - Detlev is a very > helpful guy! Yes, and eric is awesome. But unfortunately, even eric (4.4.16 at least) using PyKDE4 code suffer from this, too. Hence I was wrong. > The message does occur exactly the same way when the scripts are > fired from CLI. I should try it on a gnome desktop in order to avoid > PyKDE4. No, it's not a PyKDE4 issue. It's triggered deep under the covers somewhere between KDE4 and Qt4. We will have to wait for the respective people to have it fixed one day. You will get rid of it, if you deinstall kdelibs4 and all dependencies, but probably, it's easier to wait and live with it. > IIRIC, PyKDE4 is not windows compatible. And that is a > problem if one wants to ensure compatibility with Windows - I do not > really care about that. Too late for me :). That was a red herring. See above. Pete ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] A dire warning message
On Thu, 7 Jul 2011 09:03:47 PM Hans-Peter Jansen wrote: > Dear Al, > > On Thursday 07 July 2011, 11:22:34 Algis Kabaila wrote: > > This bothersome warning message probably has nothing to do with PyQt. > > However, it does occur whenever I use PyQt. No great harm seems to > > occur and the programs function normally, except for that message. > > Is there something wrong with my setup or should I just forget all > > about it? > > > > I attach a little test program "open.py". It does not do anything - > > and just tries to open a file dialog after a click on the > > pushButton. That produces the error message. > > > > The "program" is mainly filled with the message itself and some > > comments. I would think that this probably has been dealt with, but I > > will not know if I do not ask... so thanks again for your patience. > > OTH, may be other people will find this informative, too - or am the > > only one being subjected to this warning? > > > > #!/usr/bin/env python3.2 > > ''' > > open.py - a sample program to show the dire warning it generates > > and every other program that tries to use a file read dialog. > > Platform - kubuntu 11.04 "natty" > > Python 3.2 > > Qt 4.7.2 (from "natty" binaries. > > PyQt4 4.8.4 - bound to Python 3.2 whilst compiling > > > > On opening a file dialog, I get this warning: > > > > KGlobal::locale::Warning your global KLocale is being recreated with > > a valid main component instead of a fake component, this usually > > means you tried to call i18n related functions before your main > > component was created. You should not do that since it most likely > > will not work > > > > Search on the net seems to give some grim news: > > > > > > Re: VLC Hangs on Open File dialog > > Postby Rémi Denis-Courmont » Sat Jan 29, 2011 11:58 pm > > In the mean time, someone in KDE actually looked at the issue. > > It turns to be a longstanding known bug in the QProcess class from > > Qt4. That bug gets triggered by a new "feature" in KDE 4.6 relative > > to MIME types in the Open and Save dialogs, that happens to involve > > the QProcess class. > > > > In the end, VLC is blaming KDE, KDE is blaming Qt, and Qt is blaming > > the kernel. > > > > ''' > > Hmm, at the first glance, this is a KDE problem, since KDE plugs its own > file dialog into Qt, but fails to properly deal with locales there > after due to them not being initialized correctly. This is going to > produce issues, if you're calling QFileDialogs and expects them being > localized correctly. It might be possible to circumvent these issues by > instancing KApplication instead of QApplication (and doing the proper > KDE4 setup sequence). > > Detlev is doing a nice trick in eric4: it checks, if PyKDE4 is > available, and uses it, otherwise it uses plain Qt4. > > How this could be related to QProcess escapes me but what do I know.. > > Pete Yes, I recall Detlev putting me right on other issues with PyKDE4 - requires putting a tick on one of the configuration boxes of eric. I am using eric5 (that's the python3 version). I will install the newest version and look for the "box to tick" - Detlev is a very helpful guy! The message does occur exactly the same way when the scripts are fired from CLI. I should try it on a gnome desktop in order to avoid PyKDE4. IIRIC, PyKDE4 is not windows compatible. And that is a problem if one wants to ensure compatibility with Windows - I do not really care about that. Too late for me :). Thanks, Pete, Al. ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] A dire warning message
Dear Al, On Thursday 07 July 2011, 11:22:34 Algis Kabaila wrote: > This bothersome warning message probably has nothing to do with PyQt. > However, it does occur whenever I use PyQt. No great harm seems to > occur and the programs function normally, except for that message. > Is there something wrong with my setup or should I just forget all > about it? > > I attach a little test program "open.py". It does not do anything - > and just tries to open a file dialog after a click on the > pushButton. That produces the error message. > > The "program" is mainly filled with the message itself and some > comments. I would think that this probably has been dealt with, but I > will not know if I do not ask... so thanks again for your patience. > OTH, may be other people will find this informative, too - or am the > only one being subjected to this warning? > > #!/usr/bin/env python3.2 > ''' > open.py - a sample program to show the dire warning it generates > and every other program that tries to use a file read dialog. > Platform - kubuntu 11.04 "natty" > Python 3.2 > Qt 4.7.2 (from "natty" binaries. > PyQt4 4.8.4 - bound to Python 3.2 whilst compiling > > On opening a file dialog, I get this warning: > > KGlobal::locale::Warning your global KLocale is being recreated with > a valid main component instead of a fake component, this usually > means you tried to call i18n related functions before your main > component was created. You should not do that since it most likely > will not work > > Search on the net seems to give some grim news: > > > Re: VLC Hangs on Open File dialog > Postby Rémi Denis-Courmont » Sat Jan 29, 2011 11:58 pm > In the mean time, someone in KDE actually looked at the issue. > It turns to be a longstanding known bug in the QProcess class from > Qt4. That bug gets triggered by a new "feature" in KDE 4.6 relative > to MIME types in the Open and Save dialogs, that happens to involve > the QProcess class. > > In the end, VLC is blaming KDE, KDE is blaming Qt, and Qt is blaming > the kernel. > > ''' Hmm, at the first glance, this is a KDE problem, since KDE plugs its own file dialog into Qt, but fails to properly deal with locales there after due to them not being initialized correctly. This is going to produce issues, if you're calling QFileDialogs and expects them being localized correctly. It might be possible to circumvent these issues by instancing KApplication instead of QApplication (and doing the proper KDE4 setup sequence). Detlev is doing a nice trick in eric4: it checks, if PyKDE4 is available, and uses it, otherwise it uses plain Qt4. How this could be related to QProcess escapes me but what do I know.. Pete ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] A dire warning message
This bothersome warning message probably has nothing to do with PyQt. However, it does occur whenever I use PyQt. No great harm seems to occur and the programs function normally, except for that message. Is there something wrong with my setup or should I just forget all about it? I attach a little test program "open.py". It does not do anything - and just tries to open a file dialog after a click on the pushButton. That produces the error message. The "program" is mainly filled with the message itself and some comments. I would think that this probably has been dealt with, but I will not know if I do not ask... so thanks again for your patience. OTH, may be other people will find this informative, too - or am the only one being subjected to this warning? #!/usr/bin/env python3.2 ''' open.py - a sample program to show the dire warning it generates and every other program that tries to use a file read dialog. Platform - kubuntu 11.04 "natty" Python 3.2 Qt 4.7.2 (from "natty" binaries. PyQt4 4.8.4 - bound to Python 3.2 whilst compiling On opening a file dialog, I get this warning: KGlobal::locale::Warning your global KLocale is being recreated with a valid main component instead of a fake component, this usually means you tried to call i18n related functions before your main component was created. You should not do that since it most likely will not work Search on the net seems to give some grim news: Re: VLC Hangs on Open File dialog Postby Rémi Denis-Courmont » Sat Jan 29, 2011 11:58 pm In the mean time, someone in KDE actually looked at the issue. It turns to be a longstanding known bug in the QProcess class from Qt4. That bug gets triggered by a new "feature" in KDE 4.6 relative to MIME types in the Open and Save dialogs, that happens to involve the QProcess class. In the end, VLC is blaming KDE, KDE is blaming Qt, and Qt is blaming the kernel. ''' import sys from PyQt4.QtGui import QDialog, QFileDialog, QApplication from ui_open import Ui_Dialog class Dialog(QDialog, Ui_Dialog): def __init__(self, parent=None): super().__init__(parent) self.setupUi(self) self.pushButton.clicked.connect(self.open) def open(self): fname = QFileDialog.getOpenFileName(self, "Open File", '.', "Files (*.*)") # The following warning message is generated: # KGlobal::locale::Warning your global KLocale is being recreated with # a valid main component instead of a fake component, this usually # means you tried to call i18n related functions before your main # component was created. You should not do that since it most likely # will not work if __name__ == '__main__': app = QApplication(sys.argv) frame = Dialog() frame.show() app.exec_() open.ui Description: application/designer ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt