Coder Social home page Coder Social logo

Comments (8)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
Just re-tested it on Linux, with both native microsoft driver and FreeTDS. The 
same thing happens, so the problem is certainly in pypyodbc code.

Original comment by [email protected] on 5 Jul 2013 at 4:46

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
I think I found the bug. This will be one character fix.

In pypyodbc.py in line 578, instead of

  lambda x:x=='1'

should be:

  lambda x:x==b'1'

Can somebody do an official code fix?

Original comment by [email protected] on 5 Jul 2013 at 5:43

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
Hi, Thanks for reporting this and the fix.
I have updated the source code in GitHub:

https://github.com/jiangwen365/pypyodbc/blob/master/pypyodbc.py

Original comment by [email protected] on 6 Jul 2013 at 2:37

  • Changed state: Fixed

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
Sorry, your fix does not work in Python3. You effectively call:
   bytes('1')
which gives an error:
   TypeError: string argument without an encoding
I guess, you did not try the fix in Python3.

If you use bytes() function, it should be bytes('1', 'ascii')
I understand it is a little tricky to support both Python2 and Python3.
For me, the "b'1'" worked fine. Can you try it in Python2? If it works, then 
you can fix it the way I suggested. 

Original comment by [email protected] on 8 Jul 2013 at 4:29

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
Or you can simply fix the line 42 like this:

       str_8b = lambda s: bytes(s, 'ascii')

Original comment by [email protected] on 8 Jul 2013 at 4:44

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
Hi, yes, that does work, I have updated the source code in GitHub:

https://github.com/jiangwen365/pypyodbc/blob/master/pypyodbc.py

Can you try again and see if it works?

Original comment by [email protected] on 9 Jul 2013 at 1:29

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
I already tried this by fixing the code in my own copy of the module.

Original comment by [email protected] on 9 Jul 2013 at 12:16

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
fixed in version 1.1.5

Original comment by [email protected] on 11 Jul 2013 at 12:04

from pypyodbc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.