This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Matt.Bachmann
Recipients Matt.Bachmann, serhiy.storchaka
Date 2014-05-25.14:55:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1401029753.15.0.918514439927.issue21343@psf.upfronthosting.co.za>
In-reply-to
Content
There is a difference! '.' is a bytes string and u'.' is a unicode one! 

I found this problem because I work on a project that supports both python2 and python3.

In python3 I pass in unicode I get back unicode. In python2.7 I pass in unicode and I get back a bytes string. We need to ensure that all data in the system is unicode. 

Under 2.7 I get unicode sometimes and bytes other times so I need to do this ugly check 

    root_rel_path = os.path.relpath(self._cwd, self._root)
    if isinstance(root_rel_path, six.binary_type):
        root_rel_path = root_rel_path.decode()

in order to ensure that my string is once again of the correct type.
History
Date User Action Args
2014-05-25 14:55:53Matt.Bachmannsetrecipients: + Matt.Bachmann, serhiy.storchaka
2014-05-25 14:55:53Matt.Bachmannsetmessageid: <1401029753.15.0.918514439927.issue21343@psf.upfronthosting.co.za>
2014-05-25 14:55:53Matt.Bachmannlinkissue21343 messages
2014-05-25 14:55:52Matt.Bachmanncreate