[Freeipa-devel] [PATCH] 0256 Fix installutils.get_password without a TTY

Petr Viktorin pviktori at redhat.com
Tue Jul 30 16:01:19 UTC 2013


On 07/30/2013 05:23 PM, Ana Krivokapic wrote:> On 07/30/2013 01:15 PM, > 
There's a typo in the commit message: "ises" instead of "uses".

Fixed.


On 07/30/2013 05:43 PM, Nathaniel McCallum wrote:
> On Tue, 2013-07-30 at 17:36 +0200, Petr Viktorin wrote:
>> On 07/30/2013 05:20 PM, Nathaniel McCallum wrote:
>>> On Tue, 2013-07-30 at 13:15 +0200, Petr Viktorin wrote:
>>>> See the commit message or ticket.
>>>>
>>>> This is a nuisance when writing tests for interactive prompting.
>>>>
>>>> https://fedorahosted.org/freeipa/ticket/3824
>>>
>>> There appears to be a stray comma.
>>
>> The comma at the end of a print statement suppresses the trailing newline.
>
> Wouldn't sys.stdout.write() be clearer?

I don't have a preference. Changed.

> The comma approach also doesn't work in py3k.

Well, the print statement itself doesn't work in py3k :)

The 2to3 tool handles the trailing comma without problems (and we'll 
probably use the print fixer when porting).

$ 2to3 --fix print /tmp/printtest.py
RefactoringTool: Refactored /tmp/printtest.py
--- /tmp/printtest.py   (original)
+++ /tmp/printtest.py   (refactored)
@@ -1 +1 @@
-print 'foo',
+print('foo', end=' ')
RefactoringTool: Files that need to be modified:
RefactoringTool: /tmp/printtest.py

-- 
Petr³
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0256.2-Fix-installutils.get_password-without-a-TTY.patch
Type: text/x-patch
Size: 1358 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20130730/25c6b691/attachment.bin>


More information about the Freeipa-devel mailing list