Bug 1269952 - python scripts using #!/usr/bin/env python shebang will be affected by python3 default interpreter in Fedora 23.
Summary: python scripts using #!/usr/bin/env python shebang will be affected by pytho...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: python3
Version: 23
Hardware: All
OS: Linux
unspecified
urgent
Target Milestone: ---
Assignee: Charalampos Stratakis
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-10-08 14:51 UTC by Goutam Kodu
Modified: 2016-02-01 08:46 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-02-01 08:46:27 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Goutam Kodu 2015-10-08 14:51:24 UTC
Description of problem:
Python scripts have #!/usr/bin/env python will fail to execute in Fedora 23

Version-Release number of selected component (if applicable):
python3

How reproducible:
Run  /usr/bin/env python in terminal

Steps to Reproduce:
1.
2.
3.

Actual results:
python file not found.

Expected results:
The script should run irrespective of python3 being the default interpreter

Additional info:
This would affect the software supporting both py2.X and py3.X versions.

Comment 1 Goutam Kodu 2015-10-12 03:03:00 UTC
Hi,

Can somebody update what is the resolution for this bug ?
Will there be python file soft linked to python3 ?

Thanks,
Goutam

Comment 2 Petr Viktorin (pviktori) 2015-10-12 09:21:21 UTC
The current upstream recommendation is that "python" should mean Python 2 (see [PEP 394]). As with any script, you need to install the interpreter that can run it – in this case, Python 2.

Alternatively, you can change the shebang to "#!/usr/bin/env python3".


A shebang that would somehow automatically choose between py2 and py3 is being discussed upstream: https://mail.python.org/pipermail/linux-sig/2015-October/000000.html

[PEP 394]: https://www.python.org/dev/peps/pep-0394/

Comment 3 Fedora Admin XMLRPC Client 2016-01-29 13:08:30 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 4 Petr Viktorin (pviktori) 2016-01-29 13:36:30 UTC
Hello Goutam,
Did that answer your question, or do you need any more info?

Comment 5 Goutam Kodu 2016-02-01 02:13:10 UTC
Yes Petr that answered my question. Sorry for delay in my response.
We updated the code with "#!/usr/bin/env python3" shebang

thanks,
Goutam

Comment 6 Petr Viktorin (pviktori) 2016-02-01 08:46:27 UTC
Thanks for the reply. I'll close the bug, but get in touch if anything else is unclear.


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