Skip to content

Instantly share code, notes, and snippets.

@pganssle
Last active September 4, 2018 15:23
Show Gist options
  • Save pganssle/45b5d6affc4acd52bf9f36ef7ad27f65 to your computer and use it in GitHub Desktop.
Save pganssle/45b5d6affc4acd52bf9f36ef7ad27f65 to your computer and use it in GitHub Desktop.

Instructions

These are steps for attempting to reproduce this test failure.

Get the repository

If you don't have CPython cloned locally

If you don't already have a local CPython clone, go to wherever you clone repositories and execute:

git clone git@github.com:python/cpython.git
cd cpython

Then proceed to the next step

From the CPython directory

Once cloned, you need to add my fork as a remote and fetch my branches

git remote add pganssle git@github.com:pganssle/cpython.git
git fetch pganssle

Check out the commit that will fail

git checkout failing_fix_surrogate_strftime

If this doesn't work, you can check it out by commit id:

git checkout b643da871a

Build CPython

Assuming you have the build dependencies installed, you can do this to build CPython:

./configure
make

For more details on building CPython, see the Python dev guide.

Execute the tests

To save yourself some time, just execute the test_datetime tests:

./python -m test test_datetime

Though if you want to run the full test suite, you can with:

./python -m test
@ncoghlan
Copy link

ncoghlan commented Sep 4, 2018

While it doesn't help directly with reproducing the failure, note that the erroneous output reported in the tests reflects a case of encoding with surrogatepass, then decoding with surrogateescape:

>>> '\ud800'.encode(errors='surrogatepass').decode(errors='surrogateescape')
'\udced\udca0\udc80'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment