Skip to content

Conversation

@bellini666
Copy link

No description provided.

@wkoot
Copy link
Owner

wkoot commented Sep 27, 2017

Build failing for Python 2.x

@bellini666
Copy link
Author

@wkoot the fail doesn't seem to be related to my change. Also, without this change, python3 isn't working at all.

@wkoot
Copy link
Owner

wkoot commented Sep 28, 2017

It is related to your change; default behaviour for str(class) calls class.__repr__, but six.u(class) would call class.replace which is not there. See the following:

>>> class Blub(object):
...  a = 123
...  def __repr__(self):
...    return str(self.a)
...
>>>
>>> str(Blub())
'123'
>>>
>>> import six
>>> six.u(Blub())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/six.py", line 647, in u
    return unicode(s.replace(r'\\', r'\\\\'), "unicode_escape")
AttributeError: 'Blub' object has no attribute 'replace'

@wkoot
Copy link
Owner

wkoot commented Sep 29, 2017

This was cherry-picked from facebookarchive@2d5768b by the way.
Interesting that it's failing for you, a test case to show the error in travis would be really welcome.
I'm planning on packaging version 1.3.4 with some other fixes, this could be added if on time.

@wkoot
Copy link
Owner

wkoot commented Sep 29, 2017

Implemented in #16

@wkoot wkoot closed this Sep 29, 2017
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

Successfully merging this pull request may close these issues.

2 participants