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.

classification
Title: test_gc failure on Windows x64
Type: behavior Stage: resolved
Components: Versions: Python 3.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: pitrou Nosy List: brian.curtin, georg.brandl, pitrou
Priority: normal Keywords: patch

Created on 2010-11-01 16:34 by brian.curtin, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
gcprint.patch pitrou, 2010-11-04 21:46
Messages (6)
msg120137 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2010-11-01 16:34
======================================================================
FAIL: test_garbage_at_shutdown (test.test_gc.GCTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\python-dev\py3k\lib\test\test_gc.py", line 500, in test_garbage_at_shutdown
    b"shutdown; use", stderr)
AssertionError: b'ResourceWarning: gc: 2 uncollectable objects at shutdown; use'
 not found in b'sys:1: ResourceWarning: gc: %Id uncollectable objects at shutdow
n; use gc.set_debug(gc.DEBUG_UNCOLLECTABLE) to list them'


%Id isn't being replaced with the number in the format string. I only briefly looked into it, not sure why it would be Windows x64 specific (this doesn't happen on Win 32-bit or any *nix buildbots).
msg120449 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-11-04 21:40
%Id is actually the expansion of PY_FORMAT_SIZE_T.

Include/pyport.h says:

/* PY_FORMAT_SIZE_T is a platform-specific modifier for use in a printf
 * format to convert an argument with the width of a size_t or Py_ssize_t.
 * C99 introduced "z" for this purpose, but not all platforms support that;
 * e.g., MS compilers use "I" instead.

Perhaps this is outdated or simply wrong?
msg120452 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-11-04 21:43
Well, the issue seems to be simpler. This piece of code calls PyErr_WarnFormat, which doesn't use the platform's printf but Python's own format codes as documented in http://docs.python.org/dev/c-api/unicode.html#PyUnicode_FromFormat
msg120453 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-11-04 21:46
Could you check the following patch works for you?
msg120458 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2010-11-04 23:01
Works for me.
msg120460 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-11-05 00:05
Committed in r86179.
History
Date User Action Args
2022-04-11 14:57:08adminsetgithub: 54488
2010-11-05 00:05:49pitrousetstatus: open -> closed
resolution: fixed
messages: + msg120460

stage: needs patch -> resolved
2010-11-04 23:01:05brian.curtinsetassignee: brian.curtin -> pitrou
messages: + msg120458
2010-11-04 21:46:23pitrousetfiles: + gcprint.patch
assignee: brian.curtin
messages: + msg120453

keywords: + patch
2010-11-04 21:43:10pitrousetnosy: + georg.brandl
messages: + msg120452
2010-11-04 21:40:16pitrousetnosy: + pitrou
messages: + msg120449
2010-11-01 16:34:04brian.curtincreate