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

Fix Qt Network Access warning messages that appear on the terminal #1236

Closed
spyder-bot opened this issue Feb 17, 2015 · 10 comments
Closed

Fix Qt Network Access warning messages that appear on the terminal #1236

spyder-bot opened this issue Feb 17, 2015 · 10 comments

Comments

@spyder-bot
Copy link
Collaborator

From jed.lud...@gmail.com on 2013-01-25T10:07:18Z

Spyder Version: 2.2.0beta1 ( r92dabd0783cc )
Python Version: 2.7.3
Qt Version: 4.8.3, PyQt4 (API v2) 4.9.5 on Windows

What steps will reproduce the problem?

  1. Lauch Spyder using bootstrap script
    1. Watch the system terminal What is the expected output? What do you see instead? I'm seeing these Qt warning messages repeatably in every session:

Executing Spyder from source checkout Revision 92dabd0783cc :2511, Branch: default

  1. Patched sys.path with C:
  2. Skipping GUI toolkit detection
    C:\Python27\lib\site-packages\pygments\plugin.py:39: UserWarning: Module rope wa
    s already imported from \rope__init__.
    pyc, but c:\python27\lib\site-packages is being added to sys.path
    import pkg_resources
  3. Imported Spyder 2.2.0beta1 (Qt 4.8.3 via PyQt4 (API v2) 4.9.5)
    0x. Enforcing parent console (Windows only)
  4. Executing spyder.main()
    QNetworkAccessFileBackendFactory: URL has no schema set, use file:// for files
    QNetworkAccessFileBackendFactory: URL has no schema set, use file:// for files
    QNetworkAccessFileBackendFactory: URL has no schema set, use file:// for files
    QNetworkAccessFileBackendFactory: URL has no schema set, use file:// for files
    QNetworkAccessFileBackendFactory: URL has no schema set, use file:// for files
    QNetworkAccessFileBackendFactory: URL has no schema set, use file:// for files
    QNetworkAccessFileBackendFactory: URL has no schema set, use file:// for files
    QNetworkAccessFileBackendFactory: URL has no schema set, use file:// for files
    QNetworkAccessFileBackendFactory: URL has no schema set, use file:// for files

Please provide any additional information below

.
I did some initial investigation, and I'm pretty sure they are coming from the object inspector loading up web pages from local files. I didn't see these messages until I upgraded Qt recently, and I suspect that it's now being more picky about formality. Unfortunately, I don't know this area of the code very well.

Messages are there with both PyQt and PySide on Windows, so there must be coming from Qt itself. I don't see the same messages on Ubuntu 12.04.

Original issue: http://code.google.com/p/spyderlib/issues/detail?id=1236

@spyder-bot
Copy link
Collaborator Author

From jed.lud...@gmail.com on 2013-01-25T07:08:43Z

Owner: ---

@spyder-bot
Copy link
Collaborator Author

From pierre.raybaut on 2013-01-27T02:02:25Z

This is also happening with the v21 branch. No idea where it comes from.

I really don't like getting my console saturated with warning messages. It gives the impression of a lack of stability.

@spyder-bot
Copy link
Collaborator Author

From pierre.raybaut on 2013-01-27T02:14:44Z

I thought that it could be related to either the Project Explorer or the File Explorer plugins, but apparently not. Disabling them do not prevent those messages to show up.

However, when disabling the "Open Python interpreter at startup", there is no more warnings.
Starting the same interpreter manually do not trigger those warnings.

Strange.

@spyder-bot
Copy link
Collaborator Author

From jed.lud...@gmail.com on 2013-01-27T07:05:19Z

I did enough stepping around in the code to be 99% sure it was coming from the object inspector. I think if you type in an object directly to the object inspector drop down you may be able to reproduce this.

I also did a little Qt research to know that the web browser component is throwing off errors when you simply throw it a local file to display without prefixing it with file://. But I didn't get further than that.

@spyder-bot
Copy link
Collaborator Author

From pierre.raybaut on 2013-01-27T08:47:29Z

You're right, this is coming from the object inspector indeed.
And I was seeing those warnings only when an interpreter was opened at startup because this feature is also triggering the object inspector after a certain timeout to show the last inspected object.

So this is a problem with the rich text mode of Object Inspector.
Each time the 'set_html' method is called to show "No doc available", two warnings "QNetworkAccessFileBackendFactory: URL has no schema set, use file:// for files" are shown: https://code.google.com/p/spyderlib/source/browse/spyderlib/plugins/inspector.py#153

Owner: ccordoba12
Labels: Cat-ObjectInspector MS-v2.2

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-01-27T09:16:42Z

Ok, I'll look it this week. I guess the problem arises because we're not passing a proper url to the base_url arg.

Summary: Fix Qt Network Access warning messages that appear on the terminal (was: Qt Network Access warning messages)

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-03-24T20:23:18Z

This issue was updated by revision 365492d0962c .

Status: Fixed

@spyder-bot
Copy link
Collaborator Author

From jed.lud...@gmail.com on 2013-03-25T07:38:40Z

Nice work, Carlos. I was looking at this bug a bit on Saturday. After debugging set_html over and over as Pierre suggested in comment 5, it was clear that the problem was not with the URLs we were sending to the Qt methods. Those all seemed to be appropriately prefixed with "file:". My next guess was that the actual HTML we were rending had embedded URLs that were the problem, but I ran out of time and didn't get to look deeper. Your fix confirms my suspicion.

Status: Verified

@spyder-bot
Copy link
Collaborator Author

From pierre.raybaut on 2013-04-13T09:30:00Z

Nicely done, indeed!

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-04-14T11:24:30Z

Thanks to both of you for your praising. After I spent a lot of time trying to debug the issue, I just wondered where those warnings could me coming from if they weren't generated by the inspector plugin. So I thought they should be coming from the network traffic between the web page and the widget.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant