On 08/14/2015 06:57 AM, Abhijeet Kasurde wrote:
If you receive EOF you cannot continue in while cycle because, it will
return EOF every iteration forever.
On 08/13/2015 07:08 PM, Martin Basti wrote:
On 08/10/2015 01:47 PM, Abhijeet Kasurde wrote:
This patch fixes bug - https://fedorahosted.org/freeipa/ticket/3406
thank you for the patch
- except ValueError:
+ except EOFError, ValueError:
except (EOFError, ValueError):
OK, I will include this.
Could you please elaborate more on, so that I can include fix in this
section of code?
I'm not sure if this code will work (I did not test it)
I expect when stdin is closed, this will result into infinite loop,
because raw_input will always return EOFError.
ret = raw_input("%s: " % prompt)
if allow_empty or ret.strip():
If EOF is received the while cycle must end, and appropriate action must
It depends on situation, if default value is present then default value
should be used, or in case if empty value is allowed, empty string
should be returned.
In case there is no default value and empty value is not allowed, then
an exception should be raised.
Manage your subscription for the Freeipa-devel mailing list:
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code