google-code-export / pymssql

Automatically exported from code.google.com/p/pymssql
GNU Lesser General Public License v2.1
0 stars 0 forks source link

Cannot convert Python object to 'const_char *' #52

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Trying to install pymssql
2. python setup.py install

What is the expected output? What do you see instead?
Produce this error 

/usr/local/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown 
distribution option: 'zip_safe'
  warnings.warn(msg)
/usr/local/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown 
distribution option: 'setup_requires'
  warnings.warn(msg)
running install
running build
running build_ext
cythoning _mssql.pyx to _mssql.c

Error compiling Cython file:
------------------------------------------------------------
...

            if strlen(self._charset) > 0 and type(value) is unicode:
                value = value.encode(self._charset)

            strValue = <char *>PyMem_Malloc(len(value) + 1)
            strcpy(strValue, value)
                                 ^
------------------------------------------------------------

_mssql.pyx:650:34: Cannot convert Python object to 'const_char *'
building '_mssql' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall 
-Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/local/include/freetds 
-I/usr/include -I/usr/include/freetds -I/usr/include/freetds_mssql 
-I/usr/local/freetds/include -I/usr/pkg/freetds/include 
-I/usr/local/include/python2.7 -c _mssql.c -o 
build/temp.linux-i686-2.7/_mssql.o -DMSDBLIB
_mssql.c:1:2: error: #error Do not use this file, it is the result of a failed 
Cython compilation.
error: command 'gcc' failed with exit status 1

What version of the product are you using? On what operating system?

The version of pymssql is 1.9.908
The version of cython is 0.14.1
The operating system is OpenSuse 11.3 (i586)

Please provide any additional information below.

Original issue reported on code.google.com by umberto....@gmail.com on 10 May 2011 at 1:35

GoogleCodeExporter commented 9 years ago
Can you please see if you can reproduce from the code from tip in the HG repo.

Original comment by rsyr...@gmail.com on 10 May 2011 at 3:16

GoogleCodeExporter commented 9 years ago
I'm a colleague of Umberto.
we download the code from the HG repo and the error it's change:

python setup.py install
running install
install_dir /usr/local/lib/python2.7/site-packages/
running bdist_egg
running egg_info
writing pymssql.egg-info/PKG-INFO
writing top-level names to pymssql.egg-info/top_level.txt
writing dependency_links to pymssql.egg-info/dependency_links.txt
writing entry points to pymssql.egg-info/entry_points.txt
reading manifest file 'pymssql.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*' under directory '.pyrex'
writing manifest file 'pymssql.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-i686/egg
running install_lib
running build_ext
building '_mssql' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall 
-Wstrict-                                                                       
      prototypes -fPIC -I/usr/local/include -I/usr/local/include/freetds 
-I/usr/includ                                                                   
          e -I/usr/include/freetds -I/usr/include/freetds_mssql 
-I/usr/local/freetds/inclu                                                      
                       de -I/usr/pkg/freetds/include 
-I/usr/local/include/python2.7 -c _mssql.c -o buil                              
                                               d/temp.linux-i686-2.7/_mssql.o 
-DMSDBLIB
gcc: _mssql.c: No such file or directory
gcc: no input files
error: command 'gcc' failed with exit status 1

Original comment by claudio....@e-jest.net on 11 May 2011 at 8:43

GoogleCodeExporter commented 9 years ago
Please try the latest code, I just made a push and this code is building for me.

Also, try python setup.py build and python setup.py develop.

The error is strange b/c it indicates _mssql.c is not being found.

Original comment by rsyr...@gmail.com on 17 May 2011 at 7:36

GoogleCodeExporter commented 9 years ago
downloading the lastest code we solved the problem.
thanks.

Original comment by c.ardu...@gmail.com on 18 May 2011 at 12:05

GoogleCodeExporter commented 9 years ago

Original comment by rsyr...@gmail.com on 8 Mar 2012 at 3:20