[issue22560] Add loop-agnostic SSL implementation to asyncio

2015-01-02 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 Antoine, can you please elaborate the rationale of your patch?

The patch adds SSL support for proactor-based event loops (any event loop 
supporting plain sockets, actually, so it could also work for libuv etc.).

 Is the legacy code only used on Python 3.4 and older? Is ssl.MemoryBIO 
 always present in Python 3.5 and newer?

Yes and yes.

 I would like to see benchmarks of memory BIO vs current code on Linux and 
 Windows.

Do you have such benchmarks?

 Maybe we may only use memory BIO for the proactor event loop?

It sounds better to exercise the same code path under all platforms.

 Did you try your patch on Python 3.3?

No.

 How will this patch help to support STARTTLS?

Guido explained this one :-)

--

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



[issue23150] urllib parse incorrect handing of params

2015-01-02 Thread Julian Reschke

New submission from Julian Reschke:

urllib.parse tries to special-case params, which have been dropped from the 
general URI syntax back in RFC 2396 (16 years ago).

In most cases this can be worked around by reconstructing the path from both 
path and params; however this fails for paths that *end* in a semicolon 
(because it's not possible to distinguish an empty param from an absent param).

--
components: Library (Lib)
messages: 233312
nosy: julian.resc...@gmx.de
priority: normal
severity: normal
status: open
title: urllib parse incorrect handing of params
type: behavior

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



[issue23146] Incosistency in pathlib between / and \

2015-01-02 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

 pathlib.PureWindowsPath('c:/a/b', '/x/y')
PureWindowsPath('c:/x/y')
 pathlib.PureWindowsPath('//?/c:/a/b', '/x/y')
PureWindowsPath('/x/y')
 pathlib.PureWindowsPath(r'\\?\c:\a\b', '/x/y')
PureWindowsPath('//?/c:/x/y')

I suppose this is because in parse_parts() altsep is replaced with sep before 
calling self.splitroot() in main loop but not in other loop (if drv or root). 
Line 76.

--
components: Library (Lib)
messages: 233308
nosy: pitrou, serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: Incosistency in pathlib between / and \
type: behavior
versions: Python 3.4, Python 3.5

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



[issue23147] Possible error in _header_value_parser.py

2015-01-02 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

In UnstructuredTokenList._fold() at line 439 the fold() method is called with 
one positional argument.

if part.has_fws:
part.fold(folded)
continue

But there are no fold() methods with one positional parameter. May be it should 
be _fold()?

--
components: Library (Lib), email
messages: 233309
nosy: barry, r.david.murray, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Possible error in _header_value_parser.py
type: behavior
versions: Python 3.4, Python 3.5

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



[issue23148] Missing the charset parameter in as_encoded_word()

2015-01-02 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

In Lib/email/_header_value_parser.py:460 the as_encoded_word() method is called 
without mandatory argument charset.

--
components: Library (Lib), email
messages: 233310
nosy: barry, r.david.murray, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Missing the charset parameter in as_encoded_word()
type: behavior
versions: Python 3.4, Python 3.5

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



[issue23149] Typo in PEP-0008 - this PEP do not

2015-01-02 Thread Jonathan Sharpe

Changes by Jonathan Sharpe j.r.sharpe+pyt...@gmail.com:


--
assignee: docs@python
components: Documentation
files: fix_pep8_typo.patch
keywords: patch
nosy: docs@python, jonrsharpe
priority: normal
severity: normal
status: open
title: Typo in PEP-0008 - this PEP do not
type: enhancement
Added file: http://bugs.python.org/file37585/fix_pep8_typo.patch

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



[issue23149] Typo in PEP-0008 - this PEP do not

2015-01-02 Thread Barry A. Warsaw

Changes by Barry A. Warsaw ba...@python.org:


--
nosy: +barry

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



[issue1602] windows console doesn't print or input Unicode

2015-01-02 Thread Glenn Linderman

Glenn Linderman added the comment:

Just to note that another side effect of this bug is that stepping through code 
where the source contains non-ASCII characters results in pdb producing an 
error when trying to print the source lines. This makes stepping through such 
source code impossible.

I mention it, because it hasn't been mentioned before, and debuggers are 
mysterious and low-level enough, that solutions that might work for normal 
code, may not solve working with the debugger...

--

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



[issue21360] mailbox.Maildir should ignore files named with a leading dot

2015-01-02 Thread Vincent Davis

Changes by Vincent Davis vinc...@vincentdavis.com:


--
nosy: +Vincentdavis

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



[issue18983] Specify time unit for timeit CLI

2015-01-02 Thread Berker Peksag

Berker Peksag added the comment:

I've added a couple of comments on Rietveld.

--
nosy: +berker.peksag

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



[issue23151] _loggerClass is initialized twice

2015-01-02 Thread Vinay Sajip

Vinay Sajip added the comment:

The code in Manager.getLogger() allows an overriding logger class for that 
manager instance only - if it's not set (which is the default), it uses the 
module global _loggerClass. The lines

rv = (self.loggerClass or _loggerClass)(name)

indicate this.

The module global _loggerClass is initialized to None initially, simply so that 
it can be defined before being used in Manager (so really, for readability). 
Later, after Logger is defined, _loggerClass is set to Logger.

Is this causing some actual problem?

--

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



[issue23151] _loggerClass is initialized twice

2015-01-02 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

In Lib/logging/__init__.py at line 1089 _loggerClass is initialized to None. 
The code in Manager.getLogger() expects that it can be None. But at line 1549 
_loggerClass is initialized to Logger. And there is no official way to set it 
to None. Looks as either initialization to None and the code in 
Manager.getLogger() are redundant or initialization to Logger is redundant.

--
components: Library (Lib)
messages: 233313
nosy: serhiy.storchaka, vinay.sajip
priority: normal
severity: normal
status: open
title: _loggerClass is initialized twice

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



[issue4431] Distutils MSVC doesn't create manifest file

2015-01-02 Thread Steve Dower

Steve Dower added the comment:

It shouldn't be necessary for VS 2010 and later, and the 
`extra_link_args=['/MANIFEST']` workaround should be sufficient for cases where 
it is necessary (specific dependencies other than MSVCRT that require 
manifests).

--

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



[issue23149] Typo in PEP-0008 - this PEP do not

2015-01-02 Thread Roundup Robot

New submission from Roundup Robot:

New changeset 0c72bd524aed by Benjamin Peterson in branch 'default':
conjugate 'do' correctly (closes #23149)
https://hg.python.org/peps/rev/0c72bd524aed

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

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



[issue23058] argparse silently ignores arguments

2015-01-02 Thread Rémi Rampin

Rémi Rampin added the comment:

I might use your workaround in ReproZip 
(https://github.com/ViDA-NYU/reprozip/issues/89), thanks. I agree that it 
doesn't look pretty...

--

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



[issue23151] _loggerClass is initialized twice

2015-01-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 Is this causing some actual problem?

No, this does not cause actual problem except that it looks confusing. So 
really this decreased readability to me.

--

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



[issue23010] unclosed file warning when defining unused logging FileHandler in dictConfig

2015-01-02 Thread Vinay Sajip

Vinay Sajip added the comment:

Sorry I've not had much time to look at this yet. I haven't forgotten.

--

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



[issue4431] Distutils MSVC doesn't create manifest file

2015-01-02 Thread Steve Dower

Steve Dower added the comment:

And I suspect Matthew Brett's issue is that link_executable() does not expect 
an extension ('.exe') to be provided.

--

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



[issue23151] _loggerClass is initialized twice

2015-01-02 Thread Vinay Sajip

Vinay Sajip added the comment:

Okay, I'll see if I can make it clearer.

--

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



[issue4431] Distutils MSVC doesn't create manifest file

2015-01-02 Thread Steve Dower

Steve Dower added the comment:

/MANIFEST is probably assumed on VC9 since the CRT required it, but that was 
probably changed for VC10 without updating the documentation fully. Frankly I'd 
rather remove the MANIFESTFILE property added by distutils, since it doesn't 
add anything of value (on my test machine, it only requests an execution level 
of asInvoker, which is the default).

That way people can include useful manifests with their source if necessary and 
provide both the /MANIFEST and /MANIFESTFILE flags themselves, and we reduce 
the amount of code in the stdlib.

--

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



[issue23152] fstat64 required on Windows

2015-01-02 Thread Steve Dower

Steve Dower added the comment:

Looks like the easiest fix here is to remove the HAVE_SYS_STAT_H definition and 
replace it with the include directly:

/* Define to 1 if you have the sys/stat.h header file.  */
/* #define HAVE_SYS_STAT_H 1 */
#ifndef MS_WINCE
/* Rather than define HAVE_SYS_STAT_H, we include it now and
   rename two of the functions. The rename must be after the
   header is included. */
#include sys/stat.h
#define fstat _fstati64
#define stat _stati64
#endif


Does anyone know whether this sort of thing will cause problems with the build? 
It seems fine to me, but someone with more experience may know better.

--

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



[issue15933] flaky test in test_datetime

2015-01-02 Thread Vincent Davis

Vincent Davis added the comment:

Rather than dealing with the time delta how about getting the time twice and 
checking that we are between and at least once we have the same day.
i.e.

ts1 = time()
today = self.theclass.today()
ts2 = time()
todayagain1 = self.theclass.fromtimestamp(ts1)
todayagain2 = self.theclass.fromtimestamp(ts2)
#This would then cover all the cases could separate these cases, I dontsee the 
need for a loop.
self.assertTrue(today == todayagain1 or today == todayagain2 
or todayagain1 = today = todayagain1)

--
nosy: +Vincentdavis

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



[issue4431] Distutils MSVC doesn't create manifest file

2015-01-02 Thread Matthew Brett

Matthew Brett added the comment:

I think the argument previously was that VS 2010 was not the default compiler 
for Python 2.7, and so this problem was not important, but I'm happy to be 
corrected.

I haven't tried building extensions for Python 2.7 with VS 2010 but I guess the 
problem will be the same.

Can you see a problem with adding the /MANIFEST flag to 
distutils/msvc9compiler.py as a fix for this problem?

--

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



[issue23150] urllib parse incorrect handing of params

2015-01-02 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Hello Julian,

Can you please provide a test case of this parsing misbehavior? It might be 
easier to identify with the testcase. Better yet, the patch changing the 
parsing logic will help identify if we are dealing with any regression.

Thanks!

--
nosy: +orsenthil

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



[issue23152] fstat64 required on Windows

2015-01-02 Thread Steve Dower

Steve Dower added the comment:

Okay, I'll try and find a way to redefine it only under Windows. Unfortunately, 
the CRT defines fstat() as a function, which makes it hard to redefine without 
eagerly including sys/stat.h.

--

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



[issue23153] Clarify Boolean Clause Results

2015-01-02 Thread Ethan Furman

Ethan Furman added the comment:

`or` does not return the last item evaluated -- it returns the first truthy 
item, or, if no truthy items, the last false item:

  -- 0 or {}
  {}
  -- 0 or 1 or {}
  1

--
nosy: +ethan.furman

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



[issue20544] Use specific asserts in operator tests

2015-01-02 Thread Vincent Davis

Vincent Davis added the comment:

Looks like this is ready to be applied and closed or just closed.

--
nosy: +Vincentdavis

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



[issue18983] Specify time unit for timeit CLI

2015-01-02 Thread Vincent Davis

Vincent Davis added the comment:

Anything else need to be done on this patch?

--
nosy: +Vincentdavis

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



[issue23152] fstat64 required on Windows

2015-01-02 Thread Steve Dower

New submission from Steve Dower:

Currently test_largefile is failing on the Windows buildbots because an fstat() 
call in Modules/_io/fileio.c is failing. fstat() returns a 32-bit size, but the 
file being opened is larger than 2GB.

This appears to be a change in the CRT where it would previously succeed with 
an incorrect value but now returns an error. (While we're here, there is no 
exception set in this case, so you get SystemError: NULL result without error 
in PyObject_Call, but that's not the core issue.)

I can fix this instance, but I suspect we may need to fix this in multiple 
places. fstat64 (or _fstat64) seems to exist on multiple platforms, and the 
docs I found (e.g. http://linux.die.net/man/2/fstat64) suggest that EOVERFLOW 
is always going to occur in this case, so is there any reason not to switch to 
fstat64 everywhere? Maybe enable it through pyport.h/pyconfig.h and have a 
#define that is set based on availability?

--
components: IO
messages: 233327
nosy: benjamin.peterson, hynek, pitrou, steve.dower, stutzbach, tim.golden, 
zach.ware
priority: normal
severity: normal
status: open
title: fstat64 required on Windows
versions: Python 3.5

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



[issue23136] BUG in how _strptime() handles week 0

2015-01-02 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Note that round-trip also fails in weeks 52-53.  For example,

 datetime.strptime('2014 53 6', '%Y %W %w')
datetime.datetime(2015, 1, 10, 0, 0)
 datetime.strptime('2014 53 6', '%Y %W %w').strftime('%Y %W %w')
'2015 01 6'

If we decide to make 2015 0 0 invalid for format '%Y %W %w', we should 
probably invalidate the entire week 53 in 2014 for consistency.  However, I 
don't think there are any C implementations that would have a problem with such 
dates.

Overall, I am inclined to accept Jim's solution for 3.5, but I am not sure 
about the maintenance branches.

--

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



[issue23136] BUG in how _strptime() handles week 0

2015-01-02 Thread Jim Carroll

Jim Carroll added the comment:

All the proposed patches are acceptable from my point of view, but it would be 
really great if we could get the fix in the 2.x line.  It seems unlikely there 
could be any legacy code that would depend on the bug to exist (ie: to only be 
wrong when then date requested is exactly two days before the first date of the 
new year).

--

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



[issue19143] Finding the Windows version getting messier (detect windows 8.1?)

2015-01-02 Thread eryksun

eryksun added the comment:

 if (not version.GetFileVersionInfoW(name, None, size, ver_block) or
not ver_block):

Arrays don't implement __bool__ and have fixed __len__, so ver_block is always 
True. You could look at ver_block[0] or ver_block.value (i.e. the C string 
value).

--

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



[issue4431] Distutils MSVC doesn't create manifest file

2015-01-02 Thread Stephen Hansen

Stephen Hansen added the comment:

Just to be clear, I ran into this exact issue recently in VS2010 professional 
as I indicated earlier. I don't know about what should or should not be needed, 
but the solution in the original comment fixed it exactly for me.

--

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



[issue22128] patch: steer people away from codecs.open

2015-01-02 Thread Martin Panter

Martin Panter added the comment:

Just pointing out there is a patch for Issue 19548 for Python 3 which also adds 
a pointer to the builtin open() function and updates the codecs.open() caveats. 
That issue doesn’t touch Python 2 though.

--
nosy: +vadmium

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



[issue19143] Finding the Windows version getting messier (detect windows 8.1?)

2015-01-02 Thread Steve Dower

Steve Dower added the comment:

Thanks for the feedback. Updated the attachment with some other tidying too.

--
Added file: http://bugs.python.org/file37586/win32_ver.py

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



[issue19143] Finding the Windows version getting messier (detect windows 8.1?)

2015-01-02 Thread Steve Dower

Changes by Steve Dower steve.do...@microsoft.com:


Removed file: http://bugs.python.org/file37578/win32_ver.py

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



[issue12681] unittest expectedFailure could take a message argument like skip does

2015-01-02 Thread Robert Collins

Changes by Robert Collins robe...@robertcollins.net:


--
nosy: +rbcollins

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



[issue22231] httplib: unicode url will cause an ascii codec error when combined with a utf-8 string header

2015-01-02 Thread Demian Brecht

Demian Brecht added the comment:

A few notes:

1. Unicode hosts are not automatically IDNA-encoded (which they /could/ be 
rather than relying on the programmer to be aware of this), but this really has 
no bearing on this specific issue
2. Unicode paths are not automatically IRI-encoded (see 
https://tools.ietf.org/html/rfc3987#section-3), which should also likely be 
automatically handled when unicode objects are encountered as the path
3. When a single unicode element is contained within a list, string_join will 
defer to PyUnicode_Join.

The problem here is that your pre-joined request elements looks like this: 
[u'POST http://bugs.python.org/any_url HTTP/1.1', 'Host: bugs.python.org', 
'Accept-Encoding: identity', 'Content-Length: 44', 'notes: 
\xe5\x91\xb5\xe5\x91\xb5', 'Content-type: application/x-www-form-urlencoded', 
'Accept: text/plain', '', '']

Because there's a unicode object contained in the list at index 0, the entire 
list is converted to unicode, which results in the error when \xe5 is 
encountered by the ascii decoder.

The proposed solution won't work as unicode characters are legal (see RFC 3987) 
and will fail should anything outside of the ascii character set be present.

I think that the correct way to solve this issue is to automatically encode 
unicode paths (or IRIs) using urllib.quote, passing the reserved characters 
defined in RFC 3987 as the safe parameter:

 urllib.quote(u'/foo/呵/bar'.encode('utf-8'),':/?#[]@!$\'()*+,;=')
'/foo/%E5%91%B5/bar'

--

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



[issue23153] Clarify Boolean Clause Results

2015-01-02 Thread Josh Rosenberg

Josh Rosenberg added the comment:

A few questions/comments:

1. How would the reference clarify matters?

2. Most languages is perhaps overstating the matter. Lower level languages 
and strictly typed languages tend to return a boolean value, but many high 
level scripting languages (among them Perl, Python and JavaScript) return the 
last value evaluated.

3. Referencing the bool() constructor doesn't seem like it would add much, and 
might encourage the wrong behaviors; idiomatic Python rarely bothers to coerce 
to True/False because it's unnecessary extra work when an if or while condition 
can simply evaluate the truthiness of the value being tested without 
coercion. I kind of like the fact that it omits use of bool(), because down 
that road lies madness (if bool(a or b) == False: madness).

--
nosy: +josh.r

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



[issue23153] Clarify Boolean Clause Results

2015-01-02 Thread John Potelle

New submission from John Potelle:

From v3.4 Tutorial section 5.7

It is possible to assign the result of a comparison or other Boolean expression 
to a variable. For example,
 string1, string2, string3 = '', 'Trondheim', 'Hammer Dance'
 string1 or string2 or string3
'Trondheim'
 bool(string1 or string2 or string3)
True

In most languages a Boolean clause (comparison) returns a Boolean or it's 
equivalent, not the last argument evaluated.  Please add a reference to bool 
function (or some better? method) in this section for clarification.

--
assignee: docs@python
components: Documentation
messages: 20
nosy: docs@python, jpotelle
priority: normal
severity: normal
status: open
title: Clarify Boolean Clause Results
type: enhancement
versions: Python 3.4

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



[issue4431] Distutils MSVC doesn't create manifest file

2015-01-02 Thread Steve Dower

Steve Dower added the comment:

Sorry, I was focused on the fact that you don't need a manifest with VS 2010 
and not that distutils was forcing you to have one when building an executable.

Either adding '/MANIFEST' as in paxan's patch (according to 
http://msdn.microsoft.com/en-us/library/fft52235.aspx, you need to specify it 
if you specify '/MANIFESTNAME') or removing the MANIFESTNAME specification 
entirely should be fine for 3.4 and later. I assume since nobody has complained 
about 2.7 that everything works fine there?

--

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



[issue23152] fstat64 required on Windows

2015-01-02 Thread Josh Rosenberg

Josh Rosenberg added the comment:

I believe explicitly calling the 64 bit version of a function is usually 
frowned upon. At least on *NIX systems, the standard solution is to define 
-D_FILE_OFFSET_BITS=64 during the build process, so off_t seamlessly becomes a 
64 bit value, and the 64 bit version of appropriate functions is called and 
linked (fstat64, mmap64, etc.).

--
nosy: +josh.r

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



[issue4431] Distutils MSVC doesn't create manifest file

2015-01-02 Thread Matthew Brett

Matthew Brett added the comment:

Steve - did you try my 'setup.py' example; it's standalone, as in `python 
setup.py build` will reproduce the error.

This is specifically VS 2010.

It doesn't make any difference for me if I specify an extension or not, so I 
don't think that is the problem.

--

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



[issue23152] fstat64 required on Windows

2015-01-02 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Josh is right, we would only need to use fstat64() under Windows here. fstat() 
under POSIX defines st_size as a off_t, which should usually be large enough 
even on modern 32-bit systems.

--

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



[issue23152] fstat64 required on Windows

2015-01-02 Thread Josh Rosenberg

Josh Rosenberg added the comment:

Ugh. Looking into it further, POSIX systems tend to support 
_FILE_OFFSET_BITS=64, but Windows isn't POSIX-y enough. So Windows might need 
to be special cased regardless. Blech.

--

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



[issue23127] socket.setsockopt() is still broken for multicast TTL and Loop options

2015-01-02 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Application code should pass the correct length of value.

--
resolution:  - wont fix
status: open - closed

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



[issue23137] Python 2.7.9 test_gdb fails on CentOS 7

2015-01-02 Thread Vinson Lee

New submission from Vinson Lee:

Python 2.7.9 test_gdb fails on CentOS 7.

$./python Lib/test/regrtest.py -v test_gdb
== CPython 2.7.9 (default, Dec 22 2014, 10:54:52) [GCC 4.8.2 20140120 (Red Hat 
4.8.2-16)]
==   Linux-3.10.0-123.13.2.el7.x86_64-x86_64-with-centos-7.0.1406-Core 
little-endian
==   Python-2.7.9/build/test_python_16739
Testing with flags: sys.flags(debug=0, py3k_warning=0, division_warning=0, 
division_new=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, 
no_user_site=0, no_site=0, ignore_environment=0, tabcheck=0, verbose=0, 
unicode=0, bytes_warning=0, hash_randomization=0)
[1/1] test_gdb
test_NULL_instance_dict (test.test_gdb.PrettyPrintTests)
Ensure that a PyInstanceObject with with a NULL in_dict is handled ... FAIL
test_NULL_ob_type (test.test_gdb.PrettyPrintTests)
Ensure that a PyObject* with NULL ob_type is handled gracefully ... FAIL
test_NULL_ptr (test.test_gdb.PrettyPrintTests)
Ensure that a NULL PyObject* is handled gracefully ... FAIL
test_builtin_function (test.test_gdb.PrettyPrintTests) ... FAIL
test_builtin_method (test.test_gdb.PrettyPrintTests) ... FAIL
test_builtins_help (test.test_gdb.PrettyPrintTests)
Ensure that the new-style class _Helper in site.py can be handled ... FAIL
test_classic_class (test.test_gdb.PrettyPrintTests)
Verify the pretty-printing of classic class instances ... FAIL
test_corrupt_ob_type (test.test_gdb.PrettyPrintTests)
Ensure that a PyObject* with a corrupt ob_type is handled gracefully ... FAIL
test_corrupt_tp_flags (test.test_gdb.PrettyPrintTests)
Ensure that a PyObject* with a type with corrupt tp_flags is handled ... FAIL
test_corrupt_tp_name (test.test_gdb.PrettyPrintTests)
Ensure that a PyObject* with a type with corrupt tp_name is handled ... FAIL
test_dicts (test.test_gdb.PrettyPrintTests)
Verify the pretty-printing of dictionaries ... FAIL
test_exceptions (test.test_gdb.PrettyPrintTests) ... FAIL
test_frames (test.test_gdb.PrettyPrintTests) ... ok
test_frozensets (test.test_gdb.PrettyPrintTests)
Verify the pretty-printing of frozensets ... FAIL
test_getting_backtrace (test.test_gdb.PrettyPrintTests) ... ok
test_int (test.test_gdb.PrettyPrintTests)
Verify the pretty-printing of various int values ... FAIL
test_lists (test.test_gdb.PrettyPrintTests)
Verify the pretty-printing of lists ... FAIL
test_long (test.test_gdb.PrettyPrintTests)
Verify the pretty-printing of various long values ... FAIL
test_modern_class (test.test_gdb.PrettyPrintTests)
Verify the pretty-printing of new-style class instances ... FAIL
test_selfreferential_dict (test.test_gdb.PrettyPrintTests)
Ensure that a reference loop involving a dict doesn't lead proxyval ... FAIL
test_selfreferential_list (test.test_gdb.PrettyPrintTests)
Ensure that a reference loop involving a list doesn't lead proxyval ... FAIL
test_selfreferential_new_style_instance (test.test_gdb.PrettyPrintTests) ... 
FAIL
test_selfreferential_old_style_instance (test.test_gdb.PrettyPrintTests) ... 
FAIL
test_sets (test.test_gdb.PrettyPrintTests)
Verify the pretty-printing of sets ... FAIL
test_singletons (test.test_gdb.PrettyPrintTests)
Verify the pretty-printing of True, False and None ... FAIL
test_strings (test.test_gdb.PrettyPrintTests)
Verify the pretty-printing of strings ... FAIL
test_subclassing_list (test.test_gdb.PrettyPrintTests)
Verify the pretty-printing of an instance of a list subclass ... FAIL
test_subclassing_tuple (test.test_gdb.PrettyPrintTests)
Verify the pretty-printing of an instance of a tuple subclass ... FAIL
test_truncation (test.test_gdb.PrettyPrintTests)
Verify that very long output is truncated ... FAIL
test_tuples (test.test_gdb.PrettyPrintTests)
Verify the pretty-printing of tuples ... FAIL
test_unicode (test.test_gdb.PrettyPrintTests)
Verify the pretty-printing of unicode values ... FAIL
test_basic_command (test.test_gdb.PyListTests)
Verify that the py-list command works ... skipped 'Python was compiled with 
optimizations'
test_one_abs_arg (test.test_gdb.PyListTests)
Verify the py-list command with one absolute argument ... skipped 'Python was 
compiled with optimizations'
test_two_abs_args (test.test_gdb.PyListTests)
Verify the py-list command with two absolute arguments ... skipped 'Python 
was compiled with optimizations'
test_down_at_bottom (test.test_gdb.StackNavigationTests)
Verify handling of py-down at the bottom of the stack ... ok
test_pyup_command (test.test_gdb.StackNavigationTests)
Verify that the py-up command works ... skipped 'Python was compiled with 
optimizations'
test_up_at_top (test.test_gdb.StackNavigationTests)
Verify handling of py-up at the top of the stack ... ok
test_up_then_down (test.test_gdb.StackNavigationTests)
Verify py-up followed by py-down ... skipped 'Python was compiled with 
optimizations'
test_basic_command (test.test_gdb.PyBtTests)
Verify that the py-bt command works ... skipped 'Python was compiled with 
optimizations'
test_basic_command (test.test_gdb.PyPrintTests)
Verify that the py-print command works ... skipped