If you benefit from web2py hope you feel encouraged to pay it forward by contributing back to society in whatever form you choose!

I have created sample csv and imported it gives me error.

Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
Traceback (most recent call last):
  File "D:\web2py_src\gluon\restricted.py", line 220, in restricted
    exec ccode in environment
  File "D:/web2py_src/applications/sales/controllers/default.py", line 143, in <module>
  File "D:\web2py_src\gluon\globals.py", line 385, in <lambda>
    self._caller = lambda f: f()
  File "D:/web2py_src/applications/sales/controllers/default.py", line 19, in import_csv
    table.import_from_csv_file(file)
  File "D:\web2py_src\gluon\dal.py", line 9319, in import_from_csv_file
    for lineno, line in enumerate(reader):
Error: line contains NULL byte

 

Massimo can you please share how you using formatted .csv file.

 

 

Answers (1)

Comments (1)

  • Login to post



  • 0
    remco-boerma 6 years ago

    Most of the times this is a unicode issue. You can try if converting it solves your problem, and make sure the BOM header is intact. Use any capable text editor to set it right for you (notepad++ on windows will do)

    Hope this helps.  

Related content


Hosting graciously provided by:
Python Anywhere