[issue12621] Errors in docstrings of find and rfind methods of bytes and bytestring

2011-07-24 Thread Petri Lehtinen

Petri Lehtinen pe...@digip.org added the comment:

Attached outputs of the following commands in the corresponding head revisions 
(from yesterday, as hg.python.org seems to be down today):

3.3:

for x in {bytes,bytearray}.{find,rfind} str.{find,rfind}; do echo === $x ===; 
./python -c help($x) | cat; echo; done  3.3.txt

3.2:

for x in {bytes,bytearray}.{find,rfind} str.{find,rfind}; do echo === $x ===; 
./python -c help($x) | cat; echo; done  3.2.txt

2.7:

for x in bytearray.{find,rfind} unicode.{find,rfind}; do echo === $x ===; 
./python -c help($x) | cat; echo; done  2.7.txt


In all files, I see s[start:end] or s[start,end] where there should read 
B[start:end] or S[start:end].

--
stage:  - needs patch
Added file: http://bugs.python.org/file22740/3.3.txt

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



[issue12621] Errors in docstrings of find and rfind methods of bytes and bytestring

2011-07-24 Thread Petri Lehtinen

Changes by Petri Lehtinen pe...@digip.org:


Added file: http://bugs.python.org/file22741/3.2.txt

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



[issue12621] Errors in docstrings of find and rfind methods of bytes and bytestring

2011-07-24 Thread Petri Lehtinen

Changes by Petri Lehtinen pe...@digip.org:


Added file: http://bugs.python.org/file22742/2.7.txt

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



Re: [issue12621] Errors in docstrings of find and rfind methods of bytes and bytestring

2011-07-24 Thread Senthil Kumaran
Okay, got it. Thanks. I was a subtle one within the description. I
missed it in the first place.
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12625] sporadic test_unittest failure

2011-07-24 Thread Charles-François Natali

Charles-François Natali neolo...@free.fr added the comment:

 No, it's a feature of the new GIL.

When I look at 2.7's code, I see something different - _Py_Ticker is
reset in Py_AddPendingCall():

int
Py_AddPendingCall(int (*func)(void *), void *arg)
{
[...]
/* signal main loop */
_Py_Ticker = 0;
pendingcalls_to_do = 1;
[...]
}

And there's a comment in the main eval loop which confirms this:
/* Do periodic things.  Doing this every time through
   the loop would add too much overhead, so we do it
   only every Nth instruction.  We also do it if
   ``pendingcalls_to_do'' is set, i.e. when an asynchronous
   event needs attention (e.g. a signal handler or
   async I/O handler); see Py_AddPendingCall() and
   Py_MakePendingCalls() above. */

So, AFAICT, signal handlers will get called right away (and if I
remove the _Py_Ticker reset from Py_AddPendingCall(), then those tests
fail consistently on Linux).
Or am I missing something?

Concerning the original problem, here's a patch implementing the second idea:
- getpid() is called after each kill(getpid(), signum), to force
the signal delivery
- the test is now re-enabled on FreeBSD6

I think this should fx the problem on both FreeBSD6 and OpenSolaris,
but since I don't have a FreeBSD or OpenSolaris box at hand, I
couldn't test it. Shall I try to commit it and see what the buildbots
say?

--
Added file: http://bugs.python.org/file22743/kill_delayed_signal.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12625
___diff -r cda93720c06d Lib/unittest/test/test_break.py
--- a/Lib/unittest/test/test_break.py   Sat Jul 23 18:15:43 2011 +0200
+++ b/Lib/unittest/test/test_break.py   Sun Jul 24 14:23:32 2011 +0200
@@ -10,8 +10,6 @@
 
 @unittest.skipUnless(hasattr(os, 'kill'), Test requires os.kill)
 @unittest.skipIf(sys.platform ==win32, Test cannot run on Windows)
-@unittest.skipIf(sys.platform == 'freebsd6', Test kills regrtest on freebsd6 
-if threads have been used)
 class TestBreak(unittest.TestCase):
 
 def setUp(self):
@@ -29,8 +27,15 @@
 self.assertNotEqual(signal.getsignal(signal.SIGINT), default_handler)
 
 try:
+# When a process sends a signal to itself, POSIX states that the
+# signal must be delivered before the kill() syscall returns. Some
+# operating systems are known to delay signal delivery in this
+# situation (see issues #12625, #8263 and #12469): to force the
+# signal's delivery, we make a dummy getpid() syscall (signals are
+# typically delivered when the process returns to user-space).
 pid = os.getpid()
 os.kill(pid, signal.SIGINT)
+os.getpid()
 except KeyboardInterrupt:
 self.fail(KeyboardInterrupt not handled)
 
@@ -61,6 +66,7 @@
 def test(result):
 pid = os.getpid()
 os.kill(pid, signal.SIGINT)
+os.getpid()
 result.breakCaught = True
 self.assertTrue(result.shouldStop)
 
@@ -79,9 +85,11 @@
 def test(result):
 pid = os.getpid()
 os.kill(pid, signal.SIGINT)
+os.getpid()
 result.breakCaught = True
 self.assertTrue(result.shouldStop)
 os.kill(pid, signal.SIGINT)
+os.getpid()
 self.fail(Second KeyboardInterrupt not raised)
 
 try:
@@ -109,6 +117,7 @@
 def test(result):
 pid = os.getpid()
 os.kill(pid, signal.SIGINT)
+os.getpid()
 
 try:
 test(result)
@@ -134,6 +143,7 @@
 try:
 pid = os.getpid()
 os.kill(pid, signal.SIGINT)
+os.getpid()
 except KeyboardInterrupt:
 pass
 else:
@@ -173,6 +183,7 @@
 try:
 pid = os.getpid()
 os.kill(pid, signal.SIGINT)
+os.getpid()
 except KeyboardInterrupt:
 pass
 
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12560] libpython.so not built on OpenBSD

2011-07-24 Thread Charles-François Natali

Charles-François Natali neolo...@free.fr added the comment:

The patch looks good to me.
As for the other failures, it would probably be interesting to open a
separate issue, no?

--

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



[issue12626] run test cases based on a glob filter

2011-07-24 Thread Michael Foord

Michael Foord mich...@voidspace.org.uk added the comment:

I love the functionality. Running individual tests (or groups of tests) with 
unittest is a *pain*. I had hoped to solve this through unittest extensions, 
but this is taking me longer to get to than I had hoped.

So I would like to add this to unittest, but obviously that can't happen for 
3.2.

--

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



[issue12627] Implement PEP 394: The python Command on Unix-Like Systems

2011-07-24 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Some scripts are installed by setup.py

I’ll find time to read the latest version of the PEP in the coming days.

--
nosy: +eric.araujo

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



[issue12394] packaging: generate scripts from callable (dotted paths)

2011-07-24 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

You haven’t set the git option for the diff commands in your config file.

--

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



[issue12394] packaging: generate scripts from callable (dotted paths)

2011-07-24 Thread higery

higery shoulderhig...@gmail.com added the comment:

remote repository? It's just a configuration file under the .hg directory...

--
Added file: http://bugs.python.org/file22744/unnamed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12394
___div class=gmail_quoteblockquote class=gmail_quote style=margin: 0pt 0pt 
0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;div 
class=im

/divYou haven’t set the git option for the diff commands in your config 
file.brbr/blockquotedivI have already set the option as you said 
earlier, but how to #39;push#39; it to remote repository? It#39;s just a 
configuration file under the .hg directory...br
brbr br/div/div
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12627] Implement PEP 394: The python Command on Unix-Like Systems

2011-07-24 Thread Petri Lehtinen

Changes by Petri Lehtinen pe...@digip.org:


--
nosy: +petri.lehtinen

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



[issue11784] multiprocessing.Process.join: timeout argument doesn't specify time unit.

2011-07-24 Thread Petri Lehtinen

Changes by Petri Lehtinen pe...@digip.org:


--
stage:  - patch review

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



[issue12294] multiprocessing.Pool: Need a way to find out if work are finished.

2011-07-24 Thread Petri Lehtinen

Changes by Petri Lehtinen pe...@digip.org:


--
stage:  - test needed

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



[issue12063] tokenize module appears to treat unterminated single and double-quoted strings inconsistently

2011-07-24 Thread Petri Lehtinen

Changes by Petri Lehtinen pe...@digip.org:


--
keywords: +easy

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



[issue12174] Multiprocessing logging levels unclear

2011-07-24 Thread Petri Lehtinen

Changes by Petri Lehtinen pe...@digip.org:


--
keywords: +needs review
stage:  - patch review
versions: +Python 3.2

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



[issue11934] build with --prefix=/dev/null and zlib enabled in Modules/Setup failed

2011-07-24 Thread Petri Lehtinen

Petri Lehtinen pe...@digip.org added the comment:

ysj.ray:

As you're on Debian, the real cause of this might be issue 11715. The 
Modules/Setup.dist line for zlib is commented out, so it's only an example of 
how to enable zlib if it's not found automatically.

Can you try again now that issue 11715 has been fixed?

--
status: open - pending

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



[issue11708] argparse: suggestion for formatting optional positional args

2011-07-24 Thread Petri Lehtinen

Petri Lehtinen pe...@digip.org added the comment:

I think this is a good idea, and seems to me more like a bug than a feature 
request.

--
stage:  - needs patch
type: feature request - 
versions: +Python 3.2, Python 3.3

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



[issue11694] xdrlib raises ConversionError in inconsistent way

2011-07-24 Thread Petri Lehtinen

Changes by Petri Lehtinen pe...@digip.org:


--
stage:  - test needed
versions: +Python 2.7, Python 3.2

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



[issue11869] Include information about the bug tracker Rietveld code review tool

2011-07-24 Thread Petri Lehtinen

Changes by Petri Lehtinen pe...@digip.org:


--
stage:  - needs patch

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



[issue12629] HTMLParser silently stops parsing with malformed attributes

2011-07-24 Thread Kevin Stock

New submission from Kevin Stock teo...@gmail.com:

Given the input 'xy z=o //x', HTMLParser only detects the opening x 
tag, and then stops parsing. Ideally this should behave like the case 'xy 
z= //x' which raises an error and then can continue parsing the close x 
tag.

--
components: Library (Lib)
files: test.py
messages: 141051
nosy: teoryn
priority: normal
severity: normal
status: open
title: HTMLParser silently stops parsing with malformed attributes
type: behavior
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file22745/test.py

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



[issue10731] UnicodeDecodeError in OS X tkinter when binding to MouseWheel

2011-07-24 Thread Marc Culler

Marc Culler cul...@math.uic.edu added the comment:

I am running OSX 10.5.8 on this macbook.  The Tcl/Tk package on the system is 
ActiveState Tcl/Tk 8.4.19.

I just installed Python 3.2 (r32:88452, Feb 20 2011, 10:19:59) from 
http://www.python.org/getit/releases/3.2/ and I am still seeing this bug.  It 
does not occur with the Python 2.7 Tkinter package, which uses the same Tcl/Tk 
framework.  So if it is a bug in Tk, it is harmless when used with Python 2.7.  
But, after all, it is not so surprising to see new UnicodeDecodeErrors when 
porting from Python 2 to Python 3.

--
versions: +Python 3.2 -Python 3.1

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



[issue12448] smtplib's __main__ doesn't flush when prompting

2011-07-24 Thread Petri Lehtinen

Changes by Petri Lehtinen pe...@digip.org:


--
stage:  - patch review

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



[issue12560] libpython.so not built on OpenBSD

2011-07-24 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 33be4896003a by Charles-François Natali in branch '2.7':
Issue #12560: Build libpython.so on OpenBSD. Patch by Stefan Sperling.
http://hg.python.org/cpython/rev/33be4896003a

--
nosy: +python-dev

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



[issue12560] libpython.so not built on OpenBSD

2011-07-24 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 1fdad36ac838 by Charles-François Natali in branch '3.2':
Issue #12560: Build libpython.so on OpenBSD. Patch by Stefan Sperling.
http://hg.python.org/cpython/rev/1fdad36ac838

--

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



[issue12560] libpython.so not built on OpenBSD

2011-07-24 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset a095cbed24c3 by Charles-François Natali in branch 'default':
Issue #12560: Build libpython.so on OpenBSD. Patch by Stefan Sperling.
http://hg.python.org/cpython/rev/a095cbed24c3

--

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



[issue12560] libpython.so not built on OpenBSD

2011-07-24 Thread Charles-François Natali

Charles-François Natali neolo...@free.fr added the comment:

Patch committed.
Stefan, thanks for the report and the patch!

--
resolution:  - fixed
stage: commit review - committed/rejected
status: open - closed

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



[issue12498] asyncore.dispatcher_with_send, disconnection problem + miss-conception

2011-07-24 Thread Charles-François Natali

Charles-François Natali neolo...@free.fr added the comment:

Hello,

 Actually the class asyncore.dispatcher_with_send do not handle properly
 disconnection. When the endpoint shutdown his sending part of the socket,
 but keep the socket open in reading, the current implementation of
 dispatcher_with_send will close the socket without sending pending data.

Yes, that's a common problem with naive networking code.

 Note also that this class try to initiate a send even if the socket is maybe
 not ready for writing:

 Here's a simple fix:
 def send(self, data):
 if self.debug:
 self.log_info('sending %s' % repr(data))
 self.out_buffer = self.out_buffer + data
 -   self.initiate_send()


Hum, I'm not sure about this.
dispatcher is just a thin wrapper around the underlying socket, so the
semantic of `send` should be the same as `socket.send`, i.e. just call
the send(2) syscall. I think it's the application's reponsibility to
check that the socket is indeed writable, and to cope with potential
failures (e.g. EAGAIN or ENOTCONN).

 Last but not last, the buffer size of each socket send are way to small
 (512, a third of an usual TCP frame). Here's the code with a bumped value:

Indeed, 1/3 of the ethernet MTU is quite small.

Would you like to submit a patch?

--
nosy: +neologix

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



[issue12498] asyncore.dispatcher_with_send, disconnection problem + miss-conception

2011-07-24 Thread Charles-François Natali

Changes by Charles-François Natali neolo...@free.fr:


--
components: +Library (Lib) -IO
stage:  - needs patch
type:  - behavior
versions: +Python 3.2, Python 3.3

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



[issue10141] SocketCan support

2011-07-24 Thread Charles-François Natali

Charles-François Natali neolo...@free.fr added the comment:

Thanks for updating your patch.
I've done a review, available here:
http://bugs.python.org/review/10141/show

--

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



[issue12394] packaging: generate scripts from callable (dotted paths)

2011-07-24 Thread Éric Araujo

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


Removed file: http://bugs.python.org/file22744/unnamed

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



[issue12394] packaging: generate scripts from callable (dotted paths)

2011-07-24 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

higery’s message was this:

 I have already set the option as you said earlier, but how to
 'push' it to remote repository? It's just a configuration file under
 the .hg directory...

I was mistaken; setting the diff git option is important if you generate 
patches from your clone, but this does not matter with the automatic 
generation.  I’ll open a report on the metatracker.

--

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



[issue12540] Restart Shell command leaves pythonw.exe processes running

2011-07-24 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

I mentioned pipes because half of the subprocess chapter, it seems, talks about 
them. ASo I got the mis-impression that they are special for subprocess-started 
processes. But if the subprocess gets the args it needs to connect to a socket, 
it should not care how it is started.

Anyway, some experiments:

3.1.3 and 3.1.4 freshly installed do not seem to have the zombie problem. This 
seems to rule out the possibility that the problem is due to recent patches 
from Microsoft.

I redeleted 3.2 installation and re-installed 3.2. Sys.version still 
mistakingly say 3.2.1, July 10., so there is something different about the 
relationship between 3.2 and 3.2.1 and that between 3.1.3 and 3.1.4. And the 
3.2 re-install has the zombie problem while I do not believe the fresh 3.2 
install did. (And it does not on my other machine.) But I do not see how 
something stuck in the registry could affect process killing.

In the notepad example, changing

pid = os.spawnv(os.P_NOWAIT, 'C:/WINDOWS/notepad.exe', ['notepad.exe'])
# (full path needed if not in /windows) to
pid = subprocess.Popen(['C:/WINDOWS/notepad.exe']).pid

changed the 'pid' from a constant (across multiple runs) to a variable (across 
multiple runs) and changed the result of the kill from a zombie and exception 
to proper termination.

When I tried the same fix in idlelib/PyShell.py, adding 'import subprocess' and 
changing
self.rpcpid = os.spawnv(os.P_NOWAIT, sys.executable, args)
to
self.rpcpid = subprocess.Popen(args).pid
(args begins with sys.executable) IDLE failed to start. The only evidence that 
it had been invoked was a brief (1/4 second?) appearance of 1 pythonw process 
in task manager. On a subsequent tries, without touching the file, I do not see 
even that. Is there any obvious mistake in the above?

--

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



[issue12626] run test cases based on a glob filter

2011-07-24 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
nosy: +ericsnow

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



[issue12630] pydoc does not remove '#'-s from doc comments

2011-07-24 Thread tkiss80

New submission from tkiss80 tkis...@gmail.com:

If an entity does not have a docstring, pydoc.getdoc() reads the comment 
associated with that entity and uses that as the source of documentation. 
However, inspect.getcomments() returns the raw comment with the comment signs 
('#') in it, thus the resulting documentation looks ugly and confusing. Is 
there a way to solve this problem?

I know that this is not an easy task, because by implementing a specific '#' 
removing solution, the format of the doc comments would be restricted to 
conform to that algorithm with little formatting freedom. But maybe someone can 
come up with a good idea, such as counting '#'-s in the first line and strip 
all the lines accordingly.

--
messages: 141061
nosy: tkiss80
priority: normal
severity: normal
status: open
title: pydoc does not remove '#'-s from doc comments
type: behavior
versions: Python 3.1

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



[issue12630] pydoc does not remove '#'-s from doc comments

2011-07-24 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

The best solution is to modify the offending code to use real docstrings.

Failing that, a simple explicit '\n'.join(line.lstrip('#' for line in 
comment.split('\n')) (i.e. not as part of pydoc) will handle most cases.

Anything more sophisticated would need to be tailored to the comment format of 
the code that is missing docstrings.

--
nosy: +ncoghlan
resolution:  - rejected
stage:  - committed/rejected
status: open - closed

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



[issue12448] smtplib's __main__ doesn't flush when prompting

2011-07-24 Thread Raymond Hettinger

Raymond Hettinger raymond.hettin...@gmail.com added the comment:

Looks good.
Thx.

--
assignee:  - rhettinger
nosy: +rhettinger

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



[issue12618] py_compile cannot create files in current directory

2011-07-24 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

It's rare to receive fixes from Windows users that don't have a dev environment 
set up (i.e. they just edited their stdlib code in place, or copied it and 
created a modified version). Thanks for persisting in the face of invalid 
assumptions on our part.

--
nosy: +ncoghlan

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



[issue12576] urlib.request fails to open some sites

2011-07-24 Thread Senthil Kumaran

Senthil Kumaran sent...@uthcode.com added the comment:

I propose the attached patch as fix to this issue. All it does is, moves the 
code of getting http response to the finally block of the http request. It 
closes the sockets if the getting the response fails for some reason, otherwise 
it proceeds normally.  

Please provide your critique if any, otherwise, I shall go ahead with checking 
this in.

--
keywords: +patch
Added file: http://bugs.python.org/file22746/issue12576.patch

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



[issue12631] Mutable Sequence Type in .remove() is consistent only with lists, but not with bytearrays

2011-07-24 Thread py.user

New submission from py.user port...@yandex.ru:

4.6.4 Mutable Sequence Types

|  s.remove(x)  |  same as del s[s.index(x)]  |


 b = bytearray()
 b.extend(range(1, 6))
 b
bytearray(b'\x01\x02\x03\x04\x05')
 b.remove(2)
 del b[b.index(2)]
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: Type int doesn't support the buffer API


--
assignee: docs@python
components: Documentation, Interpreter Core
messages: 141066
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: Mutable Sequence Type in .remove() is consistent only with lists, but 
not with bytearrays
versions: Python 3.1

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



[issue12631] Mutable Sequence Type in .remove() is consistent only with lists, but not with bytearrays

2011-07-24 Thread py.user

Changes by py.user port...@yandex.ru:


--
type:  - behavior

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



[issue12632] Windows GPF with Code Page 65001

2011-07-24 Thread Bruce Ferris

New submission from Bruce Ferris bferri...@bferris.co.uk:

The following scenario GPFs on Windows Vista using cmd.exe...

  D:\python
  Python 3.1.2 (r312:79149, Mar 21 2010, 00:41:52) [MSC v.1500 32 bit
   (Intel)] on win32
  Type help, copyright, credits or license for more information.
   ^Z

  D:\chcp 65001
  Active code page: 65001

  D:\python
  Fatal Python error: Py_Initialize: can't initialize sys standard
   streams
  LookupError: unknown encoding: cp65001

  This application has requested the Runtime to terminate it in an 
  unusual way.
  Please contact the application's support team for more information.

  D:\

This is a bit surprising since Code Page 65001 IS the official Microsoft UTF-8 
Code Page.

Please see...

  http://msdn.microsoft.com/en-us/library/dd317756%28v=vs.85%29.aspx

--
components: Unicode
messages: 141067
nosy: bferris57
priority: normal
severity: normal
status: open
title: Windows GPF with Code Page 65001
versions: Python 3.1

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



[issue12632] Windows GPF with Code Page 65001

2011-07-24 Thread Bruce Ferris

Changes by Bruce Ferris bferri...@bferris.co.uk:


--
type:  - crash

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



[issue12632] Windows GPF with Code Page 65001

2011-07-24 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti, haypo

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



[issue12633] sys.modules gets special treatment

2011-07-24 Thread Eric Snow

New submission from Eric Snow ericsnowcurren...@gmail.com:

The sys.modules dict is a special object.  It is the only variable of the 
CPython interpreter object that is exposed in the sys module[1].  Everything 
else in sys lives in the module.  However, the modules dict lives in the 
interpreter object and is bound to the sys module separately.  No other 
variable of the interpreter object gets this treatment.

This situation sets up an unexpected behavior for sys.modules.  There are many 
places, mostly in Python/import.c, where the modules dict gets used and not by 
pulling from sys.modules.  These places use interp-modules directly[2].  So if 
sys.modules is re-bound, the imp module is using/reporting an out of sync 
modules dict.

One could argue that re-binding a module global is risky and should be avoided. 
 I agree.  Here is the use case that prompted me to march ahead anyway:

class BaseTest(TestCase):
@classmethod
def setUpClass(cls):
cls.sysmodules = sys.modules
sys.modules = sys.modules.copy()
@classmethod
def tearDownClass(cls):
sys.modules = cls.sysmodules

I was writing some import related tests and wanted sys.modules to be returned 
to its initial state after each test.  I realise that Lib/test/support.py 
provides CleanImport and others address this, but you have to provide the 
module names to clean up.  This is an unfortunate hassle sometimes when several 
layers of imports happen during the import of the module you care about.

So the result was an exception when I tried importing an extension module, like 
_sqlite3.  This is because in importdl.h the new module is added to the dict 
returned by PyImport_GetModuleDict(), not to the one at sys.modules.

For now I am doing the following to get the same effect:

class BaseTest(TestCase):
@classmethod
def setUpClass(cls):
cls.sysmodules = sys.modules.copy()
@classmethod
def tearDownClass(cls):
for name in sys.modules:
del sys.modules[name]
for name in cls.sysmodules:
sys.modules[name] = cls.sysmodules[name]

However, this is less efficient, sort of.  I expect that the current direct use 
of interp-modules in the CPython code is [much?] more efficient than 
PySys_GetObject(modules) calls.

Proposal

In light of all this I recommend that either use of interp-modules be replaced 
by PySys_GetObject(modules) calls, or the sys module documentation[3] be 
updated to make clear that sys.modules should not be re-bound (in a CPython 
implementation detail note).  I'm guessing that the first option is right out.  
The documentation addition would be just right.


[1] variables of the interpreter object found by grepping interp- in the 
CPython source:
 modules
 modules_by_index
 next
 codec_search_path
 codec_search_cache
 codec_error_registry
 codecs_initialized
 fscodec_initialized
 modules_reloading
 builtins
 sysdict
 tstate_head
 tscdump
 dlopenflags
[2] see PyImport_GetModuleDict() in Python/import.c
[3] http://docs.python.org/dev/library/sys.html#sys.modules

--
messages: 141068
nosy: ericsnow, ncoghlan
priority: normal
severity: normal
status: open
title: sys.modules gets special treatment
type: behavior
versions: Python 3.3

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



[issue12102] mmap requires file to be synced

2011-07-24 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 198627bbe242 by Ross Lagerwall in branch '3.2':
Issue #12102: Document that buffered files must be flushed before being used
http://hg.python.org/cpython/rev/198627bbe242

New changeset 4898b14dcd69 by Ross Lagerwall in branch 'default':
Issue #12102: Merge with 3.2.
http://hg.python.org/cpython/rev/4898b14dcd69

--
nosy: +python-dev

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



[issue12102] mmap requires file to be synced

2011-07-24 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset e75715f27ce7 by Ross Lagerwall in branch '2.7':
Issue #12102: Document that buffered files must be flushed before being used
http://hg.python.org/cpython/rev/e75715f27ce7

--

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



[issue12102] mmap requires file to be synced

2011-07-24 Thread Ross Lagerwall

Ross Lagerwall rosslagerw...@gmail.com added the comment:

Thanks!

--
assignee:  - rosslagerwall
resolution:  - fixed
stage:  - committed/rejected
status: open - closed
versions: +Python 3.3

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