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 dmalcolm
Recipients benjamin.peterson, dmalcolm
Date 2010-06-22.19:06:09
SpamBayes Score 0.024708124
Marked as misclassified No
Message-id <1277233571.65.0.356221860324.issue9058@psf.upfronthosting.co.za>
In-reply-to
Content
>>> Actually, you should be able to just remove the asserts.

Aha, thanks! 

Yes: #define PY_SSIZE_T_CLEAN is defined at the top of Objects/exceptions.c, so yes, Py_VaBuildValue is redirected to _Py_VaBuildValue_SizeT, so that 
  PyEval_CallFunction
calls:
  Py_VaBuildValue(format, vargs)
which is preprocessed to:
  _Py_VaBuildValue_SizeT
which calls:
  return va_build_value(format, va, FLAG_SIZE_T);
which means that "s#" is processed with flags==FLAG_SIZE_T, and thus as "Py_ssize_t" within do_mkvalue:
				if (flags & FLAG_SIZE_T)
					n = va_arg(*p_va, Py_ssize_t);
				else
					n = va_arg(*p_va, int);

So, yes, it does look like the three assert lines can simply be removed.
History
Date User Action Args
2010-06-22 19:06:11dmalcolmsetrecipients: + dmalcolm, benjamin.peterson
2010-06-22 19:06:11dmalcolmsetmessageid: <1277233571.65.0.356221860324.issue9058@psf.upfronthosting.co.za>
2010-06-22 19:06:09dmalcolmlinkissue9058 messages
2010-06-22 19:06:09dmalcolmcreate