On 10/01/2012, at 09:42 , Sylvain Thénault wrote:

> Hi,
> 
> On 02 janvier 10:02, A.T.Hofkamp wrote:
>> On 12/30/2011 04:51 AM, Derek Harland wrote:
>>> +    lintPath = os.path.join(os.path.dirname(__file__), 'lint.py')
>>> +    cmd = '%s %s -f parseable -r n --disable=C,R,I "%s"' % 
>>> (sys.executable, lintPath, childPath)
>>> +    process = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE, 
>>> cwd=parentPath)
>> 
>> While you are at it, you could also drop use of the shell, which is
>> safer with respect to shell quoting problems, as in
>> 
>> cmd = [sys.executable, lintPath, '-f', 'parseable', '-r', 'n', 
>> '--disable=C,R,I', childPath]
>> process = Popen(cmd, stdout=PIPE, stderr=PIPE, cwd=parentPath)
> 
> thank you both for your suggestion. I've turned this into a "real" patch,
> if you mind take a look at it before integration: 
> http://www.logilab.org/patch/87029
> 
> Derek: notice a difference with your patch: instead of printing 'Error + 
> statuscode',
> I simply made the 'lint' function return the status code, and the Run function
> sys.exit with the proper code. That's because pylint exit code will be != 0
> according to the messages issued, as explained by pylint --long-help, so I'm 
> afraid
> this will be wrongly interpreted by users.

Looks great!  I had also already dropped the exit code check ... it was 
actually a debugging hangover.
I'm much happier now that I've got pylint highlighting in emacs across all 
python and virtualenv versions!

derek.

_______________________________________________
Python-Projects mailing list
[email protected]
http://lists.logilab.org/mailman/listinfo/python-projects

Reply via email to