Issue 36075: python 2to3 conversion tool is generating file with extra line for every input line (original) (raw)

Created on 2019-02-22 09:38 by sabakauser, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (8)
msg336288 - (view) Author: Saba Kauser (sabakauser) Date: 2019-02-22 09:38
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 if database is None: 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. Thanks! Saba.
msg336599 - (view) Author: Saba Kauser (sabakauser) Date: 2019-02-26 03:11
Did anyone get a chance to look at my case? Thanks, Saba.
msg336888 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2019-03-01 03:42
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.
msg336889 - (view) Author: Saba Kauser (sabakauser) Date: 2019-03-01 04:05
Could you please share the URL
msg336891 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-03-01 04:39
@sabakauser You can find python-list mailing list here : https://mail.python.org/mailman/listinfo/python-list
msg336896 - (view) Author: Saba Kauser (sabakauser) Date: 2019-03-01 05:52
Thanks Karthikeyan!
msg354214 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2019-10-08 14:35
Looks like a duplicate of #34108
msg354217 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2019-10-08 14:54
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.
History
Date User Action Args
2022-04-11 14:59:11 admin set github: 80256
2019-10-08 14:54:16 mark.dickinson set status: open -> closedsuperseder: 2to3 munges new lines on Windowsmessages: + resolution: duplicatestage: resolved
2019-10-08 14:35:36 mark.dickinson set nosy: + mark.dickinsonmessages: +
2019-03-01 05:52:29 sabakauser set messages: +
2019-03-01 04:39:16 xtreak set nosy: + xtreakmessages: +
2019-03-01 04:05:01 sabakauser set messages: +
2019-03-01 03:42:14 terry.reedy set nosy: + terry.reedymessages: +
2019-02-26 03:11:27 sabakauser set messages: +
2019-02-22 09:38:39 sabakauser create