[issue7886] reverse on an empty list returns None

2010-02-08 Thread tormen

New submission from tormen :

# python 3.1.1:

myList = []
for item in myList:
print( item ) # <<< works

for item in myList.reverse(): # <<< breaks with: TypeError: 'NoneType' object 
is not iterable
print( item ) #

# But the reverse of an empty list should really be an empty list
# ... or do I miss something here?

--
messages: 99059
nosy: tormen
severity: normal
status: open
title: reverse on an empty list returns None
type: behavior
versions: Python 3.1

___
Python tracker 
<http://bugs.python.org/issue7886>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7886] reverse on an empty list returns None

2010-02-08 Thread tormen

tormen  added the comment:

Thanks for your nice feedback even though my bug report was so stupid!

--

___
Python tracker 
<http://bugs.python.org/issue7886>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8112] xmlrpc.server: ServerHTMLDoc.docroutine uses (since 3.0) depricated function "inspect.getargspec()"

2010-03-10 Thread tormen

New submission from tormen :

This throws an exception and crashes your DocXMLRPCServer when using registered 
python functions that use function annotations.

Seems inconsistent to me.
Or is there a reason for this?

--
messages: 100800
nosy: tormen
severity: normal
status: open
title: xmlrpc.server: ServerHTMLDoc.docroutine uses (since 3.0) depricated 
function "inspect.getargspec()"
type: crash
versions: Python 3.1

___
Python tracker 
<http://bugs.python.org/issue8112>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8112] xmlrpc.server: ServerHTMLDoc.docroutine uses (since 3.0) depricated function "inspect.getargspec()"

2010-03-10 Thread tormen

tormen  added the comment:

"This" refers to the summary of the bug.

--

___
Python tracker 
<http://bugs.python.org/issue8112>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8112] xmlrpc.server: ServerHTMLDoc.docroutine uses (since 3.0) deprecated function "inspect.getargspec()"

2010-03-10 Thread tormen

Changes by tormen :


--
title: xmlrpc.server: ServerHTMLDoc.docroutine uses (since 3.0) depricated 
function "inspect.getargspec()" -> xmlrpc.server: ServerHTMLDoc.docroutine uses 
(since 3.0) deprecated function "inspect.getargspec()"

___
Python tracker 
<http://bugs.python.org/issue8112>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8112] xmlrpc.server: ServerHTMLDoc.docroutine uses (since 3.0) deprecated function "inspect.getargspec()"

2010-03-11 Thread tormen

tormen  added the comment:

Okey ...

Consider you have a function:
def fn( str:str ): pass

That you register to your DocXMLRPCServer:
register_function of SimpleXMLRPCDispatcher stores the function object  in the 
dictionary self.funcs under the name of the function (as key).

Then you start your server and access (with a browser) the ip and port of the 
machine running your xmlrpc server which calls
> DocXMLRPCRequestHandler.do_GET which
> generate_html_documenation() which copies the funcs dictionary into methods 
> and hands it to
> ServerHTMLDoc.docserver which calls for each function name + function object:
> ServerHTMLDoc.docroutine which calls (for inspect.ismethod and 
> inspect.isfunction):

inspect.getargspec on the function object

which will fail if you register an annotated function (like the above "fn") in 
the first place:
=
  File "/usr/lib/python3.1/inspect.py", line 789, in getargspec
raise ValueError("Function has keyword-only arguments or annotations"
ValueError: Function has keyword-only arguments or annotations, use 
getfullargspec() API which can support them
=

Which most probably leads to the conclusion that you should just use the 
getfullargspec instead of getargspec just to avoid that the XMLRPC server 
crashes if someone registers a annotated function.

--

___
Python tracker 
<http://bugs.python.org/issue8112>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8112] xmlrpc.server: ServerHTMLDoc.docroutine uses (since 3.0) deprecated function "inspect.getargspec()"

2010-03-11 Thread tormen

tormen  added the comment:

If you want an example:

pydoc3.1 xmlrpc.server

2nd usage pattern

change "SimpleXMLRPCServer" to "DocXMLRPCServer"
change function signature from "pow(self, x, y)" to "pow(self, x:int, y:int)"

and your good to go and have your doc xmlrpc server crashed the moment you send 
a get request to him (e.g. by accessing "http://ip:port"; in the browser of your 
choice).

--

___
Python tracker 
<http://bugs.python.org/issue8112>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8112] xmlrpc.server: ServerHTMLDoc.docroutine uses (since 3.0) deprecated function "inspect.getargspec()"

2010-03-11 Thread tormen

tormen  added the comment:

If you want I can send you a patch.

--

___
Python tracker 
<http://bugs.python.org/issue8112>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5099] subprocess.POpen.__del__() AttributeError (os module == None!)

2010-03-12 Thread tormen

tormen  added the comment:

I ran into the same problem today :(
The patch resolved it :)

BUT:
Could anyone comment on when this patch will or will not live?!

...
As the bug is fairly old and already has duplicates and everyone seems to agree 
on the issue.
...
Plus it seems easy enough to edit the patch to include the try: / finally: and 
to incorporate the remove_stderr_debug_decorations() suggestion.

--
nosy: +tormen

___
Python tracker 
<http://bugs.python.org/issue5099>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com