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
{{ message }}
Repository navigation
python 2to3 conversion tool is generating file with extra line for every input line #80256
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=<Date2019-10-08.14:54:16.716>created_at=<Date2019-02-22.09:38:39.354>labels= ['3.7', 'build', 'expert-2to3']
title='python 2to3 conversion tool is generating file with extra line for every input line'updated_at=<Date2019-10-08.14:54:16.715>user='https://github.com/SabaKauser'
python setup.py build
and installing as:
python setup.py install
I have a python script that after installing has new empty line added for every line.
e.g:
my source:
if database is None:
raise InterfaceError("createdb expects a not None database name value")
if (not isinstance(database, basestring)) | \
(not isinstance(codeset, basestring)) | \
(not isinstance(mode, basestring)):
raise InterfaceError("Arguments sould be string or unicode")
The generated file under C:\Users\skauser\AppData\Local\Programs\Python\Python37\Lib\site-packages\ibm_db-2.0.9-py3.7-win-amd64.egg\ibm_db_dbi.py
ifdatabaseisNone:
raise InterfaceError("createdb expects a not None database name value")
if (not isinstance(database, str)) | \
(not isinstance(codeset, str)) | \
(not isinstance(mode, str)):
raise InterfaceError("Arguments sould be string or unicode")
As you can see, there is this new line that is throwing runtime error.
File "c:\users\skauser\appdata\local\programs\python\python37\lib\site-packages\ibm_db-2.0.9-py3.7-win-amd64.egg\ibm_db_dbi.py", line 846
^
SyntaxError: invalid syntax
Could you please let me know how can I get rid of this behavior?
When I install the package using pip, I don't see this behavior.
I suspect that this may not be a cpython issue, in which case, it should be closed here as 'not-a-bug'. I suggest that you present this on python-list and ask 'where is the bug most likely to be?' You should get more readers there.
Activity
SabaKauser commentedon Feb 22, 2019
Hi,
I am building my python ibm_db driver on python 3.7 using the setup.py under https://github.com/SabaKauser/python-ibmdb/blob/master/IBM_DB/ibm_db/setup.py with 2to3 compatibility as:
python setup.py build
and installing as:
python setup.py install
I have a python script that after installing has new empty line added for every line.
e.g:
my source:
if database is None:
raise InterfaceError("createdb expects a not None database name value")
if (not isinstance(database, basestring)) | \
(not isinstance(codeset, basestring)) | \
(not isinstance(mode, basestring)):
raise InterfaceError("Arguments sould be string or unicode")
The generated file under C:\Users\skauser\AppData\Local\Programs\Python\Python37\Lib\site-packages\ibm_db-2.0.9-py3.7-win-amd64.egg\ibm_db_dbi.py
As you can see, there is this new line that is throwing runtime error.
File "c:\users\skauser\appdata\local\programs\python\python37\lib\site-packages\ibm_db-2.0.9-py3.7-win-amd64.egg\ibm_db_dbi.py", line 846
SyntaxError: invalid syntax
Could you please let me know how can I get rid of this behavior?
When I install the package using pip, I don't see this behavior.
Thanks!
Saba.
SabaKauser commentedon Feb 26, 2019
Did anyone get a chance to look at my case?
Thanks,
Saba.
terryjreedy commentedon Mar 1, 2019
I suspect that this may not be a cpython issue, in which case, it should be closed here as 'not-a-bug'. I suggest that you present this on python-list and ask 'where is the bug most likely to be?' You should get more readers there.
SabaKauser commentedon Mar 1, 2019
Could you please share the URL
tirkarthi commentedon Mar 1, 2019
@SabaKauser You can find python-list mailing list here : https://mail.python.org/mailman/listinfo/python-list
SabaKauser commentedon Mar 1, 2019
Thanks Karthikeyan!
mdickinson commentedon Oct 8, 2019
Looks like a duplicate of bpo-34108
mdickinson commentedon Oct 8, 2019
Closing as duplicate.
@SabaKauser: if you update to a recent Python 3.7 (anything more recent than 3.7.1 should be enough), you should find that this is fixed.