Comments (21)
Worth noting that this works fine with pyodbc
Original comment by [email protected]
on 1 Apr 2013 at 9:05
from pypyodbc.
Same result with latest from Git.
Original comment by [email protected]
on 1 Apr 2013 at 10:25
from pypyodbc.
Can you provide additional information, such as 64bit , 32bit information ?
Original comment by [email protected]
on 1 Apr 2013 at 10:50
from pypyodbc.
Yep, 64bit CentOS 6.1 with 64-bit Python 2.7.2.
Original comment by [email protected]
on 1 Apr 2013 at 10:52
from pypyodbc.
Also tried with 64-bit CentOS 6.3, RHEL 6.1 and Python 3.2.3. All give the
same error.
Original comment by [email protected]
on 1 Apr 2013 at 11:21
from pypyodbc.
[deleted comment]
from pypyodbc.
Can you check what would be the output if you add ansi=False?
conn = pypyodbc.connect('DRIVER={MySQL ODBC 5.1
Driver};SERVER=myserver;DATABASE=mydb;UID=user;PWD=password',ansi=False,ansi=Fal
se,unicode_results=Fase)
Original comment by [email protected]
on 1 Apr 2013 at 12:02
from pypyodbc.
Do you mean ansi=True? False is default. If I do =True, it connects ok, but
then all my results come back encoded like:
u'\udc80\udc75\udc40\udc65'
Original comment by [email protected]
on 1 Apr 2013 at 12:02
from pypyodbc.
conn = pypyodbc.connect('DRIVER={MySQL ODBC 5.1
Driver};SERVER=myserver;DATABASE=mydb;UID=user;PWD=password',ansi=False,unicode_
results=False)
Gives me the same error...
conn = pypyodbc.connect('DRIVER={MySQL ODBC 5.1
Driver};SERVER=myserver;DATABASE=mydb;UID=user;PWD=password',ansi=True,unicode_r
esults=False)
Still gives me unicode results.
Original comment by [email protected]
on 1 Apr 2013 at 12:05
from pypyodbc.
[deleted comment]
from pypyodbc.
And if you try and print one of the unicode results:
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 0-3:
ordinal not in range(256)
Original comment by [email protected]
on 1 Apr 2013 at 12:39
from pypyodbc.
I will install a CentOS 64bit and try that.
Original comment by [email protected]
on 1 Apr 2013 at 12:59
from pypyodbc.
Thanks! Just so you get the same setup:
$ odbcinst --version
unixODBC 2.3.0
$ cat /etc/odbcinst.ini
[PostgreSQL]
Description=ODBC for PostgreSQL
Driver=/usr/lib/libodbcpsql.so
FileUsage=1
[SQL Server Native Client 11.0]
Description=Microsoft SQL Server ODBC Driver V1.0 for Linux
Driver=/opt/microsoft/sqlncli/lib64/libsqlncli-11.0.so.1790.0
Threading=1
UsageCount=1
[MySQL ODBC 5.1 Driver]
Driver=/usr/lib64/libmyodbc5.so
UsageCount=2
Original comment by [email protected]
on 1 Apr 2013 at 1:57
from pypyodbc.
It works fine on my Ubuntu box at home, so might well be a CentOS / RHEL issue.
Original comment by [email protected]
on 1 Apr 2013 at 8:10
from pypyodbc.
is your ubuntu at home 64 bit?
Original comment by [email protected]
on 1 Apr 2013 at 11:18
from pypyodbc.
Yes
Original comment by [email protected]
on 2 Apr 2013 at 6:21
from pypyodbc.
Hi, Finally I'm not able to setup CentOS, so I would like to suggest two quick
changes you can have a try.
First step:
-Open pypyodbc.py, text replace "if status == 0 and 'SQL_WCHART_CONVERT' in
output:" to "if True:" .This will only make one change in Line 479.
Have a try.
Second step:
-If that doesn't work, text replace all "utf_16" to "utf_32" and all
"utf_16_le" to "utf_32"
And then try again.
Hope that works.
Original comment by [email protected]
on 2 Apr 2013 at 12:10
from pypyodbc.
The fist test results in:
>>> import pypyodbc
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/scratch/Python/lib/python2.7/site-packages/pypyodbc.py", line 518, in <module>
raise OdbcLibraryError('Using narrow Python build with ODBC library '
pypyodbc.OdbcLibraryError: 'Using narrow Python build with ODBC library
expecting wide unicode is not supported.'
And the second (with or without the first) results in the same issue as before.
Original comment by [email protected]
on 2 Apr 2013 at 12:59
from pypyodbc.
This works fine on the same box with 3.3.1, so it could be an issue with 2.7.2.
Original comment by [email protected]
on 15 May 2013 at 1:18
from pypyodbc.
2.7.4 has the same issue
Original comment by [email protected]
on 15 May 2013 at 1:39
from pypyodbc.
Original comment by [email protected]
on 3 Sep 2013 at 11:35
- Changed state: Duplicate
from pypyodbc.
Related Issues (20)
- Description attribute returns only first char of name (as byte) using Oracle ODBC & Linux HOT 2
- Trimmed varchar results.
- Column names get wonky on 64-bit system using iSeries DB2 driver HOT 3
- Oracle and Decimal_cvt issue
- IronPython 2.7 StopIteration exception raised when retrieving SQL data set
- "invalid literal" exceptions querying empty numeric fields when using LinuxODBC with FreeTDS
- use mbdtools,chinese character encoded by gb charset can't access correctly
- Passing datetime.date returns TypeError: Wrong Type HOT 2
- Mapping bigint in sqlserver 2008 into float, instead of int in python3
- Bad cursor description (mixed bytes and strings) on Ubuntu 14.04 HOT 2
- Row objects don't raise KeyError for invalid fields
- Data source name not found on linux + unixodbc + as400 iseries driver HOT 1
- Cannot access column names by attribute HOT 4
- pypyodbc doesn't support the MSSQL datetimeoffset column type.
- state = err_list[0][0] Index out of range
- UnicodeDecodeError because UTF-16 surrogate pairs are not handled HOT 1
- Enhancement: Support for lists as SQL parameters
- executemany is very slow
- Sage Line 100 Odbc connect KO HOT 1
- Not working on Windows 7 64 bit 3.4.3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pypyodbc.