Fix buck build error because of not encoded argument
On Arch Linux using Python 2.7.6 with a recent clone of buck,
I got the following error:
  Traceback (most recent call last):
    File "gerrit/tools/download_file.py", line 100, in <module>
      cache_ent = cache_entry(args)
    File "gerrit/tools/download_file.py", line 80, in cache_entry
      h = sha1(args.u).hexdigest()
  TypeError: Unicode-objects must be encoded before hashing
Change-Id: I7a638b56a14cf579ba57f2a5c17df62cf3fbf266
			
			
This commit is contained in:
		@@ -77,7 +77,7 @@ def cache_entry(args):
 | 
				
			|||||||
  if args.v:
 | 
					  if args.v:
 | 
				
			||||||
    h = args.v
 | 
					    h = args.v
 | 
				
			||||||
  else:
 | 
					  else:
 | 
				
			||||||
    h = sha1(args.u).hexdigest()
 | 
					    h = sha1(args.u.encode('utf-8')).hexdigest()
 | 
				
			||||||
  name = '%s-%s' % (path.basename(args.o), h)
 | 
					  name = '%s-%s' % (path.basename(args.o), h)
 | 
				
			||||||
  return path.join(CACHE_DIR, name)
 | 
					  return path.join(CACHE_DIR, name)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user