[issue25324] Importing tokenize modifies token

2015-10-06 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Importing the tokenize modifies the content of the token module.

>>> import token
>>> len(token.tok_name)
59
>>> import tokenize
>>> len(token.tok_name)
61

Such side effect looks as bad design to me. Either token.tok_name should 
contain elements needed for tokenize, or tokenize should not modify 
token.tok_name.

--
components: Library (Lib)
messages: 252397
nosy: georg.brandl, meador.inge, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Importing tokenize modifies token
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue25324] Importing tokenize modifies token

2015-10-06 Thread STINNER Victor

STINNER Victor added the comment:

I agree :-) Do you want to work on a patch?

--
nosy: +haypo

___
Python tracker 

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



[issue25157] Installing Python 3.5.0 32bit on Windows 8.1 64bit system gives Error 0x80240017

2015-10-06 Thread Laura Creighton

Laura Creighton added the comment:

Got another log of an Error 0x802400

This is a windows 7 user reporting it to webmaster.

--
Added file: http://bugs.python.org/file40699/bad_win7_install_log.txt

___
Python tracker 

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



[issue23972] Asyncio reuseport

2015-10-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset aebbf205ef6f by Guido van Rossum in branch '3.4':
Issue #23972: Fix tests for Windows and Debian.
https://hg.python.org/cpython/rev/aebbf205ef6f

New changeset 4d643c5df2a5 by Guido van Rossum in branch '3.5':
Issue #23972: Fix tests for Windows and Debian. (Merge 3.4->3.5)
https://hg.python.org/cpython/rev/4d643c5df2a5

New changeset 3e2218a4e629 by Guido van Rossum in branch 'default':
Issue #23972: Fix tests for Windows and Debian. (Merge 3.5->3.6)
https://hg.python.org/cpython/rev/3e2218a4e629

--

___
Python tracker 

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



[issue25330] Two issues with pkgutil.get_data

2015-10-06 Thread Antony Lee

New submission from Antony Lee:

The docs of pkgutil.get_data say "The resource argument should be in the form 
of a relative filename, using / as the path separator. The parent directory 
name .. is not allowed, and nor is a rooted name (starting with a /)."

In fact (on Python 3.5 at least):
* pkgutil.get_data("logging", "/__init__.py") works, but simply chops off the 
first slash, returning the contents of the stdlib's logging/__init__.py.
* pkgutil.get_data("logging", "../re.py") works, returning the contents of the 
stdlib's re.py.

People who actually thought about the implications of get_data/zipimport/etc. 
can decide whether to remove this functionality or to update the docs, I'm just 
reporting it.

Also, it would be nice if get_data gained a "text mode" (i.e. returning str 
instead of bytes and with support for universal newlines).

--
components: Library (Lib)
messages: 252450
nosy: Antony.Lee
priority: normal
severity: normal
status: open
title: Two issues with pkgutil.get_data
versions: Python 3.6

___
Python tracker 

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



[issue25294] Absolute imports fail in some cases where relative imports would work

2015-10-06 Thread Nick Coghlan

Nick Coghlan added the comment:

We seem to be talking past each other, so let's take a step back and ensure we 
have a common understanding of the absolute/relative terminology:

"import x.y.z" is an absolute import
"from x.y import z" is still an absolute import.
"from . import z" is an explicit relative import of a child or sibling module
"from .y import z" is also an explicit relative import

The relevant change in behaviour is between the "import x.y.z" form and the 
"from x.y import z" form due to the change in the way the related name binding 
(and name lookup in 3.5+) works, not between absolute and relative imports.

The relevant terminology to distinguish between "from ... import ..." vs 
"import ..." is just "from import" vs "non-from import", and there are 
definitely cases where from imports will work, but non-from imports will fail. 
That's not a style issue, it's a use-whichever-one-works for your code issue.

--

___
Python tracker 

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



[issue25294] Absolute imports fail in some cases where relative imports would work

2015-10-06 Thread Nick Coghlan

Nick Coghlan added the comment:

(Oops, it seems Brett already clarified the terminology. My apologies for the 
noise).

Modularity and module design is hard. It's one of the hardest problems in 
software engineering, which is why folks invent entire new vocabularies to 
attempt to describe the problem space effectively: http://connascence.io/

The simplest way to avoid these kinds of import related problems as a beginner 
in Python is to just put all your code in one module, and only factor it out 
into multiple modules when the single file becomes difficult to maintain.

Unfortunately, Java's "one public class per file" restriction, it's lack of 
standalone module level functions, and it's popularity as a university level 
teaching level has given a lot of people a lot of bad ideas as to what good 
multi-level modularity looks like, as Java throws out the notion of using 
modules to group closely related public classes and standalone functions into a 
single file, and instead makes you jump almost directly from classes to 
packages.

So perhaps that's the currently unwritten rule that would be worth documenting? 
That Python has 3 levels of namespacing (classes, modules, packages), and that 
flat namespaces are preferred in the standard library. If the namespace is 
broken up internally into multiple files for maintainability reasons, we prefer 
to still present a flat *public* API, as unittest, asyncio and 
concurrent.futures do.

--

___
Python tracker 

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



[issue25325] UTF-16LE, UTF-16BE, UTF-32LE, and UTF-32BE encodings don't add/remove BOM on encode/decode

2015-10-06 Thread R. David Murray

Changes by R. David Murray :


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

___
Python tracker 

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



[issue25325] UTF-16LE, UTF-16BE, UTF-32LE, and UTF-32BE encodings don't add/remove BOM on encode/decode

2015-10-06 Thread Daniel Blanchard

Daniel Blanchard added the comment:

Thanks for straightening me out there! I had not noticed this in the Unicode 
FAQ before:

>  Where the data has an associated type, such as a field in a database, a BOM 
> is unnecessary. In particular, if a text data stream is marked as UTF-16BE, 
> UTF-16LE, UTF-32BE or UTF-32LE, a BOM is neither necessary nor permitted. Any 
> U+FEFF would be interpreted as a ZWNBSP.

Anyway, the thing that brought this up is that in chardet we detect codecs of 
files for people and we've been returning UTF-16BE or UTF-16LE when we detect 
the BOM at the front of the file, but we recently learned that if people tried 
to decode with those codecs things don't work as expected.  It seems the 
correct behavior in our case is to just return UTF-16 in these cases.

--

___
Python tracker 

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



[issue8256] input() doesn't catch _PyUnicode_AsString() exception; io.StringIO().encoding is None

2015-10-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch.

--
stage: needs patch -> patch review
Added file: http://bugs.python.org/file40704/input_fallback.patch

___
Python tracker 

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



[issue8256] input() doesn't catch _PyUnicode_AsString() exception; io.StringIO().encoding is None

2015-10-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I would fallback to PyFile_WriteObject(prompt, fout, Py_PRINT_RAW) if the 
stdout has no the encoding attribute or it is not a string.

--
nosy: +serhiy.storchaka
versions: +Python 3.4, Python 3.5, Python 3.6 -Python 3.2, Python 3.3

___
Python tracker 

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



[issue25327] Windows 10 Installation Fails With Corrupt Directory Error

2015-10-06 Thread Max Farrell

New submission from Max Farrell:

Cannot install Python 3.5 64-bit on Windows 10 64-bit Educational Edition.

I have Python 3.4 Installed.

Log include.

--
components: Installation
files: Python 3.5.0 (64-bit)_20151006150920.log
messages: 252423
nosy: Max Farrell
priority: normal
severity: normal
status: open
title: Windows 10 Installation Fails With Corrupt Directory Error
type: compile error
versions: Python 3.5
Added file: http://bugs.python.org/file40705/Python 3.5.0 
(64-bit)_20151006150920.log

___
Python tracker 

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



[issue25327] Python 3.5 Windows 10 Installation Fails With Corrupt Directory Error

2015-10-06 Thread eryksun

Changes by eryksun :


Removed file: http://bugs.python.org/file40706/Python 3.5.0 
(64-bit)_20151006150920.log

___
Python tracker 

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



[issue12346] Python source code build fails with old mercurial

2015-10-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
status: open -> pending

___
Python tracker 

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



[issue25228] Regression in cookie parsing with brackets and quotes

2015-10-06 Thread Tim Graham

Tim Graham added the comment:

I had already proposed a test, see cookie-bracket-quotes-test.diff. What I 
meant was that the fix and the test should be combined into a single patch.

--

___
Python tracker 

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



[issue24821] The optimization of string search can cause pessimization

2015-10-06 Thread Adam

Changes by Adam :


--
nosy: +azsorkin

___
Python tracker 

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



[issue25325] UTF-16LE, UTF-16BE, UTF-32LE, and UTF-32BE encodings don't add/remove BOM on encode/decode

2015-10-06 Thread eryksun

eryksun added the comment:

Yes, if you explicitly use big-ending or little-endian UTF, then you need to 
manually include a BOM if that's required. That said, if a file format or data 
field is specified with a particular byte order, then using a BOM is strictly 
incorrect. See the UTF BOM FAQ:

http://www.unicode.org/faq/utf_bom.html#BOM

For regular text documents, in which the byte order doesn't really matter, use 
the native byte order of your platform via UTF-16 or UTF-32. Also, instead of 
manually encoding strings, use the "encoding" parameter of the built-in open 
function, or io.open or codecs.open in Python 2. This only writes a single BOM, 
even when writing to a file multiple times.

--
nosy: +eryksun
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue25327] Python 3.5 Windows 10 Installation Fails With Corrupt Directory Error

2015-10-06 Thread Max Farrell

Max Farrell added the comment:

Windows 10 64-Bit Educational Edition.
Python 3.5 64-bit Installation failed. Directory is corrupt.
Log included.

--
title: Windows 10 Installation Fails With Corrupt Directory Error -> Python 3.5 
Windows 10 Installation Fails With Corrupt Directory Error
Added file: http://bugs.python.org/file40706/Python 3.5.0 
(64-bit)_20151006150920.log

___
Python tracker 

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



[issue25327] Python 3.5 Windows 10 Installation Fails With Corrupt Directory Error

2015-10-06 Thread eryksun

Changes by eryksun :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue25325] UTF-16LE, UTF-16BE, UTF-32LE, and UTF-32BE encodings don't add/remove BOM on encode/decode

2015-10-06 Thread R. David Murray

R. David Murray added the comment:

eryksun beat me to the answer, but I'm going to post mine anyway :)

If I understand the codecs docs correctly, this is because if you are 
specifying the endianess you want, it is a sign that you are only going to 
interpret it as that endianness, so there's no need for a BOM.  If you want a 
BOM, use utf-16/32.

In short, what is your use case for producing a UTF string with non-native byte 
order?  But as eryksun said, the Python supported way to do that and include a 
BOM is to write the BOM yourself.

--
nosy: +lemburg, r.david.murray -eryksun
resolution: not a bug -> 
stage: resolved -> 
status: closed -> open

___
Python tracker 

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



[issue25314] Documentation: argparse's actions store_{true, false} default to False/True (undocumented)

2015-10-06 Thread paul j3

paul j3 added the comment:

I have seen questions on StackOverflow with 'store_true' and explicit 
`default=False` parameters.  I don't recall any where this was a problem.  
Usually it's as harmless as users specifying other defaults like 
`action='store'`, or a dest that echos a long option, etc.

But if we are going to fix the wrong default statement in `store_const`, we 
might as well clarify this case as well.

I wonder if this is the time and place to add a note that specifying 'type' is 
not necessary (and even wrong) - re. this closed issue: 
http://bugs.python.org/issue24754 

Is the line  'These are special cases of ``'store_const'``' useful?   The 
statement echos the class definition

class _StoreTrueAction(_StoreConstAction)

but I'm not sure it adds much to the user's understanding.  'store_true' and 
'store_false' are used frequently; 'store_const' is much less common (based on 
SO questions).

--
nosy: +paul.j3

___
Python tracker 

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



[issue25097] test_logging may fail with 'Access is denied' when pywin32 is installed

2015-10-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4e7697ccceeb by Zachary Ware in branch '3.4':
Issue #25097: fix Windows error number access
https://hg.python.org/cpython/rev/4e7697ccceeb

New changeset 440d4da352fa by Zachary Ware in branch '3.5':
Issue #25097: Merge with 3.4
https://hg.python.org/cpython/rev/440d4da352fa

New changeset d91f9fc7b85d by Zachary Ware in branch 'default':
Issue #25097: Merge with 3.5
https://hg.python.org/cpython/rev/d91f9fc7b85d

--

___
Python tracker 

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



[issue25097] test_logging may fail with 'Access is denied' when pywin32 is installed

2015-10-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 03a569eb0e0e by Zachary Ware in branch '3.4':
Issue #25097: Re-raise any other pywin32 error
https://hg.python.org/cpython/rev/03a569eb0e0e

New changeset 95a26798819b by Zachary Ware in branch '3.5':
Issue #25097: Merge with 3.4
https://hg.python.org/cpython/rev/95a26798819b

New changeset db782c81bba9 by Zachary Ware in branch 'default':
Issue #25097: Merge with 3.5
https://hg.python.org/cpython/rev/db782c81bba9

--

___
Python tracker 

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



[issue25329] test_json crashes with stack overflow on Windows

2015-10-06 Thread Zachary Ware

New submission from Zachary Ware:

See for example:

http://buildbot.python.org/all/builders/AMD64%20Windows8.1%20Non-Debug%203.4/builds/224

Possibly related to #25222.

--
components: Tests, Windows
messages: 252432
nosy: ezio.melotti, haypo, paul.moore, pitrou, rhettinger, steve.dower, 
tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: test_json crashes with stack overflow on Windows
type: behavior
versions: Python 3.4

___
Python tracker 

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



[issue25097] test_logging may fail with 'Access is denied' when pywin32 is installed

2015-10-06 Thread Zachary Ware

Zachary Ware added the comment:

Turned out that your change didn't quite do it, but it was just the method you 
used to try to access the errno (which looks like it ought to work from the 
formatting of the error message).

Mere moments after pushing the fix for that, I realized that the new try/except 
was silently swallowing any other win32 errors that weren't permission errors, 
so that's the second batch of commits from me.

--

___
Python tracker 

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



[issue25327] Python 3.5 Windows 10 Installation Fails With Corrupt Directory Error

2015-10-06 Thread Steve Dower

Steve Dower added the comment:

Looks like you need to download the installer again (clear your internet cache 
first to avoid getting the same corrupted file).

--
type: compile error -> 

___
Python tracker 

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



[issue25328] ValueError in smtpd.py __init__() is not raised

2015-10-06 Thread Barry A. Warsaw

New submission from Barry A. Warsaw:

In Python 3.5, SMTPChannel.__init__() ensures that enable_SMTPUTF8 and 
decode_data arguments are not both true.  This even seems to be tested in 
test_smtpd.py.  But it's clearly bogus because the exception is never raised!  
It just creates and throws away the exception instance.

--
messages: 252426
nosy: barry, r.david.murray
priority: normal
severity: normal
status: open
title: ValueError in smtpd.py __init__() is not raised
versions: Python 3.5, Python 3.6

___
Python tracker 

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



[issue22906] PEP 479: Change StopIteration handling inside generators

2015-10-06 Thread John

John added the comment:

Consider the following generator function similar to the one that started this 
issue:

from __future__ import generator_stop

def myzip(*seqs):
its = (iter(seq) for seq in seqs)
while True:
try:
yield tuple(next(it) for it in its)
except RuntimeError:
return

g = myzip('abc', 'xyz')
print([next(g) for i in range(5)]) # prints: [('a', 'x'), (), (), (), ()]

A print(list(g)) would cause a hang.

--
nosy: +john.black.3k

___
Python tracker 

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



[issue25329] test_json crashes with stack overflow on Windows

2015-10-06 Thread Zachary Ware

Zachary Ware added the comment:

Note that this is not a consistent failure, see for example build 223[1] where 
test_json passes.  I've noticed that the sooner test_json starts, the more 
likely it is to pass (it's the 28th test in 223, 117th in 224).

[1] 
http://buildbot.python.org/all/builders/AMD64%20Windows8.1%20Non-Debug%203.4/builds/223

--

___
Python tracker 

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



[issue25325] UTF-16LE, UTF-16BE, UTF-32LE, and UTF-32BE encodings don't add/remove BOM on encode/decode

2015-10-06 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

Just to add some more background:

The LE and BE codecs are meant to be used when you already know the endianness 
of the platform you are targeting, e.g. in case you work on strings that were 
read after the initial BOM, or write to an output string in chunks after having 
written the initial BOM. As such, they don't treat the BOM special, since it is 
a valid code point, and pass it through as-is.

If you do want BOM handling, the UTF-16 codec is the right choice. It defaults 
to the platform's endianness and uses the BOM to indicate which choice it made.

--

___
Python tracker 

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



[issue25308] Multiple names can target the same namespace

2015-10-06 Thread paul j3

paul j3 added the comment:

What you are asking about is the fact that different arguments can share a 
'dest'.

https://docs.python.org/3/library/argparse.html#dest

The 'append_const' action has an example of shared 'dest'.  It says:

The 'append_const' action is typically useful when multiple
arguments need to store constants to the same list. 

I've suggested 'dest' sharing in some SO questions.

Shared 'dest' may be a nuisance in the case of regular 'store' actions, since 
only the last value is retained.  But that also happens if a user repeats an 
argument.  Usually errors like this become apparent during development testing, 
and can be easily fixed with changes to the 'dest' parameter.

The 'conflict handler' mechanism does prevent conflicts in the option strings.  
But it does not check the 'dest'.  In fact the parser does not maintain a list 
or dictionary of 'dest'.  It looks that up on the Actions as needed.

A simple function that would collect actions by 'dest' could use:

 dd = collections.defaultdict(list)
 for a in parser._actions:
 dd[a.dest].append(a)

Or the developer could collect their own list of Actions.  So it is easy to 
test for repeated 'dest', but I don't think it is generally needed or useful.

Custom Action classes can also be used to test for repeat assignments to a 
given 'dest' (objecting, for example, if the existing value in the Namespace is 
not the default).

--
nosy: +paul.j3

___
Python tracker 

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



[issue23972] Asyncio reuseport

2015-10-06 Thread chris laws

chris laws added the comment:

This patch contains minor updates to resolve the Buildbot issues observed on 
the Windows and Debian platforms after the initial #23972 change set was 
committed.

--
Added file: http://bugs.python.org/file40696/23972_cjl_v006.patch

___
Python tracker 

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



[issue21295] Python 3.4 gives wrong col_offset for Call nodes returned from ast.parse

2015-10-06 Thread Radek Novacek

Radek Novacek added the comment:

There is still problem with col_offset is some situations, for example 
col_offset of the ast.Attribute should be 4 but is 0 instead:

>>> for x in ast.walk(ast.parse('foo.bar')):
... if hasattr(x, 'col_offset'):
... print("%s: %d" % (x, x.col_offset))
... 
<_ast.Expr object at 0x7fcdc84722b0>: 0
<_ast.Attribute object at 0x7fcdc84723c8>: 0
<_ast.Name object at 0x7fcdc8472438>: 0

Is there any solution to this problem? It causes problems in python support in 
KDevelop (kdev-python).

--

___
Python tracker 

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



[issue21295] Python 3.4 gives wrong col_offset for Call nodes returned from ast.parse

2015-10-06 Thread Aivar Annamaa

Aivar Annamaa added the comment:

Radek, the source corresponding to Attribute node does start at col 0 in your 
example

--

___
Python tracker 

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



[issue25325] UTF-16LE, UTF-16BE, UTF-32LE, and UTF-32BE encodings don't add/remove BOM on encode/decode

2015-10-06 Thread R. David Murray

Changes by R. David Murray :


--
stage:  -> resolved

___
Python tracker 

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



[issue22865] Document how to make pty.spawn not copy data

2015-10-06 Thread Martin Panter

Martin Panter added the comment:

If you return null bytes, they will be written to the parent process’s stdout 
file descriptor, rather than being ignored. I do not think it is possible to 
ignore output with the spawn() API, unless perhaps you previously set up stdout 
write to /dev/null or similar.

Do you have a reference for your fact about terminals ignoring null input 
bytes? I’m skeptical because a basic serial terminal can send arbitrary data 
including nulls, but I am not so familiar with pseudo-terminals.

However the bit about interpreting an empty string could be useful. I would 
drop the “or any falsey value”; is that a typo? I suspect that the functions 
have to return byte strings (not text). It would be nice to say what the 
consequences of the EOF condition is, e.g. I can see for the child’s output it 
would stop copying, but not actually close the parent’s stdout to signal EOF. 
What about in the other direction? Can you signal multiple EOFs with data in 
between?

--
nosy: +martin.panter
stage:  -> patch review
versions:  -Python 3.2, Python 3.3

___
Python tracker 

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



[issue25321] Null Dereference "subname" in zipimport.c

2015-10-06 Thread Benjamin Peterson

Changes by Benjamin Peterson :


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

___
Python tracker 

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



[issue25323] Bus error: 10 when executing recursive program

2015-10-06 Thread Benjamin Peterson

Changes by Benjamin Peterson :


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

___
Python tracker 

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



[issue17824] pty.spawn handles errors improperly

2015-10-06 Thread Martin Panter

Martin Panter added the comment:

The spawn() function has this code outside of any error handler:

pid, master_fd = fork()
if pid == CHILD:
os.execlp(argv[0], *argv)

If fork() succeeds, there will actually be a parent Python process and a child 
Python process. If exec() then fails, an exception will escape the spawn() 
function in the child process, while the parent process will carry on as if all 
is well. Maybe it would be worthwhile studying how the “subprocess” module 
handles exec() failure in the child process.

--
nosy: +martin.panter
stage:  -> needs patch

___
Python tracker 

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



[issue22865] Document how to make pty.spawn not copy data

2015-10-06 Thread Geoff Shannon

Geoff Shannon added the comment:

Hmm, I spoke improperly.  I think you are entirely correct in your statements.  
What I meant by "terminals ignore null bytes" is that returning a string 
consisting of only a null byte doesn't cause anything observable to happen, 
including anything to be written to the screen.  But I have no idea why this is.

My basis for this is limited to empirical observation of how my terminal 
behaves (I use the iTerm2 terminal emulator on Mac OS X), and I don't recall 
whether I checked it with other terminals like the regular terminal on Mac and 
terminal emulators on Linux.

Re: "or any falsey value".  In general, the _read_ functions should return byte 
strings yes, but since the check for EOF in python is whether a stream returned 
an empty string, and the way that pty.spawn() currently checks for that is `if 
not data` then any falsey value will cause pty.spawn to think that the 
underlying fd was closed.

I agree that the documentation on this could use more fleshing out in general, 
especially regarding what happens when certain values are returned.  I'm not 
very familiar with this code any more, but I might have time to play with it 
and try to add some more information in the coming weeks.

--

___
Python tracker 

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



[issue24806] Inheriting from NoneType does not fail consistently

2015-10-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c46ccfac8763 by Benjamin Peterson in branch '2.7':
prevent unacceptable bases from becoming bases through multiple inheritance 
(#24806)
https://hg.python.org/cpython/rev/c46ccfac8763

New changeset e670b37e7b14 by Benjamin Peterson in branch '3.4':
prevent unacceptable bases from becoming bases through multiple inheritance 
(#24806)
https://hg.python.org/cpython/rev/e670b37e7b14

New changeset e02e4afcce6a by Benjamin Peterson in branch '3.5':
merge 3.4 (#24806)
https://hg.python.org/cpython/rev/e02e4afcce6a

New changeset 4b2a2688d2ad by Benjamin Peterson in branch 'default':
merge 3.5 (closes #24806)
https://hg.python.org/cpython/rev/4b2a2688d2ad

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

___
Python tracker 

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



[issue25308] Multiple names can target the same namespace

2015-10-06 Thread Benjamin Peterson

Changes by Benjamin Peterson :


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

___
Python tracker 

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



[issue12346] Python source code build fails with old mercurial

2015-10-06 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
resolution:  -> fixed
status: pending -> closed

___
Python tracker 

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



[issue25322] contextlib.suppress not tested for nested usage

2015-10-06 Thread Raymond Hettinger

Raymond Hettinger added the comment:

That patch looks correct.

--
nosy: +rhettinger

___
Python tracker 

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



[issue24954] No way to generate or parse timezone as produced by datetime.isoformat()

2015-10-06 Thread Martin Panter

Martin Panter added the comment:

Okay I am happy to be wrong about Python allowing seconds resolution.

I notice that Issue 12006 was committed, which adds a second table of 
Python-only codes for ISO 8601 values. The proposed entries here could be 
incorporated into that table, and the text above it modified to suit. That 
would solve my C89 library problem.

--

___
Python tracker 

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



[issue25313] IDLE: gracefully handle themes (or keysets, or ...) not present

2015-10-06 Thread Mark Roseman

Mark Roseman added the comment:

Okay, that's reasonable enough for me.  :-) I'd still be for nuking the warning 
so that nothing gets displayed unless you go looking in online help.

--

___
Python tracker 

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



[issue14576] IDLE: inconsistent use of HOMEDRIVE, HOMEPATH, and USERPROFILE on Windows

2015-10-06 Thread Mark Roseman

Changes by Mark Roseman :


--
nosy: +markroseman

___
Python tracker 

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



[issue25322] contextlib.suppress not tested for nested usage

2015-10-06 Thread R. David Murray

R. David Murray added the comment:

Looks good to me.  I hope I never see anything like that in real code, though :)

--

___
Python tracker 

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



[issue22906] PEP 479: Change StopIteration handling inside generators

2015-10-06 Thread John

John added the comment:

Please ignore my previous comment - now I understood what is going on. The 
`its` generator is a one-shot iterator so is exhausted the first time the while 
loop is run. Therefore, on subsequent loops, only empty tuples are yielded.

Still learning about generators... :)

--

___
Python tracker 

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



[issue25322] contextlib.suppress not tested for nested usage

2015-10-06 Thread Frazer McLean

New submission from Frazer McLean:

In Lib/test/test_contextlib.py, there is a bug in the nested usage part of the 
following function:

def test_cm_is_reentrant(self): 
ignore_exceptions = suppress(Exception) 
with ignore_exceptions: 
pass 
with ignore_exceptions: 
len(5) 
with ignore_exceptions: 
1/0 
with ignore_exceptions: # Check nested usage 
len(5)

Specifically, the final 2 lines aren't reached since the exception raised by 
1/0 exits the context manager.

--
components: Tests
messages: 252382
nosy: RazerM, ncoghlan, yselivanov
priority: normal
severity: normal
status: open
title: contextlib.suppress not tested for nested usage
type: behavior
versions: Python 3.4, Python 3.5

___
Python tracker 

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



[issue24402] input() uses sys.__stdout__ instead of sys.stdout for prompt

2015-10-06 Thread Martin Panter

Martin Panter added the comment:

Patch itself looks good.

--
nosy: +martin.panter
stage: needs patch -> patch review

___
Python tracker 

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



[issue8256] input() doesn't catch _PyUnicode_AsString() exception; io.StringIO().encoding is None

2015-10-06 Thread Martin Panter

Martin Panter added the comment:

Serhiy, your patch looks like a worthwhile improvement because it adds proper 
error checking and handling. However I suspect this original bug is actually a 
side effect of Issue 24402. The code in question shouldn’t even be running, 
because sys.stdout is not the original output file descriptor, and is not a 
terminal.

--
dependencies: +input() uses sys.__stdout__ instead of sys.stdout for prompt
nosy: +martin.panter

___
Python tracker 

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



[issue25322] contextlib.suppress not tested for nested usage

2015-10-06 Thread Martin Panter

Martin Panter added the comment:

My suggested fix would look like:

with ignore_exceptions:
with ignore_exceptions:  # Check nested usage 
len(5)
ignored = True
1/0
self.assertTrue(ignored)

--
nosy: +martin.panter

___
Python tracker 

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



[issue25324] Importing tokenize modifies token

2015-10-06 Thread Martin Panter

Martin Panter added the comment:

I would fix this by making tokenize.tok_name a copy. It looks like this 
behaviour dates back to 1997 (see revision 1efc4273fdb7).

--
nosy: +martin.panter

___
Python tracker 

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



[issue22726] Idle: add help to config dialogs

2015-10-06 Thread Mark Roseman

Mark Roseman added the comment:

I'm not against online help, but I feel that what's there wouldn't be helpful 
to someone using IDLE. 

Once this would be extended to per-tab, what are the problem areas that people 
really need help with?  Also keeping in mind we're going to be replacing this 
dialog (at least for people with tk > 8.4) in the not too distant future.

--

___
Python tracker 

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



[issue12006] strptime should implement %G, %V and %u directives

2015-10-06 Thread Erik Cederstrand

Erik Cederstrand added the comment:

I have reviewed the latest patch, and it looks good to me. There are tests for 
the tricky conversions around Jan 1, and the docs are brief and succinct. Until 
the full set of new c99 strftime directives are supported, I think it's 
overkill to include a lecture about the origin of these new directives and 
their support in the underlying OS.

There are a number of foot-shooting possibilities when parsing date strings 
with the directives supported by strptime(), but at least this patch does not 
make it worse. It validates the input nicely when using the new directives and 
prints useful error messages it input is ambiguous.

I'm not a committer, but I approve of the patch as-is.

--

___
Python tracker 

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



[issue21295] Python 3.4 gives wrong col_offset for Call nodes returned from ast.parse

2015-10-06 Thread Radek Novacek

Radek Novacek added the comment:

Aivar, I have to admit that my knowledge of this is limited, but as I 
understand it, the attribute is "bar" in the "foo.bar" expression.

I can get beginning of the assignment by 
>>> ast.parse('foo.bar').body[0].value.value.col_offset
0

But how can I get position of the 'bar'? My guess is this:
>>> ast.parse('foo.bar').body[0].value.col_offset
but it still returns 0.

Why this two col_offsets returns the same value? How can I get the position of 
'bar' in 'foo.bar'?

--

___
Python tracker 

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



[issue25323] Bus error: 10 when executing recursive program

2015-10-06 Thread Radosław Ejsmont

New submission from Radosław Ejsmont:

When I execute a recursive deep tree reconstruction algorithm (depth ~2) I 
am hitting a bus error 10. I have modified the recursion limit accordingly 
(sys.setrecursionlimit(2)).

I am running python 2.7.10 on OS X 10.11.

The code I am running is here: 
https://github.com/rejsmont/nuclearP/blob/master/src/Compact.py

Function that fails is nfill()

Code runs fine on linux python 2.7.3 or 2.7.9

--
components: Macintosh
messages: 252385
nosy: Radosław Ejsmont, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: Bus error: 10 when executing recursive program
type: crash
versions: Python 2.7

___
Python tracker 

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



[issue21295] Python 3.4 gives wrong col_offset for Call nodes returned from ast.parse

2015-10-06 Thread Aivar Annamaa

Aivar Annamaa added the comment:

ast.Attribute node actually means "the atribute of something", ie. the node 
includes this "something" as subnode. 

> How can I get the position of 'bar' in 'foo.bar'?

I don't know a good way for this, because bar is not an AST node for Python. If 
Python AST nodes included the information about where a node ends in source, I 
would take the ending col of node.value (foo in your example), and added 2. 

In my own program (http://thonny.cs.ut.ee, it's a Python IDE for beginners) I'm 
using a really contrived algorithm for determining the end positions of nodes. 
See function mark_text_ranges here: 
https://bitbucket.org/plas/thonny/src/b8860704c99d47760ffacfaa335d2f8772721ba4/thonny/ast_utils.py?at=master=file-view-default

I'm not happy with my solution, but I don't know any other ways.

--

___
Python tracker 

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



[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2015-10-06 Thread Florin Papa

Florin Papa added the comment:

Hi all,

I added LDFLAGS_NODIST in order to avoid distutils problems. Please see the 
updated patches.

Thank you,
Florin

--
type: enhancement -> security
Added file: http://bugs.python.org/file40697/mpx_enable_3_6_v3.patch

___
Python tracker 

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



[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2015-10-06 Thread Florin Papa

Changes by Florin Papa :


Added file: http://bugs.python.org/file40698/mpx_enable_2_7_v3.patch

___
Python tracker 

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



[issue25322] contextlib.suppress not tested for nested usage

2015-10-06 Thread R. David Murray

R. David Murray added the comment:

Oh, I didn't read your message carefully enough. But that makes this bug report 
even more ironic.

--

___
Python tracker 

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



[issue25323] Bus error: 10 when executing recursive program

2015-10-06 Thread Mark Dickinson

Mark Dickinson added the comment:

> You may have to enlarge the C stack

The following might work (e.g., in bash shell)

ulimit -s 6

Here the count is in KiB, so that's setting a stack size of about 58.6 MiB.  
There appears to be a system-wide limit of close to 64 MiB, so pushing past 
that could be hard.

Regardless, this isn't really a Python bug: the recursion limit is a safeguard 
that's there precisely to stop you from running into a hard crash.  If you 
remove that safeguard (especially without increasing your process stack size), 
you shouldn't be surprised to get a crash.

As Victor says, you probably need to rework your algorithm.

Suggest closing as "wont fix".

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue25323] Bus error: 10 when executing recursive program

2015-10-06 Thread eryksun

eryksun added the comment:

I don't know about OS X, but in 64-bit Linux I can increase the recursion limit 
to 10 if I allow the main thread to grow to 64 MiB by setting the 
RLIMIT_STACK soft limit. For example:

soft, hard = resource.getrlimit(resource.RLIMIT_STACK)
soft = max(soft, 64 << 20)
if hard != resource.RLIM_INFINITY:
soft = min(soft, hard)
resource.setrlimit(resource.RLIMIT_STACK, (soft, hard))

Alternatively it also works to use a worker thread with a fixed 64 MiB stack 
size, set as follows:

old_size = threading.stack_size(64 << 20)
# create worker thread
threading.stack_size(old_size)

--
nosy: +eryksun

___
Python tracker 

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



[issue23543] encoding error trying to save string to file

2015-10-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Indeed, the name that looks as ASCII actually contains non-ASCII characters.

>>> print(ascii('LKC.6558‐100‐HD‐P‐101_C.xlsx\n'))
'LKC.6558\u2010100\u2010HD\u2010P\u2010101_C.xlsx\n'

Martin suggests correct solution.

--
nosy: +serhiy.storchaka
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type: crash -> behavior

___
Python tracker 

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



[issue25323] Bus error: 10 when executing recursive program

2015-10-06 Thread STINNER Victor

STINNER Victor added the comment:

Well, Python tries to protect you against stack overflow, but the protection is 
not perfect. You may have to enlarge the C stack, but I don't know how.

Workaround: try to rewrite your algorithm to use a lower recursion depth.

--
nosy: +haypo

___
Python tracker 

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



[issue25322] contextlib.suppress not tested for nested usage

2015-10-06 Thread R. David Murray

R. David Murray added the comment:

Hah.  I predicted this thing was going to attract bug reports :)

The behavior you observe is how context managers in general and this one in 
particular work.  I'll let Nick explain it, since he wrote it.  Maybe there is 
an doc improvement that would help.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue25322] contextlib.suppress not tested for nested usage

2015-10-06 Thread Frazer McLean

Frazer McLean added the comment:

I may not have been clear—I understand how context managers work with 
exceptions.

I'm just pointing out that the nested context manager isn't called, so those 
final two lines aren't testing anything, right?

--

___
Python tracker 

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



[issue25317] Convert test_tokenize to unittests

2015-10-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue25317] Convert test_tokenize to unittests

2015-10-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7b2af8ee6dfa by Serhiy Storchaka in branch '2.7':
Issue #25317: Converted doctests in test_tokenize to unittests.
https://hg.python.org/cpython/rev/7b2af8ee6dfa

New changeset d272f3cbae05 by Serhiy Storchaka in branch '3.4':
Issue #25317: Converted doctests in test_tokenize to unittests.
https://hg.python.org/cpython/rev/d272f3cbae05

New changeset bff40616d2a5 by Serhiy Storchaka in branch '3.5':
Issue #25317: Converted doctests in test_tokenize to unittests.
https://hg.python.org/cpython/rev/bff40616d2a5

New changeset 66d239660997 by Serhiy Storchaka in branch 'default':
Issue #25317: Converted doctests in test_tokenize to unittests.
https://hg.python.org/cpython/rev/66d239660997

--
nosy: +python-dev

___
Python tracker 

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



[issue25228] Regression in cookie parsing with brackets and quotes

2015-10-06 Thread Pathangi Jatinshravan

Pathangi Jatinshravan added the comment:

Hi I have made a patch for this, can anyone review and let me know?

--
versions:  -Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file40700/patch.diff

___
Python tracker 

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



[issue25157] Installing Python 3.5.0 32bit on Windows 8.1 64bit system gives Error 0x80240017

2015-10-06 Thread Steve Dower

Steve Dower added the comment:

The new log looks like Win7 SP1 is needed.

I suspect in the original case there was some other update that was required as 
well, but I don't know what it was. The prerequisites are the latest service 
packs for Win7/WinS2K8 and earlier, and 
https://support.microsoft.com/en-us/kb/2919355 for Win8 and later (found on 
https://support.microsoft.com/en-us/kb/2999226).

I'll see if I can easily detect these requirements in setup. I need to add 
detection for WinXP anyway, so these are a logical extension.

--
assignee:  -> steve.dower

___
Python tracker 

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



[issue25326] Improve error message for "character buffer objects"

2015-10-06 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Another alternative
---

TypeError: expected a string or other character buffer object

--

___
Python tracker 

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



[issue13535] Improved two's complement arithmetic support: to_signed() and to_unsigned()

2015-10-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I'm for closing this issue. This is not the common operation.

--
nosy: +serhiy.storchaka
status: open -> pending

___
Python tracker 

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



[issue14126] Speed up list comprehensions by preallocating the list where possible

2015-10-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
status: open -> pending
versions: +Python 3.6 -Python 3.3

___
Python tracker 

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



[issue25228] Regression in cookie parsing with brackets and quotes

2015-10-06 Thread Pathangi Jatinshravan

Pathangi Jatinshravan added the comment:

Hi Tim, I have submitted a patch for this issue (patch_final.diff, the earlier 
one failed a UT). Now all UTs are passing. Can you take a look at this?

--
Added file: http://bugs.python.org/file40701/patch_final.diff

___
Python tracker 

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



[issue12006] strptime should implement %G, %V and %u directives

2015-10-06 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

I've committed the latest patch.  Thank you Ashley and Erik for your work and 
perseverance.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue25326] Improve error message for "character buffer objects"

2015-10-06 Thread Raymond Hettinger

New submission from Raymond Hettinger:

Python 2.7.10+ (2.7:fc6d62db8d42+, Oct  6 2015, 11:55:10) 
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.72)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> s = 'the tale of two cities'
>>> s.count(('a', 'z'))
Traceback (most recent call last):
  File "", line 1, in 
TypeError: expected a character buffer object (such as a string)

   new text -^^^

--

___
Python tracker 

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



[issue25157] Installing Python 3.5.0 32bit on Windows 8.1 64bit system gives Error 0x80240017

2015-10-06 Thread Shirshendu Bhowmick

Shirshendu Bhowmick added the comment:

I have tried downloading and installing the updates from Microsoft, but the 
system said that the updates are already installed.

--

___
Python tracker 

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



[issue25228] Regression in cookie parsing with brackets and quotes

2015-10-06 Thread Tim Graham

Tim Graham added the comment:

Could you please integrate my unit test into your patch?

You also need to sign the PSF Contributor Agreement:
https://www.python.org/psf/contrib/contrib-form/

--

___
Python tracker 

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



[issue25228] Regression in cookie parsing with brackets and quotes

2015-10-06 Thread Pathangi Jatinshravan

Pathangi Jatinshravan added the comment:

Oops, sorry looks like a unit test is failing. I will fix it and submit another 
one soon.

--

___
Python tracker 

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



[issue25157] Installing Python 3.5.0 32bit on Windows 8.1 64bit system gives Error 0x80240017

2015-10-06 Thread Steve Dower

Steve Dower added the comment:

Do you still get the same error from the Python installer?

--

___
Python tracker 

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



[issue25324] Importing tokenize modifies token

2015-10-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I left the decision for modules maintainers.

--

___
Python tracker 

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



[issue13348] test_unicode_file fails: shutil.copy2 says "same file"

2015-10-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
status: open -> pending

___
Python tracker 

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



[issue25157] Installing Python 3.5.0 32bit on Windows 8.1 64bit system gives Error 0x80240017

2015-10-06 Thread eryksun

eryksun added the comment:

Error code WU_E_NOT_APPLICABLE (0x80240017) just tells us that "there are no 
applicable updates". Perhaps the Windows Update log has more information. 

Shirshendu, try directly installing the [Universal CRT update][1] from the 
command prompt. Run it with the /log option, e.g.

Windows8.1-KB2999226-x64.msu /log:kb2999226.evtx

You can view this log in the Windows event viewer, or convert it to text XML on 
the command line as follows:

wevtutil qe kb2999226.evtx /lf:true /f:XML /e:MSULog > kb2999226.xml

If the update fails, please attach the XML log to this issue. 

[1]: http://www.microsoft.com/en-us/download/details.aspx?id=48234

--
nosy: +eryksun

___
Python tracker 

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



[issue12006] strptime should implement %G, %V and %u directives

2015-10-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset acdebfbfbdcf by Alexander Belopolsky in branch 'default':
Closes issue #12006: Add ISO 8601 year, week, and day directives to strptime.
https://hg.python.org/cpython/rev/acdebfbfbdcf

--
nosy: +python-dev

___
Python tracker 

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



[issue25157] Installing Python 3.5.0 32bit on Windows 8.1 64bit system gives Error 0x80240017

2015-10-06 Thread Shirshendu Bhowmick

Shirshendu Bhowmick added the comment:

Yes still the same error, even i have tried on a different system with 
different configurations running Windows 8.1 there is also i faced the same 
error.

--

___
Python tracker 

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



[issue25325] UTF-16LE, UTF-16BE, UTF-32LE, and UTF-32BE encodings don't add/remove BOM on encode/decode

2015-10-06 Thread Daniel Blanchard

New submission from Daniel Blanchard:

As I recently discovered when someone filed a PR on chardet (see 
https://github.com/chardet/chardet/issues/70), BOMs are handled are not handled 
correctly by the endian-specific encodings UTF-16LE, UTF-16BE, UTF-32LE, and 
UTF-32BE, but are by the UTF-16 and UTF-32 encodings.

For example:

>>> 'foo'.encode('utf-16le')
b'f\x00o\x00o\x00'
>>> 'foo'.encode('utf-16')
b'\xff\xfef\x00o\x00o\x00'

You can see that when using UTF-16 (instead of UTF-16LE), you get the BOM 
correctly prepended to the bytes.

If you were on a little endian system and purposefully wanted to create a 
UTF-16BE file, the only way to do it is:

>>> codecs.BOM_UTF16_BE + 'foo'.encode('utf-16be')
b'\xfe\xff\x00f\x00o\x00o'

This doesn't make a lot of sense to me.  Why is the BOM not prepended 
automatically when encoding with UTF-16BE?

Furthermore, if you were given a UTF-16BE file on a little endian system, you 
might think that this would be the correct way to decode it:

>>> (codecs.BOM_UTF16_BE + 'foo'.encode('utf-16be')).decode('utf-16be')
'\ufefffoo'

but as you can see that leaves the BOM on there.  Strangely, decoding with 
UTF-16 works fine however:

>>> (codecs.BOM_UTF16_BE + 'foo'.encode('utf-16be')).decode('utf-16')
'foo'

It seems to me that the endian-specific versions of UTF-16 and UTF-32 should be 
adding/removing the appropriate BOMs, and this is a long-standing bug.

--
components: Unicode
messages: 252406
nosy: Daniel.Blanchard, ezio.melotti, haypo
priority: normal
severity: normal
status: open
title: UTF-16LE, UTF-16BE, UTF-32LE, and UTF-32BE encodings don't add/remove 
BOM on encode/decode
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue25326] Improve error message for "character buffer objects"

2015-10-06 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
components: Interpreter Core
files: better_error_message.diff
keywords: patch
nosy: rhettinger
priority: normal
severity: normal
stage: patch review
status: open
title: Improve error message for "character buffer objects"
versions: Python 2.7
Added file: http://bugs.python.org/file40702/better_error_message.diff

___
Python tracker 

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



[issue25228] Regression in cookie parsing with brackets and quotes

2015-10-06 Thread Pathangi Jatinshravan

Pathangi Jatinshravan added the comment:

Added a patch where unit test has been modified to include the above case. I 
have signed the agreement.

--
Added file: http://bugs.python.org/file40703/patch_unittest.diff

___
Python tracker 

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