1) You open with 'wb' and you read with 'r' instead of 'rb'.
I do not think this is the problem but it may be

2) I think the problem may be that you had corrupted data in the db in
the first place (like you stored something in a text files, then
changed type to string and the large data is still there. You can dump
it but not reimport it. Try open the dumped file with excel.

Massimo

On Oct 22, 9:16 pm, Thadeus Burgess <[email protected]> wrote:
> >>> db.export_to_csv_file(open('/home/thadeusb/Desktop/data.csv', 'wb'))
>
> #then later
>
> >>> db.import_from_csv_file(open('/home/thadeusb/Desktop/data.csv', 'r'))
>
> Traceback (most recent call last):
>
>   File "/home/thadeusb/Applications/web2py-devel/gluon/restricted.py",
> line 184, in restricted
>
>     exec ccode in environment
>   File 
> "/home/thadeusb/Applications/web2py-devel/applications/bootygrab/controllers/default.py"
> <http://127.0.0.1:8000/admin/default/edit/bootygrab/controllers/defaul...>,
> line 617, in <module>
>
>   File "/home/thadeusb/Applications/web2py-devel/gluon/globals.py",
> line 102, in <lambda>
>
>     self._caller = lambda f: f()
>
>   File 
> "/home/thadeusb/Applications/web2py-devel/applications/bootygrab/controllers/default.py"
> <http://127.0.0.1:8000/admin/default/edit/bootygrab/controllers/defaul...>,
> line 566, in dbio
>
>     db.import_from_csv_file(open('/home/thadeusb/Desktop/bootygrab.csv', 'r'))
>
>   File "/home/thadeusb/Applications/web2py-devel/gluon/sql.py", line
> 1193, in import_from_csv_file
>
>     self[tablename].import_from_csv_file(ifile, id_map, null, unique)
>
>   File "/home/thadeusb/Applications/web2py-devel/gluon/sql.py", line
> 1705, in import_from_csv_file
>
>     for line in reader:
> Error: field larger than field limit (131072)
>
> -Thadeus
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---


Reply via email to