[issue23682] distutils docs still talk about compatibility with Python 2.2

2015-03-16 Thread Thomas Kluyver

New submission from Thomas Kluyver:

I'm pretty sure the distutils docs for Python 3.4 don't need to describe how to 
make packages compatible with Python  2.2.3.

I know that these docs are deprecated in favour of the Python packaging guide, 
but I still look at them at times, and this is embarrassing.

--
assignee: docs@python
components: Documentation
files: dont-mention-py22.patch
keywords: patch
messages: 238241
nosy: docs@python, takluyver
priority: normal
severity: normal
status: open
title: distutils docs still talk about compatibility with Python 2.2
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file38512/dont-mention-py22.patch

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



[issue23682] distutils docs still talk about compatibility with Python 2.2

2015-03-16 Thread Berker Peksag

Berker Peksag added the comment:

I also removed it in my patch for issue 19610.

--
nosy: +berker.peksag

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



[issue23529] Limit decompressed data when reading from LZMAFile and BZ2File

2015-03-16 Thread Martin Panter

Martin Panter added the comment:

Posting LZMAFile-etc.v5.patch with the following changes:

* Merged with current code
* Changed BZ2File(buffer_size=...) to a keyword-only parameter and restored 
previous unused “buffering” parameter. Also changed the LZMAFile parameter to 
keyword-only for consistency.
* Dropped documenting how buffer_size affects the compressed data chunk size or 
the fast-forward chunk size for seeking
* Dropped backslash from \* in function signatures
* Documented and tested that buffer_size=0 is not valid for the LZMAFile etc 
classes
* Clarified a few code comments

There is still Nikolaus’s concern about setting the buffer size to zero and 
doing short reads, discussed on Rietveld. Apart from that, I think this patch 
addresses the rest of the comments. Let me know if I missed something!

--
Added file: http://bugs.python.org/file38514/LZMAFile-etc.v5.patch

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



[issue22852] urllib.parse wrongly strips empty #fragment

2015-03-16 Thread Demian Brecht

Demian Brecht added the comment:

 urlsplit(evil.com).netloc
 ''
 urlsplit(evil.com).has_netloc
 True
 urlunsplit(urlsplit(evil.com))  # Adds “//” back
 'evil.com'

RFC 3986, section 3.3:

   If a URI contains an authority component, then the path component
   must either be empty or begin with a slash (/) character.  If a URI
   does not contain an authority component, then the path cannot begin
   with two slash characters (//).

Because this is a backwards incompatible behavioural change and is just as 
invalid as far as the RFC goes, I think that the current behaviour should be 
preserved. Even though it's still incorrect, it won't break existing code if 
left unchanged.

 ## _NetlocResultMixinBase abuse ##
 
 The _NetlocResultMixinBase class is a common class used by the four result 
 classes I’m interested in. I probably should rename it to something like 
 _SplitParseMixinBase, since it is the common base to both urlsplit() and 
 urlparse() results.

I think I'm coming around to this and realizing that it's actually quite close 
to my proposal, the major difference being the additional level of hierarchy in 
mine. My issue was mostly due to the addition of the variadic signature in the 
docs (i.e. line 407 here: 
http://bugs.python.org/review/22852/diff/14176/Doc/library/urllib.parse.rst) 
which led me to believe a nonsensical signature would be valid. After looking 
at it again, __new__ is still bound to the tuple's signature, so you still get 
the following:

 SplitResult('scheme','authority','path','query','fragment','foo','bar','baz')
Traceback (most recent call last):
  File stdin, line 1, in module
  File /Volumes/src/p/cpython/Lib/urllib/parse.py, line 137, in __new__
self = super().__new__(type, *pos, **kw)
TypeError: __new__() takes 6 positional arguments but 9 were given

So I'm less opposed to this as-is. I would like to see the * removed from the 
docs though as it's misleading in the context of each of (Split|Parse)Result. I 
do agree that renaming _NetlocResultMixinBase would be helpful, but it might 
also be nice (from a pedant's point of view) to remove mixin altogether if 
the __new__ implementation stays as-is.

--

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



[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-03-16 Thread R. David Murray

R. David Murray added the comment:

No program that I work with (and I use cli all the time) outputs a tab when I 
press the tab key.  Now, true, I think I had to configure vi so that that was 
the case, but nothing else that I remember.  Of course, most of those programs 
use readline and come with some sort of configuration such as what we are 
(belatedly) supply in python's command line.  So, to me, outputting an actual 
tab character would be *less* consistent with my general (modern) computing 
experience.  Especially since we are, in fact, talking about python now doing 
autocomplete all the time :)

--

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



[issue11726] clarify that linecache only works on files that can be decoded successfully

2015-03-16 Thread Thomas Kluyver

Thomas Kluyver added the comment:

Anything else I should be doing here?

--

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



[issue23542] Update PEP 476 for using urllib2.build_opener()

2015-03-16 Thread Shakeel Mohamed

Shakeel Mohamed added the comment:

Hi, any plans to do this? If not, we can close it.

--

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



[issue22891] code removal from urllib.parse.urlsplit()

2015-03-16 Thread Martin Panter

Martin Panter added the comment:

The patch seems sensible. The only behaviour change I can forsee would be the 
odd case of http:1234 no longer being parsed like this:

 urlsplit(http:1234)
SplitResult(scheme='http', netloc='', path='1234', query='', fragment='')

Instead it would be parsed the same as HTTP:1234 (or tel:1234!):

 urlsplit(HTTP:1234)
SplitResult(scheme='', netloc='', path='HTTP:1234', query='', fragment='')

If optimizing for “http:” really is important, it might still be done without 
the code duplication. Other options might be factoring a subroutine, using 
str.strip(), set.issubset(), or regular expressions.

--
nosy: +vadmium

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



[issue22852] urllib.parse wrongly strips empty #fragment

2015-03-16 Thread Martin Panter

Martin Panter added the comment:

Regarding unparsing of evil.com, see Issue 23505, where the invalid 
behaviour is pointed out as a security issue. This was one of the bugs that 
motivated me to make this patch. I cannot imagine some existing code (other 
than an exploit) that would be broken by restoring the empty “//” component; do 
you have an example?

Why do you think the asterisks (*) in the Split/ParseResult signatures are 
misleading? I am trying to document that the has_ flags are keyword-only 
parameters. I avoided making them positional parameters, as they are not part 
of the underlying tuple object.

--

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



[issue23683] allow timeit to run expensive reset code per repeats

2015-03-16 Thread Robert Collins

New submission from Robert Collins:

I was timing some cold-cache operations today and had to not use timeit because 
I wanted to run some code between statement (flushing caches) that shouldn't be 
timed as part of statement. It would be nice, similarly to -s, to be able to 
say -i 'something run between statement repetitions'. That is - we run 
statement in a tight loop some N times, and then repeat that loop some R times, 
I'd like to run the -i code between the R repetitions, not inside the inner 
timing loop (since we run that to get timer resolution).

--
messages: 238252
nosy: rbcollins
priority: normal
severity: normal
status: open
title: allow timeit to run expensive reset code per repeats
type: enhancement

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



[issue23684] urlparse() documentation does not account for default scheme

2015-03-16 Thread Martin Panter

New submission from Martin Panter:

The documentation for urlsplit() says:

'''
urlparse(urlstring, scheme='', allow_fragments=True)

. . .

If the scheme argument is specified, it gives the default addressing scheme, to 
be used only if the URL does not specify one. The default value for this 
argument is the empty string.
'''

However this contradicts the table of attributes, which gives:

Attribute: scheme, . . . Value if not present: empty string

Similarly for urlsplit(). Of course, the description of the “scheme” parameter 
is correct, and the table is only correct when no “scheme” parameter is given:

 urlparse(//example.net).scheme
''
 urlparse(b//example.net).scheme
b''
 urlparse(//example.net, http).scheme
'http'

This issue is split off another where I tried to sneak in a quick fix, but the 
wording probably needs more thought. Original change: 
https://bugs.python.org/review/22852/patch/14176/52720#old-line-92.

Maybe change it to this?

Value if not present: empty string or default scheme

--
assignee: docs@python
components: Documentation
messages: 238253
nosy: docs@python, vadmium
priority: normal
severity: normal
status: open
title: urlparse() documentation does not account for default scheme

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



[issue22351] NNTP constructor exception leaves socket for garbage collector

2015-03-16 Thread Martin Panter

Martin Panter added the comment:

Thanks for reviewing, Serhiy. I am posting a new patch addressing the comments:

* Removed underscore from method name
* Made separate MockSslTests subclass, using a hacked ssl_context parameter to 
bypass the SSL module
* Separated asserts for closed socket and file objects

I have left the tests patching the “nntplib” module and inserting a mock 
“socket” module. Serhiy suggested patching the “socket” module directly, but 
that seems to be asking for trouble. Alternatives I can think of are:

* Go back to Rishi’s original code that uses a real socket in a background 
thread.
* Do the patching in a subprocess. But this is awkward if you want to reuse the 
existing NNTPv1Handler class in the subprocess. Suggestions or patches welcome 
:)
* Refactor the “nntplib” code specially to make it easier to test without a 
real socket and without patching

--
Added file: http://bugs.python.org/file38515/issue22351_nntp_fail_5.patch

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



[issue11410] Use GCC visibility attrs in PyAPI_*

2015-03-16 Thread Samuel Bronson

Samuel Bronson added the comment:

Um ... any progress on reviewing this?

--
nosy: +SamB

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



[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-03-16 Thread Martin Sekera

Martin Sekera added the comment:

Copy that. Would the patch be acceptable if the '\t' was simply changed to 4 
spaces?

To discuss further, it is my opinion that the interpreter should output a \t 
character when the TAB key is pressed, as this is the behavior of nearly every 
shell and interpreter (that doesn't autocomplete all the time) there is, 
including all versions of python. Introducing new behavior for the sake of 
compliance with PEP 8 (which, as it itself states, applies only to the Python 
code comprising the standard library in the main Python distribution), is in 
my opinion unnecessary and confusing (since to clear n indent levels the user 
has to backspace 4n times).

--

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



[issue23397] PEP 431 implementation

2015-03-16 Thread Dan Stromberg

Changes by Dan Stromberg strom...@gmail.com:


--
nosy: +strombrg

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



[issue22931] cookies with square brackets in value

2015-03-16 Thread Mark Hughes

Mark Hughes added the comment:

This is also an issue with Python 2.7.9 but not 2.7.8. There were various 
cookie related fixes in 2.7.9 which could have revealed this issue. Maybe this 
one?

https://hg.python.org/cpython/rev/9e765e65e5cb

--
nosy: +Mark Hughes

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



[issue22625] When cross-compiling, don’t try to execute binaries

2015-03-16 Thread Matthias Klose

Matthias Klose added the comment:

there are two approaches here, one to check in generated files and try to avoid 
the rebuild, or completely fix the cross build. I think the patch for the 
parallel build just was a bit over-eager

--

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



[issue23644] g++ module compile fails with ‘_Atomic’ does not name a type

2015-03-16 Thread STINNER Victor

STINNER Victor added the comment:

 using namespace std;

Doing this in a header is ugly.

--

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



[issue23665] Provide IDLE menu option to set command-line arguments

2015-03-16 Thread Saimadhav Heblikar

Saimadhav Heblikar added the comment:

http://bugs.python.org/issue5680

Also had submitted a patch for it. Could you post your review there? (I was 
learning the CPython style then, so excuse obvious mistakes :) )

--
nosy: +sahutd

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



[issue2211] Cookie.Morsel interface needs update

2015-03-16 Thread Demian Brecht

Changes by Demian Brecht demianbre...@gmail.com:


Added file: http://bugs.python.org/file38509/issue2211_5.patch

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



[issue23656] shutil.copyfile (or built-in open) releases sqlite3's transaction lock

2015-03-16 Thread Hiroaki Miyajima

Hiroaki Miyajima added the comment:

I've realized that this is a bug of specification of fcntl system call.
I am sorry to bother this site.

--
status: open - closed

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



[issue21862] cProfile command-line should accept -m module_name as an alternative to script path

2015-03-16 Thread Mayank Tripathi

Mayank Tripathi added the comment:

Could someone please review the patch. Thanks.

--

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



[issue22359] Remove incorrect uses of recursive make

2015-03-16 Thread Matthias Klose

Matthias Klose added the comment:

reopening, breaks cross builds. I'll have a look

--
resolution: fixed - 
status: closed - open

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



[issue23624] str.center inconsistent with format ^

2015-03-16 Thread Vedran Čačić

Vedran Čačić added the comment:

Ok, let's say I see your point about breaking existing code (though, I 
reiterate, it's _undocumented_ and even examples in the docs all cover only the 
obvious case).

Is it _at least_ possible to give .center an (keyword-only if needed) argument 
that specifies the rounding method? Default will of course be 
ROUND_HALF_EVEN, but it should be possible at least to specify ROUND_FLOOR 
to be consistent with format (maybe other rounding method should be supported, 
but it's not important).

This will not break anything, and it will be a tremendous help to those who 
want to switch from one method to the other (for example, once the field width 
becomes variable)? I suggest changing .center instead of format because a) it's 
easier and more Pythonic (keyword-only arguments are accepted method of dealing 
exactly with that kind of problem), b) it's more likely wanted to be changed, 
since format method is more obvious to many people, c) I guess more people 
switch in that direction, and d) format doesn't really have a nice hook in the 
format string to customize the rounding.

I sincerely hope you'll agree at least to this. Thank you.

--

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



[issue23644] g++ module compile fails with ‘_Atomic’ does not name a type

2015-03-16 Thread STINNER Victor

STINNER Victor added the comment:

 #define _Atomic(T) std::atomicT

This looks better to me :-) Can you please write a patch?

--

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



[issue23644] g++ module compile fails with ‘_Atomic’ does not name a type

2015-03-16 Thread Joshua J Cogliati

Joshua J Cogliati added the comment:

 using namespace std;

Doing this in a header is ugly.

If you put it in the:
#ifdef __cplusplus
extern C {
#endif

then it would only apply till the end of the pyatomic header, and not to 
anything that includes it.  Something like:

#ifdef __cplusplus
extern C {
#if defined(HAVE_STD_ATOMIC)
using namespace std;
#endif
#endif

But if you are already defining:
#define _Atomic(T) atomicT
maybe it should be:
#define _Atomic(T) std::atomicT

(I haven't checked any of this code, but they would get around the namespace 
std being changed in code that includes pyatomic.h problem. )

--

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



[issue23670] Modifications to support iOS as a cross-compilation target

2015-03-16 Thread Russell Keith-Magee

Russell Keith-Magee added the comment:

Nick: Finding a way to get on-device test results is next on my TODO list, once 
I've got the patch up to date for trunk. 

FYI - Updating to trunk is currently blocking on issue22625 (which was 
introduced by the fix for issue22359).

I had thought about using a mobile testing farm as a service, but I didn't 
know Sauce Labs had one. I'll keep that in mind when I get around to working on 
the test suite.

--

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



[issue22625] When cross-compiling, don’t try to execute binaries

2015-03-16 Thread Russell Keith-Magee

Russell Keith-Magee added the comment:

I'm looking into this issue because of issue23670 (iOS support). 

Am I correct in assuming that the right fix here is to identify a 
$(CC_FOR_BUILD) analog for $(PYTHON_FOR_BUILD) that will identify the build 
host's CC, enabling a build-host native $(PGEN) and _freeze_importlib to be 
compiled?

--
nosy: +freakboy3742

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



[issue23644] g++ module compile fails with ‘_Atomic’ does not name a type

2015-03-16 Thread Leonardo Bianconi

Leonardo Bianconi added the comment:

@haypo

For adding compatibility for atomics based on @Joshua.J.Cogliati change, I 
propose:

#ifndef Py_LIMITED_API
#ifndef Py_ATOMIC_H
#define Py_ATOMIC_H

#include dynamic_annotations.h

#include pyconfig.h

#if defined(HAVE_STD_ATOMIC)
#ifdef __cplusplus
#include atomic
#define _Atomic(T) atomicT
using namespace std;
#else
#include stdatomic.h
#endif
#endif

#ifdef __cplusplus
extern C {
#endif


/* This is modeled after the atomics interface from C1x, according to
 * the draft at
 * http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1425.pdf.
 * Operations and types are named the same except with a _Py_ prefix
 * and have the same semantics.
 *
 * Beware, the implementations here are deep magic.
 */

#if defined(HAVE_STD_ATOMIC)

typedef enum _Py_memory_order {
_Py_memory_order_relaxed = memory_order_relaxed,
_Py_memory_order_acquire = memory_order_acquire,
_Py_memory_order_release = memory_order_release,
_Py_memory_order_acq_rel = memory_order_acq_rel,
_Py_memory_order_seq_cst = memory_order_seq_cst
} _Py_memory_order;

typedef struct _Py_atomic_address {
_Atomic (void) *_value;
} _Py_atomic_address;

typedef struct _Py_atomic_int {
atomic_int _value;
} _Py_atomic_int;


... (rest same)

--
keywords: +patch
Added file: http://bugs.python.org/file38508/atomicfix.patch

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



[issue23677] Mention dict and set comps in library reference

2015-03-16 Thread R. David Murray

R. David Murray added the comment:

Sounds reasonable.  Dict and set comprehensions were added later than list 
comprehensions, and we probably just didn't notice this needed updating.

Mark's patch, however, is incorrect.  Mark: the dict/set literal notation is a 
different thing from a comprehension.

--
nosy: +r.david.murray

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



[issue23658] multiprocessing: string arg to SystemExit

2015-03-16 Thread Dan Nawrocki

Dan Nawrocki added the comment:

I am using 2.7.5 (RHEL7 and FC20). Indeed, this issue appears fixed in 2.7.7, 
by 
https://hg.python.org/cpython/diff/44b5ec2f0f5d/Lib/multiprocessing/process.py.

I'm closing as not a bug.

Thanks for the help!

--
resolution:  - not a bug
status: open - closed

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



[issue23678] imaplib status command cannot handle folder name containing whitespaces

2015-03-16 Thread bjshan

New submission from bjshan:

imaplib status failed if the folder name contains whitespace.
For example, 
c = IMAP4_SSL('hostname')
c = login(username, password)
c.status('Drafts', '(MESSAGES)')# would succeed
c.status('Apple Mail To Do', '(MESSAGES)') # would fail, error message is:
imaplib.error: STATUS command error: BAD [bparse error: wrong character; 
expected '(' but got 'M']

It seems the status method could not properly parse the folder name Apple Mail 
To Do, it recognizes only the first word Apple, then failed when meeting the 
following word Mail. 

I checked imaplib.py, _command 's definition looks like the cause, but I am not 
sure:

def _command(self, name, *args):
 
...

name = bytes(name, 'ASCII')
data = tag + b' ' + name
for arg in args:
if arg is None: continue
if isinstance(arg, str):
arg = bytes(arg, ASCII)
data = data + b' ' + arg

Work around for this:
Manually add double quote around the folder name, like:   
   '' + mailbox_name + ''

BUT, 
while c.status('Apple Mail To Do', '(MESSAGES)') worked, 
c.status('Apple Mail To Do', '(MESSAGES)') failed. Suggesting single and 
double quote weighs not the same?

--
components: Library (Lib)
messages: 238188
nosy: bjshan
priority: normal
severity: normal
status: open
title: imaplib status command cannot handle folder name containing whitespaces
type: behavior
versions: Python 3.4

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



[issue23674] super() documentation isn't very clear

2015-03-16 Thread Tapani Kiiskinen

Tapani Kiiskinen added the comment:

A link to the to the glossary would also be good yes. I was figuring out how 
super() works and as you said the doc gave the impression getattr would explain 
more but it doesn't. Had to use google to find the glossary entry for MRO which 
had the link explaining how that is calculated.

--

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



[issue23670] Modifications to support iOS as a cross-compilation target

2015-03-16 Thread Nick Coghlan

Nick Coghlan added the comment:

(Some work on the Buildbot site would still be required, but it would be 
triggering a Sauce Labs run rather than managing the mobile hardware directly)

--

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



[issue23670] Modifications to support iOS as a cross-compilation target

2015-03-16 Thread Nick Coghlan

Nick Coghlan added the comment:

Rather than trying to do something ourselves on the mobile testing front, we 
may want to instead explore the free-for-open-source-project offering from 
Sauce Labs: https://saucelabs.com/opensauce/

Adapting that to run the CPython self-tests as an app might be interesting, 
but they're PyCon sponsors, so they may be amenable to helping to get that work 
properly if we need to ask for their help.

Getting that set up would also potentially be a useful tool for ensuring PSF 
web services are working correctly across multiple browsers and client devices. 
(I'd actually like to get us to the point of being able to do continuous 
deployment of those services some day)

--

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



[issue23677] Mention dict and set comps in library reference

2015-03-16 Thread Mark Lawrence

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


--
keywords: +patch
versions: +Python 3.5
Added file: http://bugs.python.org/file38507/issue23677.diff

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



[issue23679] SSL Ciphers RC4

2015-03-16 Thread mogli

New submission from mogli:

The documentation (https://docs.python.org/2/library/ssl.html) says:
The settings in Python 2.7.9 are: PROTOCOL_SSLv23, OP_NO_SSLv2, and OP_NO_SSLv3 
with high encryption cipher suites without RC4

But it still seems to use RC4: https://www.howsmyssl.com/a/check

Also the test at https://www.ssllabs.com/ssltest/viewMyClient.html says it 
still supports SSLv3 (not so sure about this one).

--
messages: 238194
nosy: mogli
priority: normal
severity: normal
status: open
title: SSL Ciphers RC4
type: security
versions: Python 2.7

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



[issue23571] Raise SystemError if a function returns a result with an exception set

2015-03-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 91fbe0fff882 by Victor Stinner in branch 'default':
Issue #23571: Restore removed assert(!PyErr_Occurred()); in
https://hg.python.org/cpython/rev/91fbe0fff882

--

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



[issue18814] Add codecs.convert_surrogateescape to clean surrogate escaped strings

2015-03-16 Thread Nick Coghlan

Nick Coghlan added the comment:

(Serhiy, did you miss uploading the new patch?)

Regarding the names, we may need to think about the use cases a bit more 
explicitly to clarify that in terms of the Python codecs API rather than 
expecting folks to understand the underlying representation. In the case of 
handling lone surrogates and escaped surrogates, what about:

rehandle_surrogatepass(data, errors=strict)
rehandle_surrogateescape(data, errors=strict)

That is, we know we have data that was decoded with either surrogatepass or 
surrogateespace (respectively) as the error handler, and we want to process the 
results of that with a different error handler.

I believe those two would be enough to address the specific cases this issue 
was raised to cover, so it may make sense to file a separate issue to discuss 
the use cases for the custom astral handling.

Since astrals aren't actually errors in the first place, that could become:

handle_astrals(data, errors=strict)

As in pass every astral code point in this string through the named error 
handler.

The astral - surrogate pair and surrogate pair - astral converters do sound 
potentially interesting, but as noted above, I think they may call for a 
separate issue that better explains the specific use cases.

--

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



[issue23656] shutil.copyfile (or built-in open) releases sqlite3's transaction lock

2015-03-16 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
resolution:  - not a bug
stage:  - resolved

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



[issue23670] Modifications to support iOS as a cross-compilation target

2015-03-16 Thread R. David Murray

R. David Murray added the comment:

The Sauce labs option may render this obsolete, but to answer your question, 
Russell: our buildbot fleet is distributed in many people's offices, basements, 
and occasionally colo racks.  The buildbot needs to be on-line 24/7, but it 
calls out and does not need any inbound ports open.  See 
https://wiki.python.org/moin/BuildBot for the currently available documentation 
about setting up a buildbot for our fleet.

--

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



[issue23680] Sporadic freeze in test_interrupted_write_retry_text

2015-03-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

The system is rather slow (a shared VPS instance). In the trace you can SIGALRM 
is triggered before the first write() call (or so it seems).

--

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



[issue23680] Sporadic freeze in test_interrupted_write_retry_text

2015-03-16 Thread STINNER Victor

STINNER Victor added the comment:

2015-03-16 17:41 GMT+01:00 Antoine Pitrou rep...@bugs.python.org:
 Note that PIPE_MAX_SIZE can be large. Perhaps move the memory allocation 
 (i.e. `item * (support.PIPE_MAX_SIZE // len(item) + 1)`) before the alarm(1) 
 call?

Good idea, the first strace shows that SIGALRM was received while
Python was creating the large data.

I made this simple change. Can you tell me if my change fixes the issue?

 Or what if alarm_interrupt is simply set up to retrigger the signal?

It may make the test more reliable and I don't see how it can fix the
issue showed in the strace. Feel free to make the test more reliable
with such change if you want.

--

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



[issue23680] Sporadic freeze in test_interrupted_write_retry_text

2015-03-16 Thread STINNER Victor

STINNER Victor added the comment:

 Also, I think there another issue in that test. It uses `N = 
 support.PIPE_MAX_SIZE` but I think you want `N = support.PIPE_MAX_SIZE + 1` 
 if you want the raw write() to block.

PIPE_MAX_SIZE is much larger than the effictive size of a pipe on
Linux. It's defined as:

# A constant likely larger than the underlying OS pipe buffer size, to
# make writes blocking.
# Windows limit seems to be around 512 B, and many Unix kernels have a
# 64 KiB pipe buffer size or 16 * PAGE_SIZE: take a few megs to be sure.
# (see issue #17835 for a discussion of this number).
PIPE_MAX_SIZE = 4 * 1024 * 1024 + 1

I don't think that PIPE_MAX_SIZE+1 makes a difference here.

--

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



[issue23679] SSL Ciphers RC4

2015-03-16 Thread STINNER Victor

STINNER Victor added the comment:

You can explicitly disable RC4 if you create a SSLContext and then call 
set_ciphers() with the right list of ciphers. See for examples cipher lists of 
Python 2.7 (development branch):
https://hg.python.org/cpython/file/0b44c749ae51/Lib/ssl.py#l150

Add :!RC4 at the end of the cipher list to disable RC4.

OpenSSL cipher list format:
https://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT

--
nosy: +haypo

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



[issue23680] Sporadic freeze in test_interrupted_write_retry_text

2015-03-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Note that PIPE_MAX_SIZE can be large. Perhaps move the memory allocation (i.e. 
`item * (support.PIPE_MAX_SIZE // len(item) + 1)`) before the alarm(1) call?

Or what if alarm_interrupt is simply set up to retrigger the signal? e.g. 
instead of:

def alarm_interrupt(self, sig, frame):
1/0

write:

def alarm_interrupt(self, sig, frame):
signal.alarm(1)
1/0

--

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



[issue23680] Sporadic freeze in test_interrupted_write_retry_text

2015-03-16 Thread STINNER Victor

STINNER Victor added the comment:

 The system is rather slow (a shared VPS instance). In the trace you can 
 SIGALRM is triggered before the first write() call (or so it seems).

Yep. It remembers me my old idea to make sleep configurable in tests: issue 
#20910.

Most of the time, 1 second is enough. But on such very slow setup, it's 
annoying to get random failures because of race conditions. It would be better 
to use longer timeout (ex: 5 seconds), without making tests longer on other 
buildbots.

--

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



[issue23644] g++ module compile fails with ‘_Atomic’ does not name a type

2015-03-16 Thread Leonardo Bianconi

Leonardo Bianconi added the comment:

 #define _Atomic(T) std::atomicT
Does not work, since there are definitions like memory_order_relaxed that are 
in std.

I tested the other one, and it works fine:
#ifdef __cplusplus
extern C {
#if defined(HAVE_STD_ATOMIC)
using namespace std;
#endif
#endif

@haypo, what do you think?

--

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



[issue23679] SSL Ciphers RC4

2015-03-16 Thread Benjamin Peterson

Benjamin Peterson added the comment:

RC4 is dropped in the next releases.

--
dependencies: +SSL module should not offer RC4 based cipher suites for clients 
by default
nosy: +benjamin.peterson
resolution:  - duplicate
status: open - closed

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



[issue22852] urllib.parse wrongly strips empty #fragment

2015-03-16 Thread Demian Brecht

Demian Brecht added the comment:

I've done an initial pass in Rietveld and left some comments, mostly around 
docs. Here are some additional questions though:

Given has_* flags can be inferred during instantiation of *Result classes, is 
there a reason to have them writable, meaning is there a reason to add them to 
the __init__ methods?

I'd also like to see this logic moved out of _NetlocResultMixinBase. I'm 
assuming it was put there for backwards compatibility which is understandable, 
but I don't think it makes sense to add such logic to a mixin who's purpose is 
additional functionality around the netloc attribute. This one's a little more 
subjective though, but here's a rough idea of what I'm thinking:

SplitResult = namedtuple('SplitResult', 'scheme netloc path query fragment')
class _SplitResultBase(SplitResult):
def __new__(cls, scheme, netloc, path, query, fragment):
inst = super().__new__(cls, scheme, netloc, path, query, fragment)
inst.has_netloc = bool(netloc)
return inst

 s = urlsplit('http://example.com/foo/bar/')
 s.has_netloc
True

This keeps backwards compatibility, but also adds the additional logic to the 
bases rather than in the mixins. I might also split out the logic into helper 
functions in order to avoid duplication between _SplitResultBase and 
_ParseResultBase.

This method also avoids the dependency on ordering of base classes as well as 
the addition of a variadic signature to (Split|Parse)Result.__init__.

Thoughts?

--

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



[issue23680] Sporadic freeze in test_interrupted_write_retry_text

2015-03-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a18f7508649b by Victor Stinner in branch 'default':
Issue #23680: Reduce risk of race condition in check_interrupted_write_retry()
https://hg.python.org/cpython/rev/a18f7508649b

--
nosy: +python-dev

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



[issue23680] Sporadic freeze in test_interrupted_write_retry_text

2015-03-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Also, I think there another issue in that test. It uses `N = 
support.PIPE_MAX_SIZE` but I think you want `N = support.PIPE_MAX_SIZE + 1` if 
you want the raw write() to block.

There is another test that can have a race condition: check_interrupted_write().

--

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



[issue23678] imaplib status command cannot handle folder name containing whitespaces

2015-03-16 Thread R. David Murray

R. David Murray added the comment:

This is a duplicate of a subset of issue 917120.

--
nosy: +r.david.murray
resolution:  - duplicate
stage:  - resolved
status: open - closed
superseder:  - imaplib: incorrect quoting in commands

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



[issue917120] imaplib: incorrect quoting in commands

2015-03-16 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
nosy: +bjshan

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



[issue23624] str.center inconsistent with format ^

2015-03-16 Thread R. David Murray

R. David Murray added the comment:

Backward compatibility does not mean matches the docs, it means if we change 
this, someone's existing code is likely to break.  That does not prevent us 
from making at-the-margin changes in a feature release, but it is still a bar 
to be overcome in making such a change, and the consensus here is that it 
doesn't meet that bar.

Your primary argument seems to be the desire to make it easy to switch to 
center if the width of the field becomes a variable.  But you note yourself 
that you do not need to do this; format is quite capable of handing a variable 
width field.

So, there also does not seem to be sufficient motivation to add this feature.  
If you wish to pursue this further, posting your proposal for a keyword for 
center and the motivation to python-ideas would be the way to proceed.  If you 
gather a consensus of support there, you can propose a new enhancement request 
issue with a link to the python-ideas discussion.  (Or, in the unlikely case 
that the consensus is that center's algorithm should change, we can reopen this 
issue.)

--
nosy: +r.david.murray

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



[issue23668] Support os.[f]truncate on Windows

2015-03-16 Thread Steve Dower

Steve Dower added the comment:

It looks like mmap uses pure Win32 APIs for the Windows implementation, and so 
_chsize_s isn't necessary. There is a comment todo: need ... a 'chsize' 
analog in the file, but I'm not actually sure what that means.

I've made some minor changes from the review, but I had a question about 
possibly defining HAVE_[F]TRUNCATE in *.c rather than *.h. See the review, and 
I'll update the patch once we've figured that out.

--

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



[issue23680] Sporadic freeze in test_interrupted_write_retry_text

2015-03-16 Thread Antoine Pitrou

New submission from Antoine Pitrou:

Sometimes the test suite freezes in test_interrupted_write_retry_text 
(test.test_io.CSignalsTest). Corresponding strace is:


write(1, test_interrupted_write_retry_tex..., 66) = 66
rt_sigaction(SIGALRM, {0x00, [], SA_RESTORER, 0x7fd1ada2d0a0}, {SIG_DFL, 
[], SA_RESTORER, 0x7fd1ada2d0a0}, 8) = 0
pipe2([4, 5], O_CLOEXEC)= 0
rt_sigaction(SIGALRM, {0x00, [], SA_RESTORER, 0x7fd1ada2d0a0}, {0x00, 
[], SA_RESTORER, 0x7fd1ada2d0a0}, 8) = 0
fstat(5, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
fstat(5, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
ioctl(5, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fffd0944d40) = -1 EINVAL (Invalid 
argument)
lseek(5, 0, SEEK_CUR)   = -1 ESPIPE (Illegal seek)
lseek(5, 0, SEEK_CUR)   = -1 ESPIPE (Illegal seek)
alarm(1)= 0
brk(0x336)  = 0x336
--- SIGALRM (Alarm clock) @ 0 (0) ---
rt_sigreturn(0x2640030) = 53870592
write(5, ..., 4194305


A successful run looks like this:

write(1, test_interrupted_write_retry_tex..., 66) = 66
rt_sigaction(SIGALRM, {0x00, [], SA_RESTORER, 0x7fd1ada2d0a0}, {SIG_DFL, 
[], SA_RESTORER, 0x7fd1ada2d0a0}, 8) = 0
pipe2([4, 5], O_CLOEXEC)= 0
rt_sigaction(SIGALRM, {0x00, [], SA_RESTORER, 0x7fd1ada2d0a0}, {0x00, 
[], SA_RESTORER, 0x7fd1ada2d0a0}, 8) = 0
fstat(5, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
fstat(5, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
ioctl(5, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fffd0944d40) = -1 EINVAL (Invalid 
argument)
lseek(5, 0, SEEK_CUR)   = -1 ESPIPE (Illegal seek)
lseek(5, 0, SEEK_CUR)   = -1 ESPIPE (Illegal seek)
alarm(1)= 0
brk(0x2f6)  = 0x2f6
brk(0x336)  = 0x336
write(5, ..., 4194305) = 65536
--- SIGALRM (Alarm clock) @ 0 (0) ---
rt_sigreturn(0x2640030) = 65536
rt_sigaction(SIGALRM, {0x00, [], SA_RESTORER, 0x7fd1ada2d0a0}, {0x00, 
[], SA_RESTORER, 0x7fd1ada2d0a0}, 8) = 0
alarm(1)= 0
write(5, ..., 4128769) = ? ERESTARTSYS (To be 
restarted)
--- SIGALRM (Alarm clock) @ 0 (0) ---
rt_sigreturn(0x2640030) = -1 EINTR (Interrupted system call)
clone(child_stack=0x7fd1a8852ff0, 
flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SE
TTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x7fd1a88539d0, tls=0x7fd1a8853700, 
child_tidptr=0x7fd1a88539d0) = 3611
futex(0x24b5140, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
futex(0x9a1904, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1563, 
{1426520501, 20155000}, ) = 0
futex(0x9a1940, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
futex(0x9a1940, FUTEX_WAKE_PRIVATE, 1)  = 0
write(5, ..., 4128769) = 4128769
futex(0x9a1904, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x9a1900, {FUTEX_OP_SET, 0, 
FUTEX_OP_CMP_GT, 1}) = 1
futex(0x9a1940, FUTEX_WAKE_PRIVATE, 1)  = 1
futex(0x2631c50, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
close(5)= 0
close(4)= 0
rt_sigaction(SIGALRM, {SIG_DFL, [], SA_RESTORER, 0x7fd1ada2d0a0}, {0x00, 
[], SA_RESTORER, 0x7fd1ada2d0a0}, 8) = 0
write(1, ok\n, 3) = 3

--
messages: 238215
nosy: haypo, neologix, pitrou
priority: normal
severity: normal
status: open
title: Sporadic freeze in test_interrupted_write_retry_text
versions: Python 3.5

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



[issue23680] Sporadic freeze in test_interrupted_write_retry_text

2015-03-16 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
components: +Tests
type:  - behavior

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



[issue23680] Sporadic freeze in test_interrupted_write_retry_text

2015-03-16 Thread STINNER Victor

STINNER Victor added the comment:

The bug only occurs in Python 3.5, right?

 Sometimes the test suite freezes in test_interrupted_write_retry_text 
 (test.test_io.CSignalsTest).

How do you run the test suite? Is your system heavily loaded? Is it fast?

This is an obvious race condition in the test if SIGARLM is send before write() 
is called:

signal.alarm(1)
# Expected behaviour:
# - first raw write() is partial (because of the limited pipe buffer
#   and the first alarm)
# - second raw write() returns EINTR (because of the second alarm)
# - subsequent write()s are successful (either partial or complete)
self.assertEqual(N, wio.write(item * N))

1 second should be enough :-)

--

Or it is maybe a regression caused by the changeset 5b63010be19e of issue 
#23285 (PEP 475).

--

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



[issue23679] SSL Ciphers RC4

2015-03-16 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
nosy: +alex, dstufft

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



[issue23679] SSL Ciphers RC4

2015-03-16 Thread Alex Gaynor

Alex Gaynor added the comment:

I believe RC4 will still be used under 2.7.9 on clients, this is changed for 
2.7.10

--

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



[issue23679] SSL Ciphers RC4

2015-03-16 Thread mogli

mogli added the comment:

So it seems the docs are wrong.

--

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



[issue22931] cookies with square brackets in value

2015-03-16 Thread Mark Hughes

Mark Hughes added the comment:

We experimented with a version of the patch for 2.7.9. 

One issue we immediately noticed is that even though disallowed by the spec the 
use of commas in cookie values is widespread so we needed to add \, to the 
_LEGAL_VALUES_PATT.

--

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



[issue23680] Sporadic freeze in test_interrupted_write_retry_text

2015-03-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 10acab2d4a88 by Victor Stinner in branch 'default':
Issue #23680: Reduce risk of race condition in check_interrupted_write() of
https://hg.python.org/cpython/rev/10acab2d4a88

--

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



[issue23681] Have -b warn when directly comparing ints and bytes

2015-03-16 Thread Brett Cannon

Changes by Brett Cannon br...@python.org:


--
priority: deferred blocker - release blocker

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



[issue23681] Have -b warn when directly comparing ints and bytes

2015-03-16 Thread Brett Cannon

New submission from Brett Cannon:

To help writing Python 2/3 code the -b flag should switch on a warning when 
comparing an int to a bytes object in Python 2. This will help when someone 
writes something like `b'abcd'[2] == b'c'` and it always returns False thanks 
to the indexing returning 99 in Python 3.

--
assignee: brett.cannon
components: Interpreter Core
messages: 238228
nosy: brett.cannon
priority: normal
severity: normal
stage: test needed
status: open
title: Have -b warn when directly comparing ints and bytes
type: enhancement
versions: Python 2.7

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



[issue23679] SSL Ciphers RC4

2015-03-16 Thread Benjamin Peterson

Benjamin Peterson added the comment:

They're correct for the next release. :(

--

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



[issue23679] SSL Ciphers RC4

2015-03-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e1dfa5f0709f by Benjamin Peterson in branch '2.7':
versionchanged for rc4 removal (closes #23679)
https://hg.python.org/cpython/rev/e1dfa5f0709f

New changeset 2a6a63828a40 by Benjamin Peterson in branch '3.4':
versionchanged for rc4 removal (closes #23679)
https://hg.python.org/cpython/rev/2a6a63828a40

New changeset 87c102d0df39 by Benjamin Peterson in branch 'default':
merge 3.4 (#23679)
https://hg.python.org/cpython/rev/87c102d0df39

--
nosy: +python-dev
resolution:  - fixed
stage: needs patch - resolved
status: open - closed

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



[issue23673] IntEnum is unpicklable by previous Python versions

2015-03-16 Thread Ethan Furman

Ethan Furman added the comment:

Patch adds Enum._convert which is a class method that handles:

  - creating the new Enum
  - adding the appropriate members
  - adding the new Enum to the module's namespace (which is a passed parameter)
  - replacing the __reduce_ex__ method to return just the member's name

The change to Enum is:

@classmethod
def _convert(cls, name, module, filter, source=None):

Create a new Enum subclass that replaces a collection of global 
constants

# convert all constants from source (or module) that pass filter() to
# a new Enum called name, and export the enum and its members back to
# module;
# also, replace the __reduce_ex__ method so unpickling works in
# previous Python versions
module_globals = vars(sys.modules[module])
if source:
source = vars(source)
else:
source = module_globals
members = {name: value for name, value in source.items()
if filter(name)}
cls = cls(name, members, module=module)
cls.__reduce_ex__ = _reduce_ex_by_name
module_globals.update(cls.__members__)
module_globals[name] = cls
return cls

In use it looks like:

   IntEnum._convert(
'AddressFamily',
__name__,
lambda C: C.isupper() and C.startswith('AF_'))

or

  _IntEnum._convert(
'_SSLMethod', __name__,
lambda name: name.startswith('PROTOCOL_'),
source=_ssl)


ssl.py, socket.py, signal.py, and http/__init__.py have been updated to use 
this method.

--
keywords: +patch
stage: test needed - patch review
Added file: http://bugs.python.org/file38510/issue23673.stoneleaf.01.patch

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



[issue23681] Have -b warn when directly comparing ints and bytes

2015-03-16 Thread Brett Cannon

Changes by Brett Cannon br...@python.org:


--
priority: normal - deferred blocker

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



[issue23681] Have -b warn when directly comparing ints and bytes

2015-03-16 Thread Brett Cannon

Changes by Brett Cannon br...@python.org:


--
versions: +Python 3.5 -Python 2.7

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



[issue23681] Have -b warn when directly comparing ints and bytes

2015-03-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

6 tests failed:
test_buffer test_poplib test_quopri test_smtpd test_sunau
test_tokenize

And all of them look as bugs.

--
nosy: +serhiy.storchaka

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



[issue23679] SSL Ciphers RC4

2015-03-16 Thread R. David Murray

R. David Murray added the comment:

But the doc explicitly says 2.7.9, so no, they are not correct.  There also 
should be versionchanged directive, I think.

--
assignee:  - docs@python
components: +Documentation
dependencies:  -SSL module should not offer RC4 based cipher suites for clients 
by default
nosy: +docs@python, r.david.murray
stage:  - needs patch
status: closed - open
type: security - behavior

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



[issue23679] SSL Ciphers RC4

2015-03-16 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
resolution: duplicate - 

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



[issue23681] Have -b warn when directly comparing ints and bytes

2015-03-16 Thread Berker Peksag

Berker Peksag added the comment:

 [...] fixes existing bugs in the stdlib and tests.

These changes should probably be backported to 3.4.

--
nosy: +berker.peksag

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



[issue23682] distutils docs still talk about compatibility with Python 2.2

2015-03-16 Thread Berker Peksag

Berker Peksag added the comment:

Thanks Thomas!

--
resolution:  - fixed
stage: commit review - resolved
status: open - closed

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



[issue23682] distutils docs still talk about compatibility with Python 2.2

2015-03-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 910a7a540a31 by Berker Peksag in branch '3.4':
Issue #23682: Delete Python 2.2 mention from distutils documentation.
https://hg.python.org/cpython/rev/910a7a540a31

New changeset 7757e98a9f3b by Berker Peksag in branch 'default':
Issue #23682: Delete Python 2.2 mention from distutils documentation.
https://hg.python.org/cpython/rev/7757e98a9f3b

--
nosy: +python-dev

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



[issue22852] urllib.parse wrongly strips empty #fragment

2015-03-16 Thread Demian Brecht

Demian Brecht added the comment:

 I avoided making them positional parameters, as they are not part of the 
 underlying tuple object.

Ignore me, I was off my face and you're absolutely correct.

--

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



[issue23657] Don't do isinstance checks in zipapp

2015-03-16 Thread Paul Moore

Paul Moore added the comment:

Updated version of the patch with tests, plus doc update noting that path 
objects are explicitly supported.

--
Added file: http://bugs.python.org/file38513/duck_typed_zipapp.patch

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



[issue22852] urllib.parse wrongly strips empty #fragment

2015-03-16 Thread Martin Panter

Martin Panter added the comment:

## Inferring flags ##

The whole reason for the has_netloc etc flags is that I don’t think we can 
always infer their values, so we have to explicitly remember them. Consider the 
following two URLs, which I think should both have empty “netloc” strings for 
backwards compatibility, but should be handled differently by urlunsplit():

 urlsplit(evil.com).netloc
''
 urlsplit(evil.com).has_netloc
True
 urlunsplit(urlsplit(evil.com))  # Adds “//” back
'evil.com'
 urlsplit(/normal/path).netloc
''
 urlsplit(/normal/path).has_netloc
False
 urlunsplit(urlsplit(/normal/path))  # Does not add “//”
'/normal/path'

## _NetlocResultMixinBase abuse ##

The _NetlocResultMixinBase class is a common class used by the four result 
classes I’m interested in. I probably should rename it to something like 
_SplitParseMixinBase, since it is the common base to both urlsplit() and 
urlparse() results.

--

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



[issue17911] traceback: add a new thin class storing a traceback without storing local variables

2015-03-16 Thread Robert Collins

Robert Collins added the comment:

Regression fixed AFAICT, please re-open if not.

--
resolution:  - fixed
status: open - closed

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



[issue23682] distutils docs still talk about compatibility with Python 2.2

2015-03-16 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
assignee: docs@python - berker.peksag
stage:  - commit review

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



[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-03-16 Thread Martin Sekera

Martin Sekera added the comment:

In the end it doesn't matter what characters end up on the terminal. What 
matters is the UX of not having to press backspace several times to unindent. 
That's sloppy design.

The issue of forcing a custom indent width on a user who might have their tab 
stops setup differently is another, albeit smaller, issue. I think the 
interpreter has absolutely no reason to do what's basically UI work (aligning 
tabbed text with tab-stop columns as in the first patch). That's the terminal's 
job.

--

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



[issue23397] PEP 431 implementation

2015-03-16 Thread Lennart Regebro

Lennart Regebro added the comment:

FYI me and Berker started over here: https://bitbucket.org/regebro/cpython

--

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



[issue23644] g++ module compile fails with ‘_Atomic’ does not name a type

2015-03-16 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis added the comment:

So use std::memory_order_relaxed, std::memory_order_acquire etc.

--

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



[issue23676] Add support of UnicodeTranslateError in standard error handlers

2015-03-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Fixed a bug in surrogatepass with translating and added the versionchanged 
directive.

--
Added file: http://bugs.python.org/file38504/translate_error_handlers_2.patch

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



[issue23649] tarfile not re-entrant for multi-threading

2015-03-16 Thread Lars Gustäbel

Lars Gustäbel added the comment:

I agree with David that there is no need for tarfile to be thread-safe. There 
is nothing to be gained from distributing one TarFile object among multiple 
threads because it operates on a single resource which has to be accessed 
sequentially anyway. So, it seems best to me if we leave it like it is and let 
the user add locks around it as she/he sees fit.

--

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



[issue18814] Add codecs.convert_surrogateescape to clean surrogate escaped strings

2015-03-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Proposed preliminary patch adds three functions in the codecs module:

convert_surrogates(data, errors) -- handle lone surrogates with specified error 
handler.

 codecs.convert_surrogates('a\u20ac\udca4', 'backslashreplace')
'a€\\udca4'

convert_surrogateescape(data, errors) -- handle surrogateescaped bytes with 
specified error handler

 codecs.convert_surrogateescape('a\u20ac\udca4', 'backslashreplace')
'a€\\xa4'

convert_astrals(data, errors) -- handle astral (non-BMP) characters with 
specified error handler.

 codecs.convert_astral('a\u20ac\U000e007f', 'backslashreplace')
'a€\\U000e007f'

Names are discussable.

I think also about adding two functions or error handlers (that can used with 
convert_surrogates and convert_astrals) for composing astral characters from 
surrogate pairs and vice versa.

--
components: +Library (Lib)
versions: +Python 3.5 -Python 3.4

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



[issue23681] Have -b warn when directly comparing ints and bytes

2015-03-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch that adds required feature and fixes existing bugs in the 
stdlib and tests.

No one of failed tests was false positive.

--
keywords: +patch
stage: test needed - patch review
Added file: http://bugs.python.org/file38511/bytes_to_int_compare.patch

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



[issue23681] Have -b warn when directly comparing ints and bytes

2015-03-16 Thread Claudiu Popa

Changes by Claudiu Popa pcmantic...@gmail.com:


--
nosy: +Claudiu.Popa

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



[issue22625] When cross-compiling, don’t try to execute binaries

2015-03-16 Thread Ethan Furman

Changes by Ethan Furman et...@stoneleaf.us:


--
nosy: +ethan.furman

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



[issue23566] RFE: faulthandler.register() should support file descriptors

2015-03-16 Thread STINNER Victor

STINNER Victor added the comment:

I reviewed  issue23566_fd_tests.patch .

--

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



[issue18814] Add codecs.convert_surrogateescape to clean surrogate escaped strings

2015-03-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
keywords: +patch
Added file: http://bugs.python.org/file38506/codecs_convert_escapes.patch

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



[issue23571] Raise SystemError if a function returns a result with an exception set

2015-03-16 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
stage: commit review - resolved

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



[issue23668] Support os.[f]truncate on Windows

2015-03-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


Added file: http://bugs.python.org/file38505/23668_2.patch

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



[issue23668] Support os.[f]truncate on Windows

2015-03-16 Thread STINNER Victor

STINNER Victor added the comment:

I reviewed 23668_2.patch.

--

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



[issue23677] Mention dict and set comps in library reference

2015-03-16 Thread Frank Millman

New submission from Frank Millman:

This is from the documentation at Section 4.6.4. Lists


Lists may be constructed in several ways:

Using a pair of square brackets to denote the empty list: []
Using square brackets, separating items with commas: [a], [a, b, c]
Using a list comprehension: [x for x in iterable]
Using the type constructor: list() or list(iterable)


Comprehensions are mentioned as a constructor.

This is from the documentation at Section 4.10. Mapping Types


Dictionaries can be created by placing a comma-separated list of key: value 
pairs within braces, for example: {'jack': 4098, 'sjoerd': 4127} or {4098: 
'jack', 4127: 'sjoerd'}, or by the dict constructor.

class dict(**kwarg) 
class dict(mapping, **kwarg) 
class dict(iterable, **kwarg) 
Return a new dictionary initialized from an optional positional argument and a 
possibly empty set of keyword arguments.


There is no mention of dictionary comprehensions.

For consistency, I believe that the documentation for Dicts and Sets should 
mention comprehensions.

--
assignee: docs@python
components: Documentation
messages: 238186
nosy: FrankMillman, docs@python
priority: normal
severity: normal
status: open
title: Mention dict and set comps in library reference
versions: Python 3.4

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



[issue23649] tarfile not re-entrant for multi-threading

2015-03-16 Thread STINNER Victor

STINNER Victor added the comment:

Lars Gustäbel added the comment:
 I agree with David that there is no need for tarfile to be thread-safe. There 
 is nothing to be gained from distributing one TarFile object among multiple 
 threads because it operates on a single resource which has to be accessed 
 sequentially anyway. So, it seems best to me if we leave it like it is and 
 let the user add locks around it as she/he sees fit.

In asyncio, it was a design choice to not be thread-safe, to allow
more optimizations and support multiple implementations of asyncio,
without this important constraint.

I modified recently the asyncio doc to warn users in each class that
asyncio objects are *not* thread safe, with an explanation how to use
correctly asyncio with threads.

https://docs.python.org/dev/library/asyncio-eventloop.html#asyncio.BaseEventLoop
This class is not thread safe.

Such change in tarfile doc is probably enough for tarfile.

--

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



[issue23668] Support os.[f]truncate on Windows

2015-03-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

At first glance the patch looks good, but I did not test it. Are there tests 
for truncate() with large files ( 4 GiB)?

ftruncate() is used also im mmap.resize(). Do you want to provide a patch also 
for mmap?

--

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