You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2020-03-17.12:26:59.894>created_at=<Date2020-03-17.12:09:46.569>labels= ['3.7']
title='Windows line endings of pyc file detected on Ubuntu'updated_at=<Date2020-03-17.12:26:59.893>user='https://bugs.python.org/vladinko0'
When I compile it in python console with commands:
importpy_compilepy_compile.compile('test2.py')
I get test2.cpython-37.pyc file. Then I add execution access by
chmod +x test2.cpython-37.pyc
If I run
./test2.cpython-37.pyc
on first machine (Ubuntu Server 18.04.4 LTS) I get simple "Hi".
But if I run similarly compiled file on other machine with the same OS - Ubuntu Server 18.04.4 LTS, I get:
./test2.cpython-37.pyc: line 1: $'B\r\r': command not found
./test2.cpython-37.pyc: line 2: syntax error near unexpected token )' ./test2.cpython-37.pyc: line 2: z�p^=�@s
ed�dS)ZHiN)�print�rrtest2.py�'
It looks like it is reading Windows line endings. But why? It is created, compiled and run on Ubuntu machine.
How can I solve this issue, and run this pyc file with the right result on second machine?
pyc files are not executable files. If you can run it on your machine it means that you have installed some loader hook which allow you to run files which are not machine executable files and not shell scripts. It seems it is not installed on your other machine. This hook is not a part of Python. You have to find what additional software is installed on your first machine and install the necessary parts on your other machine.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: