[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: One more issue in tests on Windows with Python 3

From: Yasuhito FUTATSUKI <futatuki_at_poem.co.jp>
Date: Fri, 8 May 2020 20:55:14 +0900

On 2020/05/08 2:46, Daniel Shahaf wrote:
> Yasuhito FUTATSUKI wrote on Thu, 07 May 2020 20:46 +0900:
>> I think it is need to escape characters in char *value when we print
                               ^some (not all)
>> them as Python's str value. The patch below may work for this purpose,
>> but I want someone to write more nice code :)
>
> How about simply adding the human-readable value in a comment? —

It's very nice. One of the reason I don't like my code is just
readability of the value of "value". (It seems that this patch just
presents a concept but isn't a actual code, though).

> [[[

<snip>

> + printf("\\x%02x", (unsigned int)(unsigned char)*value++);

<snip>

> ]]]
>
> Also, I propose to change the cast as above, because I think the
> previous one wouldn't DTRT on platforms where 'char' is signed.

Ah, sure. My code was unsafe. Thank you.

I tweaked a condition to distinct py2 and py3, then make a patch.

Cheers,

-- 
Yasuhito FUTATSUKI <futatuki_at_poem.co.jp>/<futatuki_at_yf.bsdclub.org>

Received on 2020-05-08 13:55:57 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.