Skip to content

Instantly share code, notes, and snippets.

@pavellishin
Created May 29, 2012 02:55
Show Gist options
  • Save pavellishin/43b962a5e0d1f7cd8c89 to your computer and use it in GitHub Desktop.
Save pavellishin/43b962a5e0d1f7cd8c89 to your computer and use it in GitHub Desktop.
unicode
In [5]: import envoy
In [6]: banana = unicode('banana')
In [7]: envoy.run("wget http://www.photosight.ru/photos/4628565/ -O /tmp/%s.html" % banana)
Exception in thread Thread-3:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 530, in __bootstrap_inner
self.run()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 483, in run
self.__target(*self.__args, **self.__kwargs)
File "/Users/pavel/projects/pfwtf2/venv/lib/python2.7/site-packages/envoy/core.py", line 40, in target
bufsize=0,
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child
raise child_exception
TypeError: must be encoded string without NULL bytes, not str
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/Users/pavel/projects/pfwtf2/<ipython-input-7-780cb92ddb32> in <module>()
----> 1 envoy.run("wget http://www.photosight.ru/photos/4628565/ -O /tmp/%s.html" % banana)
/Users/pavel/projects/pfwtf2/venv/lib/python2.7/site-packages/envoy/core.pyc in run(command, data, timeout)
165
166 cmd = Command(c)
--> 167 out, err = cmd.run(data, timeout)
168
169 r = Response(process=cmd)
/Users/pavel/projects/pfwtf2/venv/lib/python2.7/site-packages/envoy/core.pyc in run(self, data, timeout)
50 self.process.terminate()
51 thread.join()
---> 52 self.returncode = self.process.returncode
53 return self.out, self.err
54
AttributeError: 'NoneType' object has no attribute 'returncode'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment