[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

I propose the attached patch to block write() calls.

--
keywords: +patch
Added file: http://bugs.python.org/file26350/blockwrite.diff

___
Python tracker 

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



[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Revised

--
Added file: http://bugs.python.org/file26351/blockwrite.diff

___
Python tracker 

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



[issue15320] thread-safety issue in regrtest.main()

2012-07-11 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

There is indeed a race condition here.  Fortunately unit tests take much more 
time than the generator loop.

Is it enough to turn the generator into a fixed list? Or is the "late binding" 
behavior of args_tuple important? (For example, if the main thread changes the 
timeout variable, subsequent tests would see the modified value)

--
nosy: +amaury.forgeotdarc, pitrou

___
Python tracker 

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



[issue3405] Add support for the new data option supported by event generate (Tk 8.5)

2012-07-11 Thread Mark Summerfield

Mark Summerfield  added the comment:

According to the Tcl/Tk docs the 'data' field is a string (i.e., for any user 
data) and the 'detail' field contains some internal data (so shouldn't be 
messed with); see http://www.tcl.tk/man/tcl8.5/TkCmd/event.htm#M16

Anyway, I hope you add a data field for user created virtual events.

--
nosy: +mark

___
Python tracker 

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



[issue15324] --match does not work for regrtest

2012-07-11 Thread Chris Jerdonek

New submission from Chris Jerdonek :

The long form of the -m/--match option does not work with regrtest because it 
does not accept an argument.  For example (observe the lack of an error in the 
second invocation)--

$ ./python.exe -m test -m 
option -m requires argument
Use --help for usage
$ ./python.exe -m test --match
== CPython 3.3.0b1 (default:5d43154d68a8, Jul 8 2012, 13:54:45) [GCC 4.2.1 
Compatible Apple Clang 3.1 (tags/Apple/clang-318.0.58)]
...

--
keywords: easy
messages: 165235
nosy: cjerdonek
priority: normal
severity: normal
status: open
title: --match does not work for regrtest
versions: Python 3.3

___
Python tracker 

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



[issue15319] IDLE - sys.stdin, sys.stdout, etc are broken

2012-07-11 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> title: IDLE - input() is broken. -> IDLE - sys.stdin is broken.

Well, now, with the modified header, I'm not going to open a separate
issue. Here is a patch that fixes almost all IDLE sys.std* issues.

--
title: IDLE - readline, isatty, and input broken -> IDLE - sys.stdin, 
sys.stdout, etc are broken
Added file: http://bugs.python.org/file26352/idle_stdstreams.patch

___
Python tracker 

___diff -r 2ecdda96f970 Lib/idlelib/PyShell.py
--- a/Lib/idlelib/PyShell.pyTue Jul 10 18:27:54 2012 +0200
+++ b/Lib/idlelib/PyShell.pyWed Jul 11 11:47:48 2012 +0300
@@ -1,6 +1,7 @@
 #! /usr/bin/env python3
 
 import getopt
+import io
 import os
 import os.path
 import re
@@ -410,7 +411,8 @@
 except socket.timeout as err:
 self.display_no_subprocess_error()
 return None
-self.rpcclt.register("stdin", self.tkconsole)
+self.rpcclt.register("console", self.tkconsole)
+self.rpcclt.register("stdin", self.tkconsole.stdin)
 self.rpcclt.register("stdout", self.tkconsole.stdout)
 self.rpcclt.register("stderr", self.tkconsole.stderr)
 self.rpcclt.register("flist", self.tkconsole.flist)
@@ -854,13 +856,14 @@
 self.save_stderr = sys.stderr
 self.save_stdin = sys.stdin
 from idlelib import IOBinding
-self.stdout = PseudoFile(self, "stdout", IOBinding.encoding)
-self.stderr = PseudoFile(self, "stderr", IOBinding.encoding)
-self.console = PseudoFile(self, "console", IOBinding.encoding)
+self.stdout = OutputPseudoFile(self, "stdout", IOBinding.encoding)
+self.stderr = OutputPseudoFile(self, "stderr", IOBinding.encoding)
+self.console = OutputPseudoFile(self, "console", IOBinding.encoding)
+self.stdin = InputPseudoFile(self, "stdin", IOBinding.encoding)
 if not use_subprocess:
 sys.stdout = self.stdout
 sys.stderr = self.stderr
-sys.stdin = self
+sys.stdin = self.stdin
 try:
 # page help() text to shell.
 import pydoc # import must be done here to capture i/o rebinding.
@@ -1250,28 +1253,68 @@
 if not use_subprocess:
 raise KeyboardInterrupt
 
-class PseudoFile(object):
+class PseudoFile(io.TextIOBase):
 
 def __init__(self, shell, tags, encoding=None):
 self.shell = shell
 self.tags = tags
-self.encoding = encoding
+self._encoding = encoding
+
+@property
+def encoding(self):
+return self._encoding
+
+def isatty(self):
+return True
+
+def close(self):
+return self.shell.close()
+
+
+class InputPseudoFile(PseudoFile):
+
+_line_buffer = ''
+
+def readable(self):
+return True
+
+def read(self, n=-1):
+if n is None:
+n = -1
+result = self._line_buffer
+self._line_buffer = ''
+if n < 0:
+while True:
+line = self.readline()
+if not line: break
+result += line
+else:
+while len(result) < n:
+line = self.readline()
+if not line: break
+result += line
+self._line_buffer = result[n:]
+result = result[:n]
+return result
+
+def readline(self):
+if self._line_buffer:
+line = self._line_buffer
+self._line_buffer = ''
+return line
+return self.shell.readline()
+
+
+class OutputPseudoFile(PseudoFile):
+
+def writable(self):
+return True
 
 def write(self, s):
 if not isinstance(s, str):
 raise TypeError('must be str, not ' + type(s).__name__)
 self.shell.write(s, self.tags)
 
-def writelines(self, lines):
-for line in lines:
-self.write(line)
-
-def flush(self):
-pass
-
-def isatty(self):
-return True
-
 
 usage_msg = """\
 
diff -r 2ecdda96f970 Lib/idlelib/run.py
--- a/Lib/idlelib/run.pyTue Jul 10 18:27:54 2012 +0200
+++ b/Lib/idlelib/run.pyWed Jul 11 11:47:48 2012 +0300
@@ -258,23 +258,15 @@
 quitting = True
 thread.interrupt_main()
 
-class _RPCFile(io.TextIOBase):
-"""Wrapper class for the RPC proxy to typecheck arguments
-that may not support pickling."""
-
-def __init__(self, rpc):
-super.__setattr__(self, 'rpc', rpc)
-
-def __getattr__(self, name):
-return getattr(self.rpc, name)
-
-def __setattr__(self, name, value):
-return setattr(self.rpc, name, value)
-
-def write(self, s):
+def _checked_text_writer(writer):
+# Wrap the RPC proxy to typecheck arguments that may not support pickling.
+oldwrite = writer.write
+def write(s):
 if not isinstance(s, str):
 rai

[issue15319] IDLE - sys.stdin, sys.stdout, etc are broken

2012-07-11 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Serhiy: this issue is closed, so your patch won't be considered.

--

___
Python tracker 

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



[issue15319] IDLE - readline, isatty, and input broken

2012-07-11 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Sorry, I missed the morning's discussion.

--
title: IDLE - sys.stdin, sys.stdout, etc are broken -> IDLE - readline, isatty, 
and input broken

___
Python tracker 

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



[issue15323] Provide target name in output message when Mock.assert_called_once_with fails

2012-07-11 Thread Michael Foord

Michael Foord  added the comment:

Looks good, thanks.

--
assignee:  -> michael.foord
nosy: +michael.foord

___
Python tracker 

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



[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

sys.std* streams have many other issues.

>>> sys.stdin.readable()
Traceback (most recent call last):
  File "", line 1, in 
sys.stdin.readable()
AttributeError: readable
>>> sys.stdout.writable()
Traceback (most recent call last):
  File "", line 1, in 
sys.stdout.writable()
AttributeError: writable
>>> sys.stdout.newlines
Traceback (most recent call last):
  File "", line 1, in 
sys.stdout.newlines
AttributeError: newlines
>>> sys.stdin.read(1)
Traceback (most recent call last):
  File "", line 1, in 
sys.stdin.read(1)
AttributeError: read

And some other.

Here is a patch that fixes almost all IDLE sys.std* issues.

--
Added file: http://bugs.python.org/file26353/idle_stdstreams-2.patch

___
Python tracker 

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



[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Added getvar method to PyShell.console.

--
Added file: http://bugs.python.org/file26354/idle_stdstreams-3.patch

___
Python tracker 

___diff -r 300e2bbd413c Lib/idlelib/PyShell.py
--- a/Lib/idlelib/PyShell.pyWed Jul 11 09:17:54 2012 +0200
+++ b/Lib/idlelib/PyShell.pyWed Jul 11 12:33:10 2012 +0300
@@ -1,6 +1,7 @@
 #! /usr/bin/env python3
 
 import getopt
+import io
 import os
 import os.path
 import re
@@ -410,7 +411,8 @@
 except socket.timeout as err:
 self.display_no_subprocess_error()
 return None
-self.rpcclt.register("stdin", self.tkconsole)
+self.rpcclt.register("console", self.tkconsole)
+self.rpcclt.register("stdin", self.tkconsole.stdin)
 self.rpcclt.register("stdout", self.tkconsole.stdout)
 self.rpcclt.register("stderr", self.tkconsole.stderr)
 self.rpcclt.register("flist", self.tkconsole.flist)
@@ -854,13 +856,15 @@
 self.save_stderr = sys.stderr
 self.save_stdin = sys.stdin
 from idlelib import IOBinding
-self.stdout = PseudoFile(self, "stdout", IOBinding.encoding)
-self.stderr = PseudoFile(self, "stderr", IOBinding.encoding)
-self.console = PseudoFile(self, "console", IOBinding.encoding)
+self.stdout = OutputPseudoFile(self, "stdout", IOBinding.encoding)
+self.stderr = OutputPseudoFile(self, "stderr", IOBinding.encoding)
+self.console = OutputPseudoFile(self, "console", IOBinding.encoding)
+self.console.getvar = self.getvar
+self.stdin = InputPseudoFile(self, "stdin", IOBinding.encoding)
 if not use_subprocess:
 sys.stdout = self.stdout
 sys.stderr = self.stderr
-sys.stdin = self
+sys.stdin = self.stdin
 try:
 # page help() text to shell.
 import pydoc # import must be done here to capture i/o rebinding.
@@ -1250,28 +1254,68 @@
 if not use_subprocess:
 raise KeyboardInterrupt
 
-class PseudoFile(object):
+class PseudoFile(io.TextIOBase):
 
 def __init__(self, shell, tags, encoding=None):
 self.shell = shell
 self.tags = tags
-self.encoding = encoding
+self._encoding = encoding
+
+@property
+def encoding(self):
+return self._encoding
+
+def isatty(self):
+return True
+
+def close(self):
+return self.shell.close()
+
+
+class InputPseudoFile(PseudoFile):
+
+_line_buffer = ''
+
+def readable(self):
+return True
+
+def read(self, n=-1):
+if n is None:
+n = -1
+result = self._line_buffer
+self._line_buffer = ''
+if n < 0:
+while True:
+line = self.readline()
+if not line: break
+result += line
+else:
+while len(result) < n:
+line = self.readline()
+if not line: break
+result += line
+self._line_buffer = result[n:]
+result = result[:n]
+return result
+
+def readline(self):
+if self._line_buffer:
+line = self._line_buffer
+self._line_buffer = ''
+return line
+return self.shell.readline()
+
+
+class OutputPseudoFile(PseudoFile):
+
+def writable(self):
+return True
 
 def write(self, s):
 if not isinstance(s, str):
 raise TypeError('must be str, not ' + type(s).__name__)
 self.shell.write(s, self.tags)
 
-def writelines(self, lines):
-for line in lines:
-self.write(line)
-
-def flush(self):
-pass
-
-def isatty(self):
-return True
-
 
 usage_msg = """\
 
diff -r 300e2bbd413c Lib/idlelib/run.py
--- a/Lib/idlelib/run.pyWed Jul 11 09:17:54 2012 +0200
+++ b/Lib/idlelib/run.pyWed Jul 11 12:33:10 2012 +0300
@@ -258,29 +258,15 @@
 quitting = True
 thread.interrupt_main()
 
-class _RPCFile(io.TextIOBase):
-"""Wrapper class for the RPC proxy to typecheck arguments
-that may not support pickling. The base class is there only
-to support type tests; all implementations come from the remote
-object."""
-
-def __init__(self, rpc):
-super.__setattr__(self, 'rpc', rpc)
-
-def __getattribute__(self, name):
-# When accessing the 'rpc' attribute, or 'write', use ours
-if name in ('rpc', 'write'):
-return io.TextIOBase.__getattribute__(self, name)
-# Else only look into the remote object only
-return getattr(self.rpc, name)
-
-def __setattr__(self, name, value):
-return setattr(self.rpc, name, value)
-
-def write(self, s):
+def _checked_text_writer(writer):
+# Wrap the RPC proxy to typecheck arguments that may 

[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Serhiy: can you please explicitly list what issues your patch fixes?

I can think of many *more* issues that your patch doesn't fix, e.g. 
sys.stdin.read(sys) and sys.stdout.read().

I'm quite opposed to monkey-patching, so I won't commit any patch that involves 
monkey-patching (i.e. _checked_text_writer). I'm also unsure what problem this 
change to monkey-patching solves: I believe the current code is fine in this 
respect as it stands.

Before you grow the patch to add many more lines of code, please try to stick 
to the "one issue at a time" principle. As a guideline: if you need to write 
additional lines of code, it's a separate issue.

--

___
Python tracker 

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



[issue15325] --fromfile does not work for regrtest

2012-07-11 Thread Chris Jerdonek

New submission from Chris Jerdonek :

The long form of the -f/--fromfile option does not work.  It does not read its 
required argument.  For example (observe that the second invocation raises no 
error)--

$ ./python.exe -m test -f
option -f requires argument
Use --help for usage
$ ./python.exe -m test --fromfile
== CPython 3.3.0b1 (default:5d43154d68a8, Jul 8 2012, 13:54:45) [GCC 4.2.1 
Compatible Apple Clang 3.1 (tags/Apple/clang-318.0.58)]

Note that issue 15302 will fix this.

--
keywords: easy
messages: 165243
nosy: cjerdonek
priority: normal
severity: normal
status: open
title: --fromfile does not work for regrtest
versions: Python 3.3

___
Python tracker 

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



[issue15324] --match does not work for regrtest

2012-07-11 Thread Chris Jerdonek

Chris Jerdonek  added the comment:

Note that issue 15302 will fix this.

--

___
Python tracker 

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



[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

As an additional note: the change to monkey-patching breaks the test 

isinstance(sys.stdout, io.TextIOBase)

which currently succeeds.

--

___
Python tracker 

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



[issue15326] --random does not work for regrtest

2012-07-11 Thread Chris Jerdonek

New submission from Chris Jerdonek :

The long form of the -r/--random option does not work:

$ ./python.exe -m test --random
No handler for option --random.  Please report this as a bug at 
http://bugs.python.org.

Note that issue 15302 will fix this.

--
components: Tests
keywords: easy
messages: 165246
nosy: cjerdonek
priority: normal
severity: normal
status: open
title: --random does not work for regrtest
versions: Python 3.3

___
Python tracker 

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



[issue15302] Use argparse instead of getopt in test.regrtest

2012-07-11 Thread Chris Jerdonek

Chris Jerdonek  added the comment:

Attached is a first version of a complete patch.

Note that I found three bugs in the current argument parsing code in the course 
of working on this patch: issue 15324, issue 15325, and issue 15326 (because of 
various typos in the getopt configuration).  All of these should be fixed by 
the current patch.

--
Added file: http://bugs.python.org/file26355/issue-15302-2.patch

___
Python tracker 

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



[issue15327] Argparse: main arguments and subparser arguments indistinguishable

2012-07-11 Thread Ingo Fischer

New submission from Ingo Fischer :

I have an argument called '--verbose' in the main parser. 
Then I add a subparser called 'command', to which I add an argument with the 
same name '--verbose' (See attached script).

When I process these args, I cannot decide afterwards if the user called 
'myscript --verbose command' or 'myscript command --verbose'. I always get the 
same Namespace object returned from parse_args.

IMHO the Namespace object should also provide informations about the source 
parser, to make main parser args and subparser args distinguishable. Also if I 
call 'myscript --verbose command --verbose', I should get both args in the 
resulting Namespace object.

--
components: Library (Lib)
files: argparsetest.py
messages: 165248
nosy: Ingo.Fischer
priority: normal
severity: normal
status: open
title: Argparse: main arguments and subparser arguments indistinguishable
type: enhancement
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file26356/argparsetest.py

___
Python tracker 

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



[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> Serhiy: can you please explicitly list what issues your patch fixes?

issue12967. And sys.std* in IDLE lacks other common sys.std* methods and
attributes.

> I can think of many *more* issues that your patch doesn't fix, e.g. 
> sys.stdin.read(sys) and sys.stdout.read().

sys.stdin.read(sys) and sys.stdout.read() should not work.

> I'm quite opposed to monkey-patching, so I won't commit any patch that 
> involves monkey-patching (i.e. _checked_text_writer). I'm also unsure what 
> problem this change to monkey-patching solves: I believe the current code is 
> fine in this respect as it stands.

I introduced _checked_text_writer, because the implementation of
_RPCFile was broken (I wrote this patch last evening and debug it this
morning). In addition, _RPCFile is a wrapper around RPCFile, which
itself is a wrapper. There are too many layers for me. If you are sure
that the current implementation of _RPCFile is correct, it is not
necessary.

> Before you grow the patch to add many more lines of code, please try to stick 
> to the "one issue at a time" principle.

In IDLE sys.std* bad mimic text streams -- this is one issue.

--

___
Python tracker 

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



[issue15320] thread-safety issue in regrtest.main()

2012-07-11 Thread Chris Jerdonek

Chris Jerdonek  added the comment:

I don't think the late binding is necessary. But it looks like late binding 
could be preserved simply by constructing args_tuple inside the worker thread 
instead of in the generator. Really, only "test" needs to be yielded. Nothing 
else varies in the loop.

Is popping from a list thread safe, or were you thinking of another queue?

--

___
Python tracker 

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



[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> As an additional note: the change to monkey-patching breaks the test 
> 
> isinstance(sys.stdout, io.TextIOBase)
> 
> which currently succeeds.

Agree, this is a regression. However isinstance(sys.stdout,
io.TextIOBase) is False now in no-subprocess mode. This should be fixed
also.

--

___
Python tracker 

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



[issue1346874] httplib simply ignores CONTINUE

2012-07-11 Thread André Cruz

André Cruz  added the comment:

Attached is an updated patch against 2.7.3. It solves a bug in the tests and 
implements Carl's suggestion. The new tests pass and it updates the 
documentation as well.

As for inclusion in 2.7, as this is in fact solving a bug, I would vote for it. 
Right now, if the client sends an "Expect" header, httplib will send the body 
of the request along, which is against the RFC. It is backwards-compatible.

--
Added file: http://bugs.python.org/file26357/issue1346874-273.patch

___
Python tracker 

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



[issue15320] thread-safety issue in regrtest.main()

2012-07-11 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

I was about to say "yes, listiter.__next__ is atomic" (it should, really), but 
that's not true (Hint: there is a Py_DECREF in the code...).

The script below crashes with:
Fatal Python error: Objects/listobject.c:2774 object at 0x7f66b7a6c600 has 
negative ref count -1
Attached patch fixes it.


import threading
class C:
def __del__(self):
print("DEL")
ITER = iter([C() for x in range(100)])
def f():
for obj in ITER:
pass
for x in range(10):
t = threading.Thread(target=f)
t.start()

--
keywords: +patch
Added file: http://bugs.python.org/file26358/listiter_next_atomic.patch

___
Python tracker 

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



[issue3405] Add support for the new data option supported by event generate (Tk 8.5)

2012-07-11 Thread O.C.

O.C.  added the comment:

I don't agree with this comment.

1) The 'detail' field also contains a string, one of the following: 
"NotifyAncestor", "NotifyNonlinearVirtual",...

2) When an event is received, the 'detail' and 'user_data' fields are de facto 
mixed up. Indeed, the "%d" field contains "the detail or user_data field from 
the event".

This information comes form the documentation I cited, 
http://www.tcl.tk/man/tcl8.5/TkCmd/bind.htm#M24 :

* The "%d" field contains "the detail or user_data field from the event".
* They are both strings:
* "the %d is replaced by a string identifying the detail"
* "For virtual events, the string will be whatever value is stored in the 
user_data field when the event was created (typically with event generate), or 
the empty string if the field is NULL"

>From the document cited in msg165234 
>(http://www.tcl.tk/man/tcl8.5/TkCmd/event.htm#M16), my understanding is:

* For virtual events, the "data" string parameter given to "event generate" 
will be stored in the "user_data field" for the event. This string will then be 
available from the event through the "%d" substitution.

* For events "Enter", "Leave", "FocusIn" and "FocusOut", the "detail" field 
will store a string among "NotifyAncestor", etc. This string will then be 
available from the event through the "%d" substitution.

So, from the point of view of the guy who receives the event, the "%d" field 
can EITHER be a "detail" string like "NotifyAncestor" if event was 
"Enter"/"Leave"/"FocusIn"/"FocusOut" OR a "user_data" string in the case of a 
virtual event. It seems sensible that the Python interface provides both names. 
As a consequence, I think the patch should read:

+# value passed to the data option is not a widget, take it
+# as the detail field
+e.data = None
+e.detail = d
+e.user_data = d

I hope I understood the doc correctly.

--

___
Python tracker 

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



[issue15302] Use argparse instead of getopt in test.regrtest

2012-07-11 Thread Brett Cannon

Changes by Brett Cannon :


--
stage: needs patch -> patch review

___
Python tracker 

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



[issue8823] urllib2 does not catch httplib.BadStatusLine

2012-07-11 Thread Greg Roodt

Greg Roodt  added the comment:

By the way, the issue can be recreated by running the following:

netcat -l -p  -e "echo HTTP/1.1 1000 OK" &
python -c "import urllib2; urllib2.urlopen('http://localhost:')"

This happens on 2.6, 2.7 and 3 by the looks of it.

--

___
Python tracker 

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



[issue15328] datetime.strptime slow

2012-07-11 Thread Lars Nordin

New submission from Lars Nordin :

The datetime.strptime works well enough for me it is just slow.

I recently added a comparison to a log parsing script to skip log lines earlier 
than a set date. After doing so my script ran much slower.
I am processing 4,784,212 log lines in 1,746 files.

Using Linux "time", the measured run time is:
real5m12.884s
user4m54.330s
sys 0m2.344s

Altering the script to cache the datetime object if the date string is the 
same, reduces the run time to: 
real1m3.816s
user0m49.635s
sys 0m1.696s

# --- code snippet ---
# start_dt calculated at script start
...
day_dt = datetime.datetime.strptime(day_str, "%Y-%m-%d")
if day_dt < start_dt:
...


$ python
import platform
print 'Version  :', platform.python_version()
print 'Version tuple:', platform.python_version_tuple()
print 'Compiler :', platform.python_compiler()
print 'Build:', platform.python_build()

Version  : 2.7.2+
Version tuple: ('2', '7', '2+')
Compiler : GCC 4.6.1
Build: ('default', 'Oct  4 2011 20:03:08')

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:Ubuntu 11.10
Release:11.10
Codename:   oneiric

--
components: None
messages: 165256
nosy: Lars.Nordin
priority: normal
severity: normal
status: open
title: datetime.strptime slow
type: performance
versions: Python 2.7

___
Python tracker 

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



[issue15328] datetime.strptime slow

2012-07-11 Thread Lars Nordin

Lars Nordin  added the comment:

Running the script without any timestamp comparison (and parsing more log 
lines), gives these performance numbers:

log lines: 7,173,101

time output:
real1m9.892s
user0m53.563s
sys 0m1.592s

--

___
Python tracker 

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



[issue15328] datetime.strptime slow

2012-07-11 Thread R. David Murray

R. David Murray  added the comment:

Thanks for the report.  However, do you have a patch to propose?  Otherwise I'm 
not sure there is a reason to keep this issue open...one can always say various 
things are slow; that by itself is not a bug.  Performance enhancement patches 
are welcome, though.

If you are proposing adding an LRU cache, I think it may be that that should be 
left up to the application, as you did in your case.  I'm not convinced there 
would be enough general benefit to make it worth adding to the stdlib, since 
the characteristics of date parsing workloads probably vary widely.

--
nosy: +belopolsky, r.david.murray

___
Python tracker 

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



[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

issue9290 also has relation to this.

--

___
Python tracker 

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



[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

issue7163 is another PseudoFile-related issue.

--

___
Python tracker 

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



[issue7897] Support parametrized tests in unittest

2012-07-11 Thread florian-rathgeber

Changes by florian-rathgeber :


--
nosy: +florian-rathgeber

___
Python tracker 

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



[issue12600] Add example of using load_tests to parameterise Test Cases

2012-07-11 Thread florian-rathgeber

Changes by florian-rathgeber :


--
nosy: +florian-rathgeber

___
Python tracker 

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



[issue15322] sysconfig.get_config_var('srcdir') returns unexpected value

2012-07-11 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +eric.araujo, tarek

___
Python tracker 

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



[issue15300] test directory doubly-nested running tests with -j/--multiprocess

2012-07-11 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Thanks, Chris. I haven't tested the patch but it looks fine.

--

___
Python tracker 

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



[issue15322] sysconfig.get_config_var('srcdir') returns unexpected value

2012-07-11 Thread Éric Araujo

Éric Araujo  added the comment:

Looks like a duplicate; I can’t search right now (try sysconfig + build).

--

___
Python tracker 

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



[issue7163] IDLE suppresses sys.stdout.write() return value

2012-07-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +storchaka

___
Python tracker 

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



[issue15320] thread-safety issue in regrtest.main()

2012-07-11 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Amaury's patch looks obviously fine.

As for the original issue: yes, I thought I saw a traceback once due to that. 
Using list.pop() (or deque.pop()) instead would probably be good enough.

--
stage:  -> patch review
versions: +Python 2.7, Python 3.2

___
Python tracker 

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



[issue15320] thread-safety issue in regrtest.main()

2012-07-11 Thread Florent Xicluna

Changes by Florent Xicluna :


--
nosy: +flox

___
Python tracker 

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



[issue14797] Deprecate imp.find_module()/load_module()

2012-07-11 Thread Florent Xicluna

Changes by Florent Xicluna :


--
nosy: +flox

___
Python tracker 

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



[issue5815] locale.getdefaultlocale() missing corner case

2012-07-11 Thread rg3

rg3  added the comment:

I don't know if the behavior is considered a bug or just undocumented, but 
under Python 2.7.3 it's still the same. locale.getpreferredencoding() does 
return UTF-8, but the second element in the tuple locale.getdefaultlocale() is 
"utf_8_valencia", which is not a valid encoding despite the documentation 
saying it's supposed to be an encoding name.

>From my terminal:

$ python -V
Python 2.7.3

$ LANG=ca_ES.UTF-8@valencia python -c 'import locale; print 
locale.getpreferredencoding()'
UTF-8

$ LANG=ca_ES.UTF-8@valencia python -c 'import locale; print 
locale.getdefaultlocale()'
('ca_ES', 'utf_8_valencia')

$ LANG=ca_ES.UTF-8 python -c 'import locale; print 
locale.getpreferredencoding()'
UTF-8

$ LANG=ca_ES.UTF-8 python -c 'import locale; print locale.getdefaultlocale()'
('ca_ES', 'UTF-8')

--

___
Python tracker 

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



[issue15300] test directory doubly-nested running tests with -j/--multiprocess

2012-07-11 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 724a6e0e35f0 by Antoine Pitrou in branch '3.2':
Issue #15300: Ensure the temporary test working directories are in the same 
parent folder when running tests in multiprocess mode from a Python build.
http://hg.python.org/cpython/rev/724a6e0e35f0

New changeset 4752fafb579d by Antoine Pitrou in branch 'default':
Issue #15300: Ensure the temporary test working directories are in the same 
parent folder when running tests in multiprocess mode from a Python build.
http://hg.python.org/cpython/rev/4752fafb579d

--
nosy: +python-dev

___
Python tracker 

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



[issue15300] test directory doubly-nested running tests with -j/--multiprocess

2012-07-11 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Committed now.

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed
versions: +Python 3.2

___
Python tracker 

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



[issue5815] locale.getdefaultlocale() missing corner case

2012-07-11 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

The patch is not work for "ca_ES@valencia" locale.

And there are issues for such locales: "ks_in@devanagari", 
"[email protected]", "sd", "[email protected]" ("ks_in@devanagari" in 
locale_alias maps to "[email protected]" and "sd" to 
"[email protected]").

--
nosy: +storchaka

___
Python tracker 

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



[issue15322] sysconfig.get_config_var('srcdir') returns unexpected value

2012-07-11 Thread Chris Jerdonek

Chris Jerdonek  added the comment:

I searched a little before.  There is issue 12141, 
"sysconfig.get_config_vars('srcdir') fails in specific cases," but that issue 
is closed.

In the comments there, Antoine seems to be describing the bug I describe here, 
but I'm not sure an issue was filed:

http://bugs.python.org/issue12141#msg136493

--

___
Python tracker 

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



[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

"implements textio badly" is *not* a well-defined issue.

First it is a personal judgement: some think it's really bad, some think it's 
quite ok.

More importantly, such issue has no clear success criterion: how do we know we 
are done - can we hope to EVER close such an issue? No, because somebody might 
still find bad behavior. An issue absolutely needs anobjective test to 
determine whether it is resolved, and to reproduce it, this is not negotiable. 
"it behaves badly" provides no test.

In any case,*this* issue is about sys.stdin being writable.

Any objection to checking in my patch?

--

___
Python tracker 

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



[issue15320] thread-safety issue in regrtest.main()

2012-07-11 Thread Chris Jerdonek

Chris Jerdonek  added the comment:

Attaching a patch for the original issue using deque.

--
Added file: http://bugs.python.org/file26359/issue-15320-1.patch

___
Python tracker 

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



[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> In any case,*this* issue is about sys.stdin being writable.

I already got confused with all these closing/reopening/renaming of
issues and floating code. Should I open my own issue even if it
duplicates and supersedes some other?

> Any objection to checking in my patch?

It does not fixes the issue. sys.stdin.writelines does not raise
exception.

Inheritance input file from output file looks very strange.
_RPCInputFile unnecessary, if redirect stdin not on PyShell self, but on
PyShell.stdin.

--

___
Python tracker 

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



[issue15320] thread-safety issue in regrtest.main()

2012-07-11 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Hmm, actually the patch is not ok, because of the -F option which uses an 
infinite iterator.

--

___
Python tracker 

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



[issue13866] {urllib, urllib.parse}.urlencode should not use quote_plus

2012-07-11 Thread jin

jin  added the comment:

I just ran into exactly the same problem and was quite disappointed to see that 
urlencode does not provide an option to use percent encoding.

My use case: I'm preparing some metadata on the server side that is stored as 
an url encoded string, the processing is done in python.

The metadata is then deocded by a JavaScript web UI.

So I end up with:
urllib.urlencode({ 'key': 'val with space'}) which produces 
"key=val+with+space" which of course stays that way after processing it with 
JavaScript's decodeURI().

So basically I seem to be forced to implement my own urlencode function... Most 
thing I like about python that it always seems to have exactly what one needs, 
unfortunately not in this specific case.

IMHO Stephen's suggestion #3 makes a lot of sense, while '+' maybe correct for 
forms, it's simply not useful for a number of other situations and I was really 
surprised by the fact that there's no standard function that would url-encode 
with percentage encoding.

--
nosy: +jin

___
Python tracker 

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



[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Martin v . Löwis

Changes by Martin v. Löwis :


Added file: http://bugs.python.org/file26360/blockfile-3.diff

___
Python tracker 

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



[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Martin v . Löwis

Changes by Martin v. Löwis :


Removed file: http://bugs.python.org/file26360/blockfile-3.diff

___
Python tracker 

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



[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Martin v . Löwis

Changes by Martin v. Löwis :


Added file: http://bugs.python.org/file26361/blockfile-3.diff

___
Python tracker 

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



[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> I already got confused with all these closing/reopening/renaming of
> issues and floating code. Should I open my own issue even if it
> duplicates and supersedes some other?

I personally think it would be best if these issues where closed
*first*, and only then you submit a patch to fix any remaining issues.

>> Any objection to checking in my patch?
> 
> It does not fixes the issue. sys.stdin.writelines does not raise
> exception.

Ah. See blockfiles-3.diff then.

> Inheritance input file from output file looks very strange.

Where do you see that? In my patch, _RPCInputFile inherits from
_RPCFile, which is neither output nor input. Instead, _RPCOutputFile
also inherits from _RPCFile.

> _RPCInputFile unnecessary, if redirect stdin not on PyShell self, but on
> PyShell.stdin.

It is necessary, as rpc will not communicate the exceptions properly.

--

___
Python tracker 

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



[issue15329] clarify which deque methods are thread-safe

2012-07-11 Thread Chris Jerdonek

New submission from Chris Jerdonek :

I think it would help to clarify which collections.deque methods are 
thread-safe:

http://docs.python.org/dev/library/collections.html?highlight=deque#collections.deque

Currently, the documentation says that "Deques support thread-safe, memory 
efficient appends and pops from either side...," but it isn't obvious if this 
is meant to apply to all methods, or just the methods named append*() and 
pop*().

For example, is rotate() thread-safe?  The illustration given of 
d.appendleft(d.pop()) seems like it could be interleaved.

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 165275
nosy: cjerdonek, docs@python, rhettinger
priority: normal
severity: normal
status: open
title: clarify which deque methods are thread-safe
versions: Python 2.7, Python 3.3

___
Python tracker 

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



[issue15330] allow deque to act as a thread-safe circular buffer

2012-07-11 Thread Chris Jerdonek

New submission from Chris Jerdonek :

It seems like it would be useful if collections.deque had a thread-safe method 
that could rotate(1) and return the rotated value.

This would let deque to act as a thread-safe circular buffer (e.g. if serving 
jobs to multiple threads in a loop, like `python -m test --forever`).

--
components: Library (Lib)
messages: 165276
nosy: cjerdonek, rhettinger
priority: normal
severity: normal
status: open
title: allow deque to act as a thread-safe circular buffer
type: enhancement

___
Python tracker 

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



[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Roger Serwy

Roger Serwy  added the comment:

I tested blockfile-3.diff against the latest code in the repository.

sys.stdin.write returns the wrong error message when passed a non-string. 
Presently it returns io.UnsupportedOperation instead of TypeError: must be str, 
not ...

The attached blockfile-4.diff incorporates blockfile-3 and creates a decorator 
in _RPCFile to ensure the argument is a string and applies it to the 
_RPCInputFile and _RPCOutputFile write methods.

A simpler alternative would be duplicating the string check code in 
_RPCInputFile before the raise statement.

--
Added file: http://bugs.python.org/file26362/blockfile-4.diff

___
Python tracker 

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



[issue15320] thread-safety issue in regrtest.main()

2012-07-11 Thread Chris Jerdonek

Chris Jerdonek  added the comment:

Good catch.  Here is a patch that takes --forever mode into account.

I wrote this patch with the assumption that it shouldn't hurt if multiple 
threads call deque.extend() at the same time.

--
Added file: http://bugs.python.org/file26363/issue-15320-2.patch

___
Python tracker 

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



[issue15330] allow deque to act as a thread-safe circular buffer

2012-07-11 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> rhettinger
priority: normal -> low
versions: +Python 3.4

___
Python tracker 

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



[issue15330] allow deque to act as a thread-safe circular buffer

2012-07-11 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

By thread-safe you mean that the operation should be atomic?

--

___
Python tracker 

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



[issue15329] clarify which deque methods are thread-safe

2012-07-11 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: docs@python -> rhettinger

___
Python tracker 

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



[issue15330] allow deque to act as a thread-safe circular buffer

2012-07-11 Thread Chris Jerdonek

Chris Jerdonek  added the comment:

Yes, atomic. I was under the impression that the existing deque.rotate() is 
atomic, in which case deque.rotate(1) almost provides what I'm suggesting 
(lacking only the return value).

--

___
Python tracker 

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



[issue15330] allow deque to act as a thread-safe circular buffer

2012-07-11 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

We make almost no guarantees about atomicity.  If something in CPython happens 
to be atomic, it is not guaranteed to hold in other implementations.   The 
recommendation is to use locks anywhere you need a critical section of code.

FWIW, the term thread-safe is taken to mean, "won't break in a multi-threaded 
environment".  That is a bit different from atomic.  For example, the decimal 
module was designed with thread local contexts, but there are no atomic decimal 
operations.

--
resolution:  -> rejected
status: open -> closed

___
Python tracker 

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



[issue15330] allow deque to act as a thread-safe circular buffer

2012-07-11 Thread Chris Jerdonek

Chris Jerdonek  added the comment:

Thanks for the info.  A couple questions: what does "won't break" mean -- that 
it won't throw an exception of a type that it wouldn't normally throw in a 
single-threaded environment?  And does this mean that not even deque.pop() is 
atomic?

--

___
Python tracker 

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



[issue15329] clarify which deque methods are thread-safe

2012-07-11 Thread Chris Jerdonek

Chris Jerdonek  added the comment:

I think some of the information in the issue 15330 comments would be very 
helpful to add as well (what thread-safe means in Python, distinction between 
thread-safe and atomic, and which deque methods are thread-safe and/or atomic).

If some of that information is too general for the collections library, perhaps 
some of it can go in a section of the Python documentation about multithreading 
(the glossary?), and then be linked to there.

--

___
Python tracker 

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