Bug 2256378 - pylint runs with user-installed packeges excluded
Summary: pylint runs with user-installed packeges excluded
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: pylint
Version: 39
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Gwyn Ciesla
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-01-01 17:18 UTC by Vlado Potisk
Modified: 2024-01-18 01:45 UTC (History)
3 users (show)

Fixed In Version: pylint-3.0.3-3.fc39
Clone Of:
Environment:
Last Closed: 2024-01-18 01:45:36 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Vlado Potisk 2024-01-01 17:18:50 UTC
/usr/bin/pylint starts with the line:

#! /usr/bin/python3 -sP

The -s option tells the Python not to add user site directory to sys.path. This obstructs checking of programs developed by the user. In my opinion the -s option should be removed.

Reproducible: Always

Steps to Reproduce:
1. select a python library/package name for testing,

   either na existing one from the output of:
       pip list --user

   or install from Pypi any arbitrary one not already present,
   preferrably small and without dependencies.
   I'm using a tiny utility "jsonstrip" just as an example:
       pip install --user jsonstrip

2. create a test.py file containing just the line "import jsonstrip",
   it is a correct python program albeit completely useless

3. verify that the program runs without errors:
      python test.py

4. run pylint test.py

5. (cleanup: remove test.py and uninstall jsonstrip)
Actual Results:  
pylint shows (among other lines):

   Unable to import 'jsonstrip' (import-error)

That is not true, see the step #3.

Expected Results:  
pylint should be able to import user-installed packages.

Comment 1 Gwyn Ciesla 2024-01-05 22:06:01 UTC
I see this, and I'm not sure what's adding that flag to the script.

Does testing with "python3 -m pylint test.py" work?

Comment 3 Gwyn Ciesla 2024-01-09 14:35:39 UTC
Ah ha, thank you! Update incoming.

Comment 4 Fedora Update System 2024-01-09 14:43:52 UTC
FEDORA-2024-19ce931ab4 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2024-19ce931ab4

Comment 5 Fedora Update System 2024-01-10 01:48:20 UTC
FEDORA-2024-19ce931ab4 has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-19ce931ab4`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-19ce931ab4

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Fedora Update System 2024-01-18 01:45:36 UTC
FEDORA-2024-19ce931ab4 has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.