[issue20654] Pydoc (and help) fails with socket.AddressFamily

2014-02-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Vajrasky! -- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed type: -> behavior ___ Python tracker ___

[issue20654] Pydoc (and help) fails with socket.AddressFamily

2014-02-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8a3e896f0681 by Serhiy Storchaka in branch 'default': Issue #20654: Fixed pydoc for enums with zero value. Patch by Vajrasky Kok. http://hg.python.org/cpython/rev/8a3e896f0681 -- nosy: +python-dev ___ Py

[issue20654] Pydoc (and help) fails with socket.AddressFamily

2014-02-17 Thread Vajrasky Kok
Vajrasky Kok added the comment: Thanks for the review, Serhiy! Here is the patch addressing Serhiy's concern. -- Added file: http://bugs.python.org/file34126/pydoc_display_enum_member_value_0_v3.patch ___ Python tracker

[issue20654] Pydoc (and help) fails with socket.AddressFamily

2014-02-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Interesting, that the documentation for AddressFamily (unlike to SocketType) isn't generated in html doc. May be this is unrelated issue, but if this is related, it would be good to fix it too. Otherwise it needs separate issue. -- _

[issue20654] Pydoc (and help) fails with socket.AddressFamily

2014-02-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The fix itself looks good, but the test can be better. You write temporary file in current directory. this can fail for different reasons, Python can crash and left undeleted file, this file can overwrite existing file. The render_doc() function is last modu

[issue20654] Pydoc (and help) fails with socket.AddressFamily

2014-02-17 Thread Vajrasky Kok
Vajrasky Kok added the comment: Here is the second patch, avoiding dependency to socket.AddressFamily (though it adds dependency to enum library) in test. -- Added file: http://bugs.python.org/file34120/pydoc_display_enum_member_value_0_v2.patch ___

[issue20654] Pydoc (and help) fails with socket.AddressFamily

2014-02-17 Thread Vajrasky Kok
Vajrasky Kok added the comment: Here is the second preliminary patch. I'll think about the way to avoid dependency to socket module. -- Added file: http://bugs.python.org/file34119/pydoc_display_enum_member_value_0.patch ___ Python tracker

[issue20654] Pydoc (and help) fails with socket.AddressFamily

2014-02-17 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka keywords: +easy stage: -> needs patch ___ Python tracker ___ ___ Pyth

[issue20654] Pydoc (and help) fails with socket.AddressFamily

2014-02-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Just use getattr() without third argument and catch AttributeError. -- ___ Python tracker ___ ___

[issue20654] Pydoc (and help) fails with socket.AddressFamily

2014-02-17 Thread Vajrasky Kok
Vajrasky Kok added the comment: I just realized that Enum member could be None. I'll think how to improve this patch. -- ___ Python tracker ___ _

[issue20654] Pydoc (and help) fails with socket.AddressFamily

2014-02-17 Thread Vajrasky Kok
Vajrasky Kok added the comment: This is the preliminary patch for this bug. The bug happens because AddressFamily.AF_UNSPEC is 0. Then you have this if condition: getattr(object, name, None) or homecls.__dict__[name] I'll contemplate whether we should add unit test for this or not. --

[issue20654] Pydoc (and help) fails with socket.AddressFamily

2014-02-16 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: $ ./python -m pydoc socket.AddressFamily Traceback (most recent call last): File "/home/serhiy/py/cpython/Lib/runpy.py", line 171, in _run_module_as_main "__main__", mod_spec) File "/home/serhiy/py/cpython/Lib/runpy.py", line 86, in _run_code exec