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 louielu
Recipients alynn, louielu, mark.dickinson, meador.inge, serhiy.storchaka
Date 2017-02-25.15:49:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1488037748.6.0.342665248156.issue23578@psf.upfronthosting.co.za>
In-reply-to
Content
> 1. Using global variable doesn't look good to me.

That's true, but I'm not sure if there have other methods to do this.

If not using global variable, we will need to change a bunch of the
function arguments. Since the arguments didn't contain the
information about which item is in the process and raise the error.


> 2. "at offset 1" looks confusing to me. What is offset?

Make the change to: 
>>> struct.pack('hh', , 0x7FFFF, 0x8FFFF)
struct.error: 'h' format requires -32768 <= number <= 32767, got bad value at item 2

(or probably, "got bad value at index 2")

> 3. It is not safe to use the fixed length array for formatting error message. Once the underlying error message can be changed and will overflow the buffer.

Change to snprintf.

> The "%zd" format in sprintf() is not portable.

Change to "%ld"
History
Date User Action Args
2017-02-25 15:49:08louielusetrecipients: + louielu, mark.dickinson, meador.inge, serhiy.storchaka, alynn
2017-02-25 15:49:08louielusetmessageid: <1488037748.6.0.342665248156.issue23578@psf.upfronthosting.co.za>
2017-02-25 15:49:08louielulinkissue23578 messages
2017-02-25 15:49:08louielucreate