Skip to content

Instantly share code, notes, and snippets.

@tipabu tipabu/py3-difficulties.md
Last active Feb 15, 2018

Embed
What would you like to do?

Known py3 difficulties:

@notmyname

This comment has been minimized.

Copy link

commented Oct 25, 2016

https://bugs.python.org/issue22233 just landed (2 weeks ago) on October 7

@notmyname

This comment has been minimized.

Copy link

commented May 3, 2017

py3 random implementation is different than in py2. This causes tests that rely on setting the random seed and having deterministic behavior aren't portable across py2 to py3. (see patch chain associated with https://review.openstack.org/#/c/401397/)

@notmyname

This comment has been minimized.

Copy link

commented May 3, 2017

bytes vs native strings in headers (related to latin-1/utf8 encoding issues) to ensure "b'some string'" doesn't get sent back in header values

@notmyname

This comment has been minimized.

Copy link

commented May 3, 2017

rings use pickle, which can have issues across py2 and py3 (https://bugs.launchpad.net/swift/+bug/1644387)

@notmyname

This comment has been minimized.

Copy link

commented May 3, 2017

all existing metadata is pickled, so the previous py2/py3 pickle issues must be resolved

@tipabu

This comment has been minimized.

Copy link
Owner Author

commented May 5, 2017

We currently require that delimiter queries be a single byte and decodable as UTF-8; as a result, we essentially limit ourselves to ASCII. Do we continue with this, or change the requirement to be a single codepoint?

@tipabu

This comment has been minimized.

Copy link
Owner Author

commented May 18, 2017

Bankers' rounding will probably result in some flaky tests:

======================================================================
FAIL: test_greater_with_offset (test.unit.common.test_utils.TestTimestamp)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/vagrant/swift/test/unit/common/test_utils.py", line 632, in test_greater_with_offset
    timestamp, value, value))
nose.proxy.AssertionError: False is not true : 1495139343.99161_0000000000000001 is not greater than '1495139343.991615' given '1495139343.991615'
    "False is not true : 1495139343.99161_0000000000000001 is not greater than '1495139343.991615' given '1495139343.991615'" = self._formatMessage("False is not true : 1495139343.99161_0000000000000001 is not greater than '1495139343.991615' given '1495139343.991615'", "%s is not true" % safe_repr(False))
>>  raise self.failureException("False is not true : 1495139343.99161_0000000000000001 is not greater than '1495139343.991615' given '1495139343.991615'")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.