Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Printing baked command fails on python 3.3 #176

Closed
migel opened this issue Jan 31, 2014 · 2 comments
Closed

Printing baked command fails on python 3.3 #176

migel opened this issue Jan 31, 2014 · 2 comments

Comments

@migel
Copy link

migel commented Jan 31, 2014

Fails on python 3.3 with sh 1.0.9 (works on python 2.7):

In [69]: ll = sh.ls.bake('-l')

In [70]: print(ll)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-70-1635481e3567> in <module>()
----> 1 print(ll)

/home/mk/.local/lib/python3.3/site-packages/sh.py in __str__(self)
    668     def __str__(self):
    669         if IS_PY3:
--> 670             return self.__unicode__()
    671         else:
    672             return unicode(self).encode(DEFAULT_ENCODING)

/home/mk/.local/lib/python3.3/site-packages/sh.py in __unicode__(self)
    683 
    684     def __unicode__(self):
--> 685         baked_args = " ".join(self._partial_baked_args)
    686         if baked_args:
    687             baked_args = " " + baked_args

TypeError: sequence item 0: expected str instance, bytes found
@amoffat
Copy link
Owner

amoffat commented Jan 31, 2014

thanks @migel, i will take a look this weekend

Ikke added a commit to Ikke/sh that referenced this issue May 19, 2014
Join expects the array items to be strings, not byte arrays. 

Addresses amoffat#176
@amoffat
Copy link
Owner

amoffat commented Dec 25, 2014

fixed in release-1.10 branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants