[New-bugs-announce] [issue36075] python 2to3 conversion tool is generating file with extra line for every input line

Saba Kauser report at bugs.python.org
Fri Feb 22 04:38:39 EST 2019


New submission from Saba Kauser <skauseribmdb at gmail.com>:

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.

----------
components: 2to3 (2.x to 3.x conversion tool)
messages: 336288
nosy: sabakauser
priority: normal
severity: normal
status: open
title: python 2to3 conversion tool is generating file with extra line for every input line
type: compile error
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36075>
_______________________________________


More information about the New-bugs-announce mailing list