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
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
___
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
___
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
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
___
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.
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
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
___
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?
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
Changes by Akira Kitada akit...@gmail.com:
--
nosy: +akitada
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1185124
___
___
Python-bugs-list
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
Changes by Mike Hoy mho...@gmail.com:
--
nosy: +mikehoy
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1185124
___
___
Python-bugs-list mailing
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
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
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
___
Changes by Éric Araujo mer...@netwok.org:
--
nosy: +merwok
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1185124
___
___
Python-bugs-list mailing
Changes by Daniel Diniz aja...@gmail.com:
--
keywords: +easy
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1185124
___
___
Python-bugs-list
18 matches
Mail list logo