** Description changed:

- When there is a failure to import a module this failure is logged but
- also means that everything else will be logged to stdout from that point
- on.
+ When failing to import a module the gi.repository import.py module logs an 
error with `logging.error(..)` causing a logging handler to be added.
+ This basically breaks the ability to configure the logging as it happens so 
early (i.e. at the import stage before an authors code is executed).
  
- The Issue:
- When failing to import a module the gi.repository import module adds a 
handler, that sends output to stdout, to the root logger. This means that _any_ 
logging after the failed import will be sent to stdout.
+ To reproduce/Example:
  
- To reproduce/test:
+ Run this script: http://pastebin.ubuntu.com/7698632/
  
- Run the python script found here: http://pastebin.ubuntu.com/7693434/
+ Expected outcome:
+ No output to stdout or stderr and the text "log message" in the file 
"/tmp/example.log
  
- Expected output: Nothing. No logging and no text etc.
+ Actual outcome:
+ No log file, and this text output to stderr:
+   ERROR:root:Could not find any typelib for rubbish
+   ERROR:root:log message
  
- Actual Output:
- ERROR:root:Could not find any typelib for rubbish
- INFO:something-not-root:You shouldn't see this
- 
- Note that you can see the logged output for "something-not-root" even
- though it's logging level is set to INFO (which isn't normally shown).
  
  Upstream fix: https://git.gnome.org/browse/pygobject/commit/?id=ac8b59e
  
  Ubuntu Version:
  Description:  Ubuntu 14.04 LTS
  Release:      14.04
  
  Package Version:
  python3-gi 3.12.0-1

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1333512

Title:
  Failing to import module adds noise to the logging stream

To manage notifications about this bug go to:
https://bugs.launchpad.net/pygobject/+bug/1333512/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to