Bug 2179979 - User site directories are not added to sys.path
Summary: User site directories are not added to sys.path
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-behave
Version: 38
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ali Erdinc Koroglu
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-03-20 13:23 UTC by amatej
Modified: 2023-03-31 11:20 UTC (History)
4 users (show)

Fixed In Version: python-behave-1.2.6-21.fc37 python-behave-1.2.6-21.fc38 python-behave-1.2.6-21.fc36
Clone Of:
Environment:
Last Closed: 2023-03-31 01:28:54 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description amatej 2023-03-20 13:23:58 UTC
Description of problem:
Since python-behave-1.2.6-19.fc38 behave runs python with -s option.

> $ cat /usr/bin/behave
> #! /usr/bin/python3 -sP
> # -*- coding: utf-8 -*-
> import re
> ...

This results in behave not finding python packages installed with pip because they are installed to /usr/local prefix.

Version-Release number of selected component (if applicable):
python-behave-1.2.6-19.fc38

How reproducible:
Always

Steps to Reproduce:
1. $ podman run -it fedora:38
2. [root@1cb3c4d30c32 /]# dnf install python3-behave python3-pip -y
3. [root@1cb3c4d30c32 /]# pip3 install pyftpdlib
4. [root@1cb3c4d30c32 /]# mkdir test && cd test
5. [root@1cb3c4d30c32 test]# echo "import pyftpdlib" > environment.py
6. [root@1cb3c4d30c32 test]# touch a.feature && mkdir steps
7. [root@1cb3c4d30c32 test]# behave

Actual results:
ModuleNotFoundError: No module named 'pyftpdlib'

Expected results:
Module is imported

Additional info:
In python-behave-1.2.6-17.fc37 it works.

Comment 1 Ali Erdinc Koroglu 2023-03-22 15:36:01 UTC
I think this (https://fedoraproject.org/wiki/Changes/PythonSafePath) caused that.

Comment 2 Fedora Update System 2023-03-22 15:38:41 UTC
FEDORA-2023-0dff426f3b has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-0dff426f3b

Comment 3 Fedora Update System 2023-03-22 15:38:42 UTC
FEDORA-2023-7155ed7e47 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2023-7155ed7e47

Comment 4 Fedora Update System 2023-03-22 15:38:43 UTC
FEDORA-2023-f60e2a40c1 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2023-f60e2a40c1

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

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

Comment 6 Fedora Update System 2023-03-23 02:57:04 UTC
FEDORA-2023-0dff426f3b has been pushed to the Fedora 38 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-0dff426f3b

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

Comment 7 Fedora Update System 2023-03-23 03:46:42 UTC
FEDORA-2023-7155ed7e47 has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-7155ed7e47`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-7155ed7e47

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

Comment 8 Fedora Update System 2023-03-31 01:28:54 UTC
FEDORA-2023-f60e2a40c1 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 9 Fedora Update System 2023-03-31 01:33:17 UTC
FEDORA-2023-0dff426f3b has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 10 Fedora Update System 2023-03-31 02:42:20 UTC
FEDORA-2023-7155ed7e47 has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 11 Miro Hrončok 2023-03-31 11:20:28 UTC
(In reply to Ali Erdinc Koroglu from comment #1)
> I think this (https://fedoraproject.org/wiki/Changes/PythonSafePath) caused
> that.

Not actually caused by this change, but the fix in https://src.fedoraproject.org/rpms/python-behave/c/a4f134cd6c7328a7c1b97d7372a8ee82f68af28c?branch=rawhide is correct.


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