Re: urllib2 file upload error

2005-04-28 Thread Denis S. Otkidach
On Thu, 28 Apr 2005 15:45:50 +1200 Thomas wrote: T> d = [ ('cmd', 'add-item'), T> ('protocol_version', '2.1'), T> ('userfile', open(FILE)), T> ] T> req = urllib2.Request(URL, d) [...] T> TypeError: sendall() argument 1 must be string or read-only buffer, T> not list Exactly as err

urllib2 file upload error

2005-04-27 Thread Thomas
    import urllib2 URL = '' FILE= 'c:/Documents and Settings/Administrator/Desktop/Vousleve 1 .pps'; d = [ ('cmd', 'add-item'),   ('protocol_version', '2.1'),   ('userfile', open(FILE)),     ] req = urllib2.Request(URL, d) try:     u = urllib2.urlopen(req) except urllib2