Hello,

I am trying to upload files via the Welcome appadmin in the Static files 
section, but the uploads are failing with "Cannot upload file <filename>"

I have now traced this in Pycharm and it is failing on the call to the 
count_lines method in the admin\controllers\default.py 

In the debugger I see the message "AttributeError: 'dict" object has no 
attribulte 'len'"

Admin\Controllers\default.py : 

Upload_file method calls count_lines method with the data from the file

 

data variable contains :

b"from pyspark.sql.functions import udf\r\nfrom pyspark.sql.types import 
IntegerType, StringType\r\n\r\n\r\n@udf(IntegerType())\r\ndef 
to_celsius(temp):\r\n    if isinstance(temp, int):\r\n "

 

def count_lines(data):

return len([line for line in data.split('\n') if line.strip() and not 
line.startswith('#')])

 

*Error Message :*

AttributeError: 'dict" object has no attribulte 'len'


Note: I have tried this with multiple text and binary files.  


I am working in a Winows environmet and using python 3.6

Web2py : Version2.18.5-stable+timestamp.2019.04.08.04.22.03


Did we set something up incorrectly, or is this a bug in web2py ?


Thanks in advance,

David



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/f8a37f8d-dfa0-4537-8bb2-9a96296a30c7%40googlegroups.com.

Reply via email to