[SERVER-28947] Improve pylinters.py error message when finding linters Created: 24/Apr/17  Updated: 30/Oct/23  Resolved: 27/Apr/17

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 3.5.7

Type: Bug Priority: Major - P3
Reporter: Mark Benvenuto Assignee: Mark Benvenuto
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Platforms 2017-05-08
Participants:

 Description   

Debian and Ubuntu machines use an custom layout for python packages. For instance, pip installed modules are installed into /usr/local/ instead of /usr, and into a directory named dist-packages instead of the normal site-packages directory.

This first change means that the default search logic in pylinters.py cannot find the lint scripts in the default directory. This causes messages to be printed to standard error since the first location check for a linter fails even if the second one succeeds. The second check, based on PATH, succeeds since Debian/Ubuntu includes /usr/local/bin in PATH by default.

Example of the confusing messages

/usr/bin/python2.7: can't open file '/usr/bin/yapf': [Errno 2] No such file or directory
/usr/bin/python2.7: can't open file '/usr/bin/pylint': [Errno 2] No such file or directory

To improve the user experience, standard error should be captured, and only outputted on failure.



 Comments   
Comment by Githook User [ 27/Apr/17 ]

Author:

{u'username': u'markbenvenuto', u'name': u'Mark Benvenuto', u'email': u'mark.benvenuto@mongodb.com'}

Message: SERVER-28947 Improve pylinters.py error message when finding linters
Branch: master
https://github.com/mongodb/mongo/commit/c87222f209ac73621274869cc459672cc3ff978c

Generated at Thu Feb 08 04:19:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.