[BangPypers] Python script hangs after using logging module

Aditya Laghate aditya at thinrhino.net.in
Tue May 27 07:05:40 CEST 2014

On 27/05, Rahul Gopan wrote:
> #!/usr/local/bin/python2.7
> import commands
> import subprocess
> import logging
> logging.basicConfig(filename='Log_file.log',filemode='w',format='%(asctime)s
> %(message)s',level=logging.DEBUG)
> items = commands.getoutput('COMMAND <branch> <Begin_no> <End_no> | wc -l')
> print items
> -- Hangs --
> Help me to resolve it

1. No reason for the code to hang, unless you 'command' is wrong.
2. you have only configured logging, but not putting anything into the
log file!

Going by the format in the getoutput, I can guess that you are looking
for some information wrt a version control system.

Check if the command works outside the python code.

More information about the BangPypers mailing list