[Checkins] [zopefoundation/BTrees] 189d77: Add a failing test

Marius Gedminas noreply at github.com
Mon Jul 29 15:10:32 CEST 2019


  Branch: refs/heads/segfault-on-unicode
  Home:   https://github.com/zopefoundation/BTrees
  Commit: 189d7728806e16e607838c752e9b0a9389e03afd
      https://github.com/zopefoundation/BTrees/commit/189d7728806e16e607838c752e9b0a9389e03afd
  Author: Marius Gedminas <marius at gedmin.as>
  Date:   2019-07-29 (Mon, 29 Jul 2019)

  Changed paths:
    M BTrees/tests/testBTreesUnicode.py
    M tox.ini

  Log Message:
  -----------
  Add a failing test

The test fails on Python 3 only, and on non-pure builds only.  I added
PYTHONFAULTHANDLER=1 to the environment to make the failure less
mysteriously silent.

I've also updated tox.ini to use extras=foo instead of deps=.[foo] and
to use factors to set PURE_PYTHON=1 instead of defining an entire
environment.  This now lets you run arbitrary pure Python builds like
tox -e py37-pure.


  Commit: e2243331cb8e584e655b9a6472c0e8f9c75ad8b0
      https://github.com/zopefoundation/BTrees/commit/e2243331cb8e584e655b9a6472c0e8f9c75ad8b0
  Author: Marius Gedminas <marius at gedmin.as>
  Date:   2019-07-29 (Mon, 29 Jul 2019)

  Changed paths:
    M BTrees/BucketTemplate.c

  Log Message:
  -----------
  Fix segfault in bucket_repr() on Python 3

Fixes #106.

The bug was in not checking the return value of
PyUnicode_AsLatin1String() and passing a NULL to PyOS_snprintf().

The fix is to use PyUnicode_FromFormat() and avoid all the hassle of
manual encoding/sprintf/decoding and even calling repr().


Compare: https://github.com/zopefoundation/BTrees/compare/189d7728806e%5E...e2243331cb8e


More information about the checkins mailing list