git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luke Diamand <luke@diamand.org>
To: Junio C Hamano <gitster@pobox.com>,
	Dennis Kaarsemaker <dennis@kaarsemaker.net>
Cc: Lars Schneider <larsxschneider@gmail.com>,
	Etienne Girard <etienne.g.girard@gmail.com>,
	Git Users <git@vger.kernel.org>
Subject: Re: [PATCH] git-p4: import the ctypes module
Date: Wed, 21 Oct 2015 00:00:44 +0100	[thread overview]
Message-ID: <5626C79C.8060503@diamand.org> (raw)
In-Reply-To: <xmqqwpuh72ot.fsf@gitster.mtv.corp.google.com>

On 20/10/15 20:36, Junio C Hamano wrote:
> Dennis Kaarsemaker <dennis@kaarsemaker.net> writes:
>
>>> I do not follow Python development, but does the above mean that
>>> with recent 2.x you can say ctypes without first saying "import
>>> ctypes"?  It feels somewhat non-pythonesque that identifiers like
>>> this is given to you without you asking with an explicit 'import',
>>> so I am puzzled.
>>
>> No, you cannot do that. The reason others may not have noticed this bug is that
>> in git-p4.py, ctypes is only used on windows.
>>
>>   111     if platform.system() == 'Windows':
>>   112         free_bytes = ctypes.c_ulonglong(0)
>>   113         ctypes.windll.kernel32.GetDiskFreeSpaceExW(ctypes.c_wchar_p(os.getcwd()), None, None, ctypes.pointer(free_bytes))
>>
>> The fact that it works for the OP with 2.7.10 is puzzling (assuming that it's
>> on the same system).
>
> Exactly.  That is where my "I am puzzled" comes from.
>
> The patch looks obviously the right thing to do.  Luke?  Lars?

It looks sensible to me, and works fine on Linux, thanks. ack.

I can't test on Windows today but I can't see why it wouldn't work.

Luke

  reply	other threads:[~2015-10-20 23:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-20 10:34 Git-p4 fails with NameError with python 2.7.2 Etienne Girard
2015-10-20 13:57 ` Luke Diamand
2015-10-20 16:00   ` Junio C Hamano
2015-10-20 16:42     ` Manlio Perillo
2015-10-20 19:31     ` [PATCH] git-p4: import the ctypes module Dennis Kaarsemaker
2015-10-20 19:36       ` Junio C Hamano
2015-10-20 23:00         ` Luke Diamand [this message]
2015-10-21  8:23           ` Etienne Girard
2015-10-21  9:54             ` Etienne Girard
2015-10-21 20:00             ` Lars Schneider

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5626C79C.8060503@diamand.org \
    --to=luke@diamand.org \
    --cc=dennis@kaarsemaker.net \
    --cc=etienne.g.girard@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=larsxschneider@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).