[issue1185124] pydoc doesn't find all module doc strings

2019-07-29 Thread STINNER Victor


STINNER Victor  added the comment:

This issue is 14 years old, inactive for 5 years, has 3 patches: it's far from 
being "newcomer friendly", I remove the "Easy" label.

--
keywords:  -easy
versions: +Python 3.9 -Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1185124] pydoc doesn't find all module doc strings

2014-05-30 Thread Sunny K

Changes by Sunny K sunfin...@gmail.com:


Removed file: http://bugs.python.org/file31844/myfirst.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1185124
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1185124] pydoc doesn't find all module doc strings

2014-05-30 Thread Sunny K

Sunny K added the comment:

Hi Victor, can you give this another look?

--
versions: +Python 3.5 -Python 2.7, Python 3.2, Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1185124
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1185124] pydoc doesn't find all module doc strings

2014-01-13 Thread Akira Kitada

Akira Kitada added the comment:

I tried pydoc_2.7.patch with the following test file and
found source_synopsis returns \x escaped string instead of \u escaped one.


# -*- coding: utf-8 -*-

uツ

class Spam(object):
uツ


 import utf8
 utf8.__doc__
u'\u30c4'
 print(utf8.__doc__)
ツ
 import pydoc
 pydoc.source_synopsis(file('utf8.py'))
u'\xe3\x83\x84'
 print pydoc.source_synopsis(file('utf8.py'))
ツ
 print pydoc.source_synopsis(file('utf8.py')).encode('latin-1')
ツ

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1185124
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1185124] pydoc doesn't find all module doc strings

2013-09-26 Thread Sunny

Sunny added the comment:

Added patch for 2.7. Please review.

--
Added file: http://bugs.python.org/file31877/pydoc_2.7.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1185124
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1185124] pydoc doesn't find all module doc strings

2013-09-25 Thread Sunny

Sunny added the comment:

I've updated my patch with the review changes and tests.

tokenize.detect_encoding throws a TypeError if the file object passed to it is 
in text mode. However, i've realized catching this is not necessary as i now 
check for TextIOBase instead of just StringIO before.

--
Added file: http://bugs.python.org/file31864/myfirst_2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1185124
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1185124] pydoc doesn't find all module doc strings

2013-09-25 Thread Manuel Pégourié-Gonnard

Changes by Manuel Pégourié-Gonnard m...@elzevir.fr:


--
nosy:  -mpg

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1185124
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1185124] pydoc doesn't find all module doc strings

2013-09-25 Thread Akira Kitada

Akira Kitada added the comment:

Do you have any plan to work on patch for 2.7?
Apparently your patch is only for 3.x.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1185124
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1185124] pydoc doesn't find all module doc strings

2013-09-23 Thread STINNER Victor

STINNER Victor added the comment:

+except:
+pass
...
+except TypeError:
+return None

I don't understand these try/except. First, except: pass must never be used, 
only catch specific exceptions (ex: AttributeError). Can you explain why you 
expect a TypeError?

If your patch fixes a bug, you must add a new unit test to test_pydoc to check 
for non-regression.

--
nosy: +haypo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1185124
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1185124] pydoc doesn't find all module doc strings

2013-09-22 Thread Sunny

Sunny added the comment:

I've rewritten the source_synopsis function to use the tokenize module. 

It should now work with triple single quotes and hopefully all the other cases 
where __doc__ returns a string.

Since tokenize.tokenize needs a file object that is opened in binary mode, in 
the case of a StringIO object, i am reading the whole  object and converting it 
to a BytesIO object. I don't know if that is the right way. Also, the only 
instance i could find where source_synopsis is called with a StringIO object is 
in the ModuleScanner.run method. Maybe we could tweak this call to pass a 
byte-stream object to avoid the overhead of re-conversion?

All the current tests pass.

--
keywords: +patch
nosy: +sunfinite
Added file: http://bugs.python.org/file31844/myfirst.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1185124
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1185124] pydoc doesn't find all module doc strings

2013-09-21 Thread Akira Kitada

Changes by Akira Kitada akit...@gmail.com:


--
nosy: +akitada

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1185124
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1185124] pydoc doesn't find all module doc strings

2012-10-01 Thread Manuel Pégourié-Gonnard

Changes by Manuel Pégourié-Gonnard m...@elzevir.fr:


--
nosy: +mpg

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1185124
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1185124] pydoc doesn't find all module doc strings

2012-08-28 Thread Mike Hoy

Changes by Mike Hoy mho...@gmail.com:


--
nosy: +mikehoy

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1185124
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1185124] pydoc doesn't find all module doc strings

2012-08-28 Thread Nick Coghlan

Nick Coghlan added the comment:

The standard library has moved on quite a bit since this patch was written...

1. source_synopsis() should be using the tokeniser module when reading the 
docstring. The current implementation is broken in more ways than just those 
noted here (e.g. it completely ignores the declared encoding)

(The reason for not using full compilation is that you would then have to 
either *run* the compiled code or else compile to the AST and interrogate that, 
which is technically implementation dependent)

2. For 3.3+, synopsis should be using importlib to get the source code rather 
than assuming filesystem imports. That's probably better handled in a separate 
issue, though.

--
assignee: ping - 
nosy: +ncoghlan
versions: +Python 3.3 -Python 3.1

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1185124
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1185124] pydoc doesn't find all module doc strings

2012-08-28 Thread Nick Coghlan

Nick Coghlan added the comment:

Oops, I somehow ended up looking at an old revision of pydoc.py

The current version *is* using tokenize.open and importlib in synopsis(), so 
those aspects of my comments are incorrect.

However, the point that pydoc should probably be using the tokenize module to 
do the parsing inside source_synopsis remains valid. There's no good reason to 
continue duplicating a subset of that text processing logic within pydoc.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1185124
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1185124] pydoc doesn't find all module doc strings

2010-08-21 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
versions: +Python 2.7, Python 3.1, Python 3.2 -Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1185124
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1185124] pydoc doesn't find all module doc strings

2010-06-02 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
nosy: +merwok

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1185124
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1185124] pydoc doesn't find all module doc strings

2009-04-22 Thread Daniel Diniz

Changes by Daniel Diniz aja...@gmail.com:


--
keywords: +easy

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1185124
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com