~pwlars/lava-test/ltp

« back to all changes in this revision

Viewing changes to abrek/utils.py

  • Committer: Paul Larson
  • Date: 2010-09-15 03:38:49 UTC
  • Revision ID: paul.larson@canonical.com-20100915033849-rxlrqbm42qv399cz
Fix downloading if url contains a space

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
        filename = os.path.join(path,filename)
28
28
    fd = open(filename, "w")
29
29
    try:
30
 
        response = urllib2.urlopen(url)
 
30
        response = urllib2.urlopen(urllib2.quote(url, safe=":/"))
31
31
        fd = open(filename, 'wb')
32
32
        shutil.copyfileobj(response,fd,0x10000)
33
33
        fd.close()