djhenderson / pypyodbc

Automatically exported from code.google.com/p/pypyodbc
0 stars 0 forks source link

ValueError raised #41

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The attached file should reproduce the error. Im using Python 2.7.6 on windows 
7 64 bit and pypyodbc 1.3.1.

To see the error:
1. Adjust paths in python file
2. Run the python file

For me this produces the following error:

"C:\Users\reknowles\Desktop\pypyodbc access bug.py in <module>()
     11 c = conn.cursor()
     12 
---> 13 a = c.execute('select Field1 from table1').fetchone()

C:\Users\reknowles\AppData\Local\Continuum\Anaconda\lib\site-packages\pypyodbc.p
y in fetchone(self)
   1867                                     value_list.append(buf_cvt_func(from_buffer_u(alloc_buffer)))
   1868                                 else:
-> 1869                                     
value_list.append(buf_cvt_func(alloc_buffer.value))
   1870                             else:
   1871                                 # There are previous fetched raw data to combine

ValueError: could not convert string to float: E-2"

The value it's trying to read from the access database is -2.90667617099896E-02 
so I suspect somewhere along the line something is struggling with the 'E-2' 
bit.

Possibly related to the following issue?: 
https://code.google.com/p/pypyodbc/issues/detail?id=28&colspec=ID%20Type%20Prior
ity%20Milestone%20Status%20Owner%20Summary

Original issue reported on code.google.com by remknow...@gmail.com on 24 Apr 2014 at 2:40

Attachments:

GoogleCodeExporter commented 9 years ago
Same issue here (on a different db) with python 3.4 x64 and Win7 x64
The db i'm trying to read is a 2003 access file (.mdb)
I tried to make a .accdb file and link the .mdb data to it, it seemed to solve 
the issue but it came back to day for no obvious reason
The value that fails is 4E-2 and I get the same "ValueError: could not convert 
string to float: E-2"

Original comment by greg.pif...@gmail.com on 25 Apr 2014 at 9:47

GoogleCodeExporter commented 9 years ago
Same issue here. For me it works on Windows 7 x64 but not on Windows Server 
2008. The number that seems to be causing the problem for me is 
4.03132392887798E170. I'm guessing it does not like the E170 part.

Original comment by ba.hende...@gmail.com on 6 Jan 2015 at 1:21