[issue22526] file iteration SystemError for huge lines (2GiB+)

2014-10-05 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue22555] Tracking issue for adjustments to binary/text boundary handling

2014-10-05 Thread Martin Panter

Changes by Martin Panter vadmium...@gmail.com:


--
nosy: +vadmium

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



[issue22555] Tracking issue for adjustments to binary/text boundary handling

2014-10-05 Thread Nick Coghlan

Nick Coghlan added the comment:

Assigning to myself, since there's nothing specifically to *do* for this bug, 
it's just to make it easier to track the status of the various other RFEs it 
depends on.

--
assignee:  - ncoghlan
type:  - enhancement

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



[issue22546] Wrong default precision in documentation for format

2014-10-05 Thread Mark Dickinson

Mark Dickinson added the comment:

Terry: your rewrite looks fine to me.  +1 for committing that.

--

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



[issue22556] datetime comparison with 'None' returning a TypeError

2014-10-05 Thread Ankit Dhebar

New submission from Ankit Dhebar:

code snippet
student_tuple = [ ('ykjsdf', 'A', 17, datetime.date(2014,10,15)), ('accjr', 
'C', 11, datetime.date(2013,05,05)), ('dgekw', 'B', 5, 
datetime.date(1987,03,03)) ]

Output for the above code works as expected.
o/p : [('dgekw', 'B', 5, datetime.date(1987, 3, 3)), ('accjr', 'C', 11, 
datetime.date(2013, 5, 5)), ('ykjsdf', 'A', 17, datetime.date(2014, 10, 15))]

but when you make one of the above datetime.date as 'None' like below

student_tuple = [ ('ykjsdf', 'A', 17, datetime.date(2014,10,15)), ('accjr', 
'C', 11, None), ('dgekw', 'B', 5, datetime.date(1987,03,03)) ]
 
o/p : TypeError: can't compare datetime.date to NoneType

In my opinion, the 'NoneType' should appear either in the beginning or towards 
the end after sorting is done.

--
components: Tests
files: sorting_func.py
messages: 228543
nosy: pythoner
priority: normal
severity: normal
status: open
title: datetime comparison with 'None' returning a TypeError
type: compile error
versions: Python 2.7
Added file: http://bugs.python.org/file36809/sorting_func.py

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



[issue22486] Add math.gcd()

2014-10-05 Thread Stefan Behnel

Stefan Behnel added the comment:

Any objections to merging the last patch?

--

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



[issue22486] Add math.gcd()

2014-10-05 Thread Mark Dickinson

Mark Dickinson added the comment:

 Any objections to merging the last patch?

Yes!  Please don't make these changes to `Fractions.gcd`: they'll cause 
regressions for existing uses of `Fractions.gcd` with objects not of type `int`.

--

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



[issue22486] Add math.gcd()

2014-10-05 Thread Stefan Behnel

Stefan Behnel added the comment:

There are not such changes in patch 7. The fractions.gcd() function is 
unchanged but no longer used by the Fraction type, which now uses math.gcd() 
internally instead.

--

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



[issue22486] Add math.gcd()

2014-10-05 Thread Mark Dickinson

Mark Dickinson added the comment:

Ah, I misread;  thanks.

What happens with this patch if a Fraction has been created with Integrals that 
aren't of type int?  (E.g., with NumPy int32 instances, for example?)

--

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



[issue22486] Add math.gcd()

2014-10-05 Thread STINNER Victor

STINNER Victor added the comment:

Why patching fraction.Fraction constructor instead of fractions.gcd()?

I don't like the idea of having two functions, math.gcd and fractions.gcd, 
which do almost the same, but one is slow, whereas the other is fast. It's 
harder to write efficient code working on Python  3.5 (use fractions) and 
Python = 3.5 (use math or fractions?).

I suggest to modify fractions.gcd() to use math.gcd() if the two parameters are 
int. We just have to adjust the sign: if the second parameter is negative, 
return -math.gcd(a, b). (I guess that we have unit tests for fractions.gcd 
checking the 4 cases for signed parameters.)

--
nosy: +haypo

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



[issue22486] Add math.gcd()

2014-10-05 Thread Mark Dickinson

Mark Dickinson added the comment:

 I suggest to modify fractions.gcd() to use math.gcd() if the two parameters 
 are int.

Sounds fine to me, so long as the code (both fractions.gcd and the 
fractions.Fraction implementation) continues to function as before for objects 
that don't have exact type int.

--

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



[issue22486] Add math.gcd()

2014-10-05 Thread Stefan Behnel

Stefan Behnel added the comment:

+1

I mean, there is already such a type check in Fraction.__init__(), but I can 
see a case for also optimising fraction.gcd() for exact ints.

--

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



[issue22486] Add math.gcd()

2014-10-05 Thread Mark Dickinson

Mark Dickinson added the comment:

One other suggestion: I think math.gcd should work with arbitrary Python 
objects implementing __index__, and not just with instances of int.

--

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



[issue22486] Add math.gcd()

2014-10-05 Thread Mark Dickinson

Mark Dickinson added the comment:

 I mean, there is already such a type check in Fraction.__init__()

That type-check doesn't protect us from non-int Integrals, though, as far as I 
can tell.  It looks to me as though doing `Fraction(numpy.int32(3), 
numpy.int32(2))` would fail with a TypeError after this patch.  (It works in 
Python 3.4.)

--

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



[issue22448] call_at/call_later with Timer cancellation can result in (practically) unbounded memory usage.

2014-10-05 Thread STINNER Victor

STINNER Victor added the comment:

 Please commit your change to the tulip repo too.

Oh sorry. In fact, I made the commit but I forgot to push my change :-p

--

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



[issue20997] Wrong URL fragment identifier in search result

2014-10-05 Thread Georg Brandl

Georg Brandl added the comment:

Not a Python issue.

--
status: open - closed

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



[issue19361] Specialize exceptions thrown by JSON parser

2014-10-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch which adopts JSONDecodeError from simplejson.

Unlike to simplejson it is located in the json.decoder module (json uses 
different way to pass an error from scanner to decoder).

--
assignee:  - serhiy.storchaka
keywords: +needs review
stage:  - patch review
versions: +Python 3.5 -Python 3.4

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



[issue19361] Specialize exceptions thrown by JSON parser

2014-10-05 Thread Serhiy Storchaka

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


--
keywords: +patch
Added file: http://bugs.python.org/file36810/json_JSONDecodeError.patch

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



[issue22486] Add math.gcd()

2014-10-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I suggest just add deprecation warning in fractions.gcd(). Or at least add 
notes which recommend math.gcd() in the docstring and the documentation of 
fractions.gcd().

 One other suggestion: I think math.gcd should work with arbitrary Python
 objects implementing __index__, and not just with instances of int.

Agree.

--

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



[issue18131] Tkinter Variables require a proper master

2014-10-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 I am thinking that all uses of _default_root should raise something like
 WhateverError(An explicit master is required when _default_root is None or
 deleted.)  Serhiy, what do you think?

Technically all works (raises some exception), but I agree that error message 
can be more friendly. But _default_root is implementation detail. This name 
doesn't mean anything for non-experienced user (and experienced user already 
knows about these mystical RuntimeError and NameError). The message should say 
something like No default root window if _default_root is None and The 
master argument is mandatory after calling NoDefautRoot() if _default_root 
isn't set.

And now we came to the way how to create default root window. Issue4343 looks 
related (I haven't looked at it close however).

Second issue was fixed in issue22068.

--

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



[issue22351] NNTP constructor exception leaves socket for garbage collector

2014-10-05 Thread Rishi

Rishi added the comment:

Here is my attempt to fix this issue. This is my first patch ever :).
IMO checking socket leaks in the constructor requires an actual server, so I 
create an actual localhost dummy server and test some error conditions that are 
encountered by the constructor.

--
keywords: +patch
nosy: +rishi.maker.forum
Added file: http://bugs.python.org/file36811/issue22351.patch

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



[issue22297] 2.7 json encoding broken for enums

2014-10-05 Thread Serhiy Storchaka

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


--
assignee:  - docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python
stage: test needed - 
status: open - pending

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



[issue21401] python2 -3 does not warn about str/unicode to bytes conversions and comparisons

2014-10-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 Python 3 warns even if strings are equal.

Did you mean not equal? In Python 3 strings and bytes are always not equal.

--

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



[issue11101] plistlib has no graceful way of handing None values

2014-10-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Note that binary plist format supports None.

--
nosy: +serhiy.storchaka

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



[issue22555] Tracking issue for adjustments to binary/text boundary handling

2014-10-05 Thread Barry A. Warsaw

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


--
nosy: +barry

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



[issue22557] Locale import is too slow

2014-10-05 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Locale import is too slow in comparison with caching module in a global or even 
in sys.modules.

 import timeit
 def f():
... import locale
... 
 min(timeit.repeat(f, number=10, repeat=10))
0.450120013341
 _locale = None
 def g():
... global _locale
... if _locale is None:
... import _locale
... 
 min(timeit.repeat(g, number=10, repeat=10))
0.0782120034878
 import sys
 def h():
... try:
... locale = sys.modules['locale']
... except KeyError:
... import locale
... 
 min(timeit.repeat(h, number=10, repeat=10))
0.1235759813829

I think there is an overhead of look up __import__, packing arguments in a 
tuple and calling a function. This can be omitted by looking first in 
sys.module and calling __import__ only when nothing was found.

--
components: Interpreter Core
messages: 228561
nosy: brett.cannon, eric.snow, ncoghlan, pitrou, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Locale import is too slow
type: performance
versions: Python 3.5

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



[issue22557] Local import is too slow

2014-10-05 Thread Serhiy Storchaka

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


--
title: Locale import is too slow - Local import is too slow

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



[issue17636] Modify IMPORT_FROM to fallback on sys.modules

2014-10-05 Thread Antoine Pitrou

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


--
nosy: +serhiy.storchaka

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



[issue22557] Local import is too slow

2014-10-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

This would sound reasonable to me, but I wonder if it may change behaviour with 
weird custom __import__ overrides.

--

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



[issue22558] Missing hint to source code - complete

2014-10-05 Thread Friedrich Spee von Langenfeld

New submission from Friedrich Spee von Langenfeld:

As mentioned in Issue22528, in some modules´ documentation, the link to their 
source code is missing. To check the stdlib, I´ve written the script 
missing_hint.py.
It seems that in the following module entries, there aren´t a link to their 
source code (the last part of output of missing_hint.py):
https://docs.python.org/3/library/aifc.html
https://docs.python.org/3/library/base64.html
https://docs.python.org/3/library/binhex.html
https://docs.python.org/3/library/bz2.html
https://docs.python.org/3/library/cgi.html
https://docs.python.org/3/library/cgitb.html
https://docs.python.org/3/library/chunk.html
https://docs.python.org/3/library/code.html
https://docs.python.org/3/library/codecs.html
https://docs.python.org/3/library/codeop.html
https://docs.python.org/3/library/configparser.html
https://docs.python.org/3/library/copy.html
https://docs.python.org/3/library/copyreg.html
https://docs.python.org/3/library/csv.html
https://docs.python.org/3/library/datetime.html
https://docs.python.org/3/library/decimal.html
https://docs.python.org/3/library/difflib.html
https://docs.python.org/3/library/doctest.html
https://docs.python.org/3/library/fnmatch.html
https://docs.python.org/3/library/formatter.html
https://docs.python.org/3/library/ftplib.html
https://docs.python.org/3/library/getpass.html
https://docs.python.org/3/library/glob.html
https://docs.python.org/3/library/hashlib.html
https://docs.python.org/3/library/imaplib.html
https://docs.python.org/3/library/imp.html
https://docs.python.org/3/library/io.html
https://docs.python.org/3/library/locale.html
https://docs.python.org/3/library/lzma.html
https://docs.python.org/3/library/macpath.html
https://docs.python.org/3/library/mailbox.html
https://docs.python.org/3/library/mimetypes.html
https://docs.python.org/3/library/nntplib.html
https://docs.python.org/3/library/numbers.html
https://docs.python.org/3/library/os.html
https://docs.python.org/3/library/pathlib.html
https://docs.python.org/3/library/pickle.html
https://docs.python.org/3/library/plistlib.html
https://docs.python.org/3/library/poplib.html
https://docs.python.org/3/library/profile.html
https://docs.python.org/3/library/pydoc.html
https://docs.python.org/3/library/py_compile.html
https://docs.python.org/3/library/quopri.html
https://docs.python.org/3/library/re.html
https://docs.python.org/3/library/sched.html
https://docs.python.org/3/library/selectors.html
https://docs.python.org/3/library/shelve.html
https://docs.python.org/3/library/shutil.html
https://docs.python.org/3/library/smtplib.html
https://docs.python.org/3/library/sndhdr.html
https://docs.python.org/3/library/socket.html
https://docs.python.org/3/library/ssl.html
https://docs.python.org/3/library/stat.html
https://docs.python.org/3/library/stringprep.html
https://docs.python.org/3/library/struct.html
https://docs.python.org/3/library/subprocess.html
https://docs.python.org/3/library/telnetlib.html
https://docs.python.org/3/library/tempfile.html
https://docs.python.org/3/library/timeit.html
https://docs.python.org/3/library/traceback.html
https://docs.python.org/3/library/tracemalloc.html
https://docs.python.org/3/library/turtle.html
https://docs.python.org/3/library/uuid.html
https://docs.python.org/3/library/xdrlib.html

Is it possible to add the specific source code link to all of this entries?

--
assignee: docs@python
components: Documentation
files: missing_hint.py
messages: 228563
nosy: Friedrich.Spee.von.Langenfeld, docs@python
priority: normal
severity: normal
status: open
title: Missing hint to source code - complete
Added file: http://bugs.python.org/file36812/missing_hint.py

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



[issue22558] Missing hint to source code - complete

2014-10-05 Thread SilentGhost

SilentGhost added the comment:

Your code produces many false positives, would you care to reduce this list to 
only those modules that actually do not have a Source code link?

--
nosy: +SilentGhost

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



[issue22557] Local import is too slow

2014-10-05 Thread Nick Coghlan

Nick Coghlan added the comment:

__import__ is intended as an absolute override (including of the sys.modules 
cache lookup), so we can't bypass it without breaking backwards compatibility.

It's possible there is room for other optimisations that don't break the import 
override semantics (such as a fast path for when __import__ is the standard 
import function).

--

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



[issue22556] datetime comparison with 'None' returning a TypeError

2014-10-05 Thread Eric V. Smith

Eric V. Smith added the comment:

You've identified the main problem: would None go first or last? Modify your 
key function to make the decision appropriate for you, returning either a very 
small or very large value for None, as appropriate.

If you really want to see this behavior changed, you should have a concrete 
proposal and bring it up on the python-ideas mailing list.

--
nosy: +eric.smith
resolution:  - not a bug
stage:  - resolved
status: open - closed
type: compile error - behavior

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



[issue22557] Local import is too slow

2014-10-05 Thread Eric V. Smith

Changes by Eric V. Smith e...@trueblade.com:


--
nosy: +eric.smith

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



[issue17234] python-2.7.3-r3: crash in visit_decref()

2014-10-05 Thread Mark Lawrence

Mark Lawrence added the comment:

Should this be closed as I'm not aware of any similar problems with 2.7, 
particularly when this addresses 2.7.3.rc3?

--

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



[issue19477] document tp_print() as being dead in Py3

2014-10-05 Thread Stefan Behnel

Stefan Behnel added the comment:

Sure.

--
keywords: +patch
Added file: http://bugs.python.org/file36813/undocument_tp_print.patch

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



[issue17582] xml.etree.ElementTree does not preserve whitespaces in attributes

2014-10-05 Thread Stefan Behnel

Stefan Behnel added the comment:

 Proper escaping should be added to the _escape_attrib() function into 
 /xml/etree/ElementTree.py (and equivalent for cElementTree).

Agreed. Can you provide a patch?

--
versions:  -Python 2.7

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



[issue22557] Local import is too slow

2014-10-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I'm not experienced in import machinery. Here is preliminary patch which 
implements my idea for particular case.

Performance effect is almost so good as manual caching in a global.

 import timeit
 def f():
...  import locale
... 
 min(timeit.repeat(f, number=10, repeat=10))
0.0956359819417

Of course it breaks tests.

 It's possible there is room for other optimisations that don't break the
 import override semantics (such as a fast path for when __import__ is the
 standard import function).

Good idea.

--
keywords: +patch
Added file: http://bugs.python.org/file36814/faster_import.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22557
___diff -r 85de13b746ac Lib/test/test_import.py
--- a/Lib/test/test_import.py   Sat Oct 04 16:09:02 2014 +0300
+++ b/Lib/test/test_import.py   Sun Oct 05 17:15:42 2014 +0300
@@ -312,7 +312,7 @@ class ImportTests(unittest.TestCase):
 
 @cpython_only
 def test_delete_builtins_import(self):
-args = [-c, del __builtins__.__import__; import os]
+args = [-c, del __builtins__.__import__; import this]
 popen = script_helper.spawn_python(*args)
 stdout, stderr = popen.communicate()
 self.assertIn(bImportError, stdout)
diff -r 85de13b746ac Python/ceval.c
--- a/Python/ceval.cSat Oct 04 16:09:02 2014 +0300
+++ b/Python/ceval.cSun Oct 05 17:15:42 2014 +0300
@@ -2464,16 +2464,42 @@ PyEval_EvalFrameEx(PyFrameObject *f, int
 TARGET(IMPORT_NAME) {
 _Py_IDENTIFIER(__import__);
 PyObject *name = GETITEM(names, oparg);
-PyObject *func = _PyDict_GetItemId(f-f_builtins, 
PyId___import__);
+PyObject *func;
 PyObject *from, *level, *args, *res;
+from = POP();
+level = TOP();
+if (from == Py_None  PyUnicode_Check(name)) {
+if (PyLong_AsLong(level) == 0) {
+Py_ssize_t i = PyUnicode_FindChar(name, '.',
+0, PyUnicode_GET_LENGTH(name), 1);
+if (i == -1) {
+res = PyDict_GetItem(PyImport_GetModuleDict(), name);
+if (res != NULL) {
+Py_INCREF(res);
+Py_DECREF(level);
+Py_DECREF(from);
+SET_TOP(res);
+DISPATCH();
+}
+}
+else if (i == -2) {
+Py_DECREF(level);
+Py_DECREF(from);
+STACKADJ(-1);
+goto error;
+}
+}
+else if (PyErr_Occurred())
+PyErr_Clear();
+}
+func = _PyDict_GetItemId(f-f_builtins, PyId___import__);
 if (func == NULL) {
 PyErr_SetString(PyExc_ImportError,
 __import__ not found);
+STACKADJ(-1);
 goto error;
 }
 Py_INCREF(func);
-from = POP();
-level = TOP();
 if (PyLong_AsLong(level) != -1 || PyErr_Occurred())
 args = PyTuple_Pack(5,
 name,
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19477] document tp_print() as being dead in Py3

2014-10-05 Thread Stefan Behnel

Changes by Stefan Behnel sco...@users.sourceforge.net:


Removed file: http://bugs.python.org/file36813/undocument_tp_print.patch

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



[issue19477] document tp_print() as being dead in Py3

2014-10-05 Thread Stefan Behnel

Changes by Stefan Behnel sco...@users.sourceforge.net:


Added file: http://bugs.python.org/file36815/undocument_tp_print.patch

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



[issue22558] Missing hint to source code - complete

2014-10-05 Thread R. David Murray

R. David Murray added the comment:

And that have source code.

That said, some modules may have been consciously omitted.

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

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



[issue19477] document tp_print() as being dead in Py3

2014-10-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset bead459ccce8 by Georg Brandl in branch '3.4':
Closes #19477: remove outdated documentation of tp_print type object slot.
https://hg.python.org/cpython/rev/bead459ccce8

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

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



[issue22557] Local import is too slow

2014-10-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Second version of the patch uses fast patch only when builtin __import__ is 
not overridden. It is slightly slower (due to lookup of __import__).

 import timeit
 def f():
... import locale
... 
 min(timeit.repeat(f, number=10, repeat=10))
0.1050230371179

The code is simpler, but still some cumbersome. It would be good to optimize 
also from locale import getlocale.

--
Added file: http://bugs.python.org/file36816/faster_import_2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22557
___diff -r 85de13b746ac Python/ceval.c
--- a/Python/ceval.cSat Oct 04 16:09:02 2014 +0300
+++ b/Python/ceval.cSun Oct 05 17:55:26 2014 +0300
@@ -2463,6 +2463,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int
 
 TARGET(IMPORT_NAME) {
 _Py_IDENTIFIER(__import__);
+static PyObject *orig_func = NULL;
 PyObject *name = GETITEM(names, oparg);
 PyObject *func = _PyDict_GetItemId(f-f_builtins, 
PyId___import__);
 PyObject *from, *level, *args, *res;
@@ -2474,6 +2475,29 @@ PyEval_EvalFrameEx(PyFrameObject *f, int
 Py_INCREF(func);
 from = POP();
 level = TOP();
+if (orig_func == NULL)
+orig_func = _PyDict_GetItemId(
+PyThreadState_GET()-interp-builtins_copy,
+PyId___import__);
+if (func == orig_func  from == Py_None 
+PyLong_Check(level)  Py_SIZE(level) == 0 
+PyUnicode_Check(name)) {
+Py_ssize_t i = PyUnicode_FindChar(name, '.',
+0, PyUnicode_GET_LENGTH(name), 1);
+if (i == -1) {
+res = PyDict_GetItem(PyImport_GetModuleDict(), name);
+if (res != NULL) {
+Py_INCREF(res);
+Py_DECREF(func);
+Py_DECREF(level);
+Py_DECREF(from);
+SET_TOP(res);
+DISPATCH();
+}
+}
+else if (i == -2)
+PyErr_Clear();
+}
 if (PyLong_AsLong(level) != -1 || PyErr_Occurred())
 args = PyTuple_Pack(5,
 name,
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22557] Local import is too slow

2014-10-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I would suggest factoring out IMPORT_NAME into a separate import_name() 
function, like is already one for import_from().

--

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



[issue22557] Local import is too slow

2014-10-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Some more general comments about this:

- Let's keep in mind the absolute numbers. 0.450120013341 for 10 
iterations is 4.5ms per iteration. This is not very slow by CPython's standards.

- I wonder if you ran your benchmark in debug mode or if your CPU is slow :-) I 
get around 0.5ms per iteration here.

--

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



[issue22332] test_multiprocessing_main_handling fail on buildbot x86 FreeBSD 6.4 3.x

2014-10-05 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
resolution:  - fixed
status: open - closed

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



[issue22558] Missing hint to source code - complete

2014-10-05 Thread Friedrich Spee von Langenfeld

Friedrich Spee von Langenfeld added the comment:

I decremented the shown number of modules by 25. Here is the new list:

https://docs.python.org/3/library/base64.html
https://docs.python.org/3/library/binhex.html
https://docs.python.org/3/library/bz2.html
https://docs.python.org/3/library/cgitb.html
https://docs.python.org/3/library/chunk.html
https://docs.python.org/3/library/code.html
https://docs.python.org/3/library/codecs.html
https://docs.python.org/3/library/codeop.html
https://docs.python.org/3/library/configparser.html
https://docs.python.org/3/library/copy.html
https://docs.python.org/3/library/copyreg.html
https://docs.python.org/3/library/csv.html
https://docs.python.org/3/library/datetime.html
https://docs.python.org/3/library/decimal.html
https://docs.python.org/3/library/difflib.html
https://docs.python.org/3/library/doctest.html
https://docs.python.org/3/library/formatter.html
https://docs.python.org/3/library/getpass.html
https://docs.python.org/3/library/imp.html
https://docs.python.org/3/library/io.html
https://docs.python.org/3/library/locale.html
https://docs.python.org/3/library/lzma.html
https://docs.python.org/3/library/macpath.html
https://docs.python.org/3/library/mailbox.html
https://docs.python.org/3/library/numbers.html
https://docs.python.org/3/library/os.html
https://docs.python.org/3/library/pathlib.html
https://docs.python.org/3/library/pickle.html
https://docs.python.org/3/library/re.html
https://docs.python.org/3/library/selectors.html
https://docs.python.org/3/library/socket.html
https://docs.python.org/3/library/stat.html   # false positive
https://docs.python.org/3/library/stringprep.html
https://docs.python.org/3/library/struct.html
https://docs.python.org/3/library/subprocess.html
https://docs.python.org/3/library/traceback.html
https://docs.python.org/3/library/tracemalloc.html
https://docs.python.org/3/library/turtle.html
https://docs.python.org/3/library/uuid.html

@R. David Murray: I will try to look at the source code for each module, but I 
have updated the list to make it possible to work on this subject in the 
meantime.

PS: Is it possible for me to edit my own contributions (comments, files) after 
uploading?

--
Added file: http://bugs.python.org/file36817/missing_hint_v2.py

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



[issue22331] test_io.test_interrupted_write_text() hangs on the buildbot FreeBSD 7.2

2014-10-05 Thread STINNER Victor

STINNER Victor added the comment:

The test now pass on the buildbot FreeBSD 7.2.

--
resolution:  - fixed
status: open - closed

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



[issue22332] test_multiprocessing_main_handling fail on buildbot x86 FreeBSD 6.4 3.x

2014-10-05 Thread STINNER Victor

STINNER Victor added the comment:

The test_multiprocessing_main_handling test is now skipped, as expected, on on 
the buildbot x86 FreeBSD 6.4 3.x.

--

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



[issue21965] Add support for Memory BIO to _ssl

2014-10-05 Thread Geert Jansen

Geert Jansen added the comment:

Maybe an example is useful on how the Memory BIO stuff can be used to implement 
SSL on top of a proactor event loop. I just added support for this to my Gruvi 
project in the branch feat-memory-bio:

An SslPipe utility class that uses the memory BIOs:

https://github.com/geertj/gruvi/blob/feat-memory-bio/gruvi/ssl.py#L23

A PEP-3156 style transport:

https://github.com/geertj/gruvi/blob/feat-memory-bio/gruvi/ssl.py#L234

And a backport of this for Python 2.7, 3,3 and 3.4:

https://github.com/geertj/gruvi/blob/feat-memory-bio/gruvi/_sslcompat.c
https://github.com/geertj/gruvi/blob/feat-memory-bio/gruvi/sslcompat.py

--

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



[issue22222] dtoa.c: remove custom memory allocator

2014-10-05 Thread STINNER Victor

STINNER Victor added the comment:

I was no aware of the performance degradation when I created the issue. 18 KB 
of memory is too low to invest effort on optimizing the generic Python memory 
allocator, I prefer to keep the heavily optimized allocator in dtoa.c.

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

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



[issue22290] AMD64 OpenIndiana 3.x buildbot: assertion failed in PyObject_Call() in test_subprocess.test_preexec()

2014-10-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0455cbfd7ae6 by Victor Stinner in branch '3.4':
Issue #22290: Fix error handling in the _posixsubprocess module.
https://hg.python.org/cpython/rev/0455cbfd7ae6

New changeset a74c73477a64 by Victor Stinner in branch 'default':
(Merge 3.4) Issue #22290: Fix error handling in the _posixsubprocess module.
https://hg.python.org/cpython/rev/a74c73477a64

--

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



[issue22290] AMD64 OpenIndiana 3.x buildbot: assertion failed in PyObject_Call() in test_subprocess.test_preexec()

2014-10-05 Thread STINNER Victor

STINNER Victor added the comment:

I hope that my fix will be enough to fix the issue. Since it was only seen 
once, I prefer to close the issue.

By the way, it would be nice to give more memory to this buildbot!

--
resolution:  - fixed
status: open - closed

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



[issue21965] Add support for Memory BIO to _ssl

2014-10-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

SSLPipe looks interesting. I wonder if it can be used to reimplement 
_SelectorSslTransport in asyncio.selector_events (at least as an experiment).
I'll take a look at the cumulated patch soon, thank you.

--

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



[issue22390] test.regrtest should complain if a test doesn't remove temporary files

2014-10-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8cf8bff3569e by Victor Stinner in branch '3.4':
Issue #22390: Remove files created by tests
https://hg.python.org/cpython/rev/8cf8bff3569e

--
nosy: +python-dev

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



[issue16518] add buffer protocol to glossary

2014-10-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e7e8a218737a by R David Murray in branch 'default':
#16518: Bring error messages in harmony with docs (bytes-like object)
https://hg.python.org/cpython/rev/e7e8a218737a

--

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



[issue22324] Use PyUnicode_AsWideCharString() instead of PyUnicode_AsUnicode()

2014-10-05 Thread STINNER Victor

STINNER Victor added the comment:

 The cache is released when the string is released. While the string exists 
 it's wchar_t representation can be needed again. That is for what the cache 
 exists.

I know. But I don't want to waste memory for this cache. I want to stop using 
it. IMO the performance overhead will be null.

In which use case do you think that the overhead of not using the cache would 
be important enough?

--

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



[issue16518] add buffer protocol to glossary

2014-10-05 Thread R. David Murray

R. David Murray added the comment:

Committed the message changes to 3.5 only, since it will probably cause tests 
to fail in various projects, despite messages not being a formal part of the 
python API.  

Per IRC conversation with Ezio and Antoine, I posted a note to python-dev to 
let people know we now have a consistent terminology in the docs and error 
messages, and to provide a last opportunity for objections (it is easy enough 
to back the patch out if there is an outcry, but I don't expect one).

--
nosy: +r.david.murray
resolution:  - fixed
stage: commit review - resolved
status: open - closed

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



[issue22324] Use PyUnicode_AsWideCharString() instead of PyUnicode_AsUnicode()

2014-10-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 In which use case do you think that the overhead of not using the cache would 
 be important enough?

I suppose in the same use case that memory overhead of using the cache is 
important enough.

We need results of performance and memory consumption effect of these changes 
in a wide range of programs.

--

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



[issue4343] New function in Tkinter.py: setup_master

2014-10-05 Thread R. David Murray

R. David Murray added the comment:

Changing status back to 'needs patch' per Terry's comment that the patch needs 
to be updated (now for 3.5).

--
assignee: gpolo - 
nosy: +r.david.murray
stage: commit review - needs patch
versions: +Python 3.5 -Python 3.4

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



[issue2552] test_ctypes failed Python 2.6a2 Solaris 10 SUN C

2014-10-05 Thread Mark Lawrence

Mark Lawrence added the comment:

Can we close this as I cannot see how a test failure against a 6.5 year old 
alpha build can still be relevant?

--

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



[issue2552] test_ctypes failed Python 2.6a2 Solaris 10 SUN C

2014-10-05 Thread Gregory P. Smith

Changes by Gregory P. Smith g...@krypto.org:


--
resolution:  - out of date
status: languishing - closed

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



[issue18161] call fchdir if subprocess.Popen(cwd=integer|fileobject)

2014-10-05 Thread Mark Lawrence

Mark Lawrence added the comment:

mmarkk we're sorry about the delay in getting back to you.  Who is best placed 
to reply to this enhancement request, the only name on the experts list is 
inactive?

--
nosy: +BreamoreBoy
versions:  -Python 3.3, Python 3.4

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



[issue14303] Incorrect documentation for socket.py on linux

2014-10-05 Thread Mark Lawrence

Mark Lawrence added the comment:

Shane, there are major differences between the makefile docs versions 2 and 3, 
so could you prepare a patch for this addressed at version 2 only?

--
nosy: +BreamoreBoy
versions:  -Python 2.6

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



[issue18165] Add 'unexpected_type' to TypeError

2014-10-05 Thread Mark Lawrence

Mark Lawrence added the comment:

Just a gentle reminder guys.

--
nosy: +BreamoreBoy
versions: +Python 3.5 -Python 3.4

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



[issue18166] 'value' attribute for ValueError

2014-10-05 Thread Mark Lawrence

Mark Lawrence added the comment:

Just a gentle reminder guys.

--
nosy: +BreamoreBoy
versions: +Python 3.5 -Python 3.4

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



[issue18299] Change script_helper to use universal_newlines=True in _assert_python

2014-10-05 Thread Mark Lawrence

Mark Lawrence added the comment:

Just a gentle reminder guys.

--
nosy: +BreamoreBoy
versions: +Python 3.5 -Python 3.4

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



[issue16518] add buffer protocol to glossary

2014-10-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There are other unfixed messages (may be introduced after 3.3):

 b''.join([''])
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: sequence item 0: expected bytes, bytearray, or an object with the 
buffer interface, str found
 str(42, 'utf8')
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: coercing to str: need bytes, bytearray or buffer-like object, int 
found
 import array; array.array('B').frombytes(array.array('I'))
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: string/buffer of bytes required.
 import socket; print(socket.socket.sendmsg.__doc__)
sendmsg(buffers[, ancdata[, flags[, address]]]) - count

Send normal and ancillary data to the socket, gathering the
non-ancillary data from a series of buffers and concatenating it into
a single message.  The buffers argument specifies the non-ancillary
data as an iterable of buffer-compatible objects (e.g. bytes objects).
The ancdata argument specifies the ancillary data (control messages)
as an iterable of zero or more tuples (cmsg_level, cmsg_type,
cmsg_data), where cmsg_level and cmsg_type are integers specifying the
protocol level and protocol-specific type respectively, and cmsg_data
is a buffer-compatible object holding the associated data.  The flags
argument defaults to 0 and has the same meaning as for send().  If
address is supplied and not None, it sets a destination address for
the message.  The return value is the number of bytes of non-ancillary
data sent.

And there are several mentions of buffer-like or buffer-compatible in the 
documentation.

--
nosy: +serhiy.storchaka

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



[issue15729] PyStructSequence_NewType enhancement

2014-10-05 Thread Mark Lawrence

Mark Lawrence added the comment:

I'm uncertain as to whether or not the patch can be considered stand alone, or 
whether the pep3121 keyword is also relevant here.

--
nosy: +BreamoreBoy
versions: +Python 3.5 -Python 3.4

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



[issue18173] Add MixedTypeKey to reprlib

2014-10-05 Thread Mark Lawrence

Mark Lawrence added the comment:

Just a gentle reminder guys.

--
nosy: +BreamoreBoy
versions: +Python 3.5 -Python 3.4

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



[issue22364] Improve some re error messages using regex for hints

2014-10-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 As for #14, either UNICODE and LOCALE *are* compatible (for re) or this is 
 buggy.

This is buggy (issue22407).

--
title: Unify error messages of re and regex - Improve some re error messages 
using regex for hints

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



[issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments

2014-10-05 Thread Mark Lawrence

Mark Lawrence added the comment:

Could we have a reply to this from our ctypes experts, thanks.

--
nosy: +BreamoreBoy
versions: +Python 3.5 -Python 3.2, Python 3.3

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



[issue18319] gettext() cannot find translations with plural forms

2014-10-05 Thread Mark Lawrence

Mark Lawrence added the comment:

@Martin can you comment on this please.

--
nosy: +BreamoreBoy, loewis
type:  - behavior
versions: +Python 2.7, Python 3.4, Python 3.5

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



[issue18348] Additional code pages for EBCDIC

2014-10-05 Thread Mark Lawrence

Mark Lawrence added the comment:

What do our unicode experts think about this enhancement request?

--
nosy: +BreamoreBoy
versions: +Python 3.5

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



[issue12957] mmap.resize changes memory address of mmap'd region

2014-10-05 Thread Mark Lawrence

Mark Lawrence added the comment:

@Michael can you provide a patch to this effect?

--
nosy: +BreamoreBoy
versions: +Python 3.5 -Python 3.3

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



[issue19380] Optimize parsing of regular expressions

2014-10-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch which addresses Yury's and Josh's comments. Also discarded few 
minor changes.

--
Added file: http://bugs.python.org/file36818/re_parse_4.patch

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



[issue18372] _Pickler_New() doesn't call PyObject_GC_Track(self)

2014-10-05 Thread Mark Lawrence

Mark Lawrence added the comment:

@Christian/Victor could either of you provide a patch for this, it's way beyond 
my knowledge I'm afraid.

--
nosy: +BreamoreBoy
versions: +Python 2.7, Python 3.4, Python 3.5

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



[issue21173] WeakKeyDictionary.__len__ fragile w/ _IterationGuards

2014-10-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 657d21b4b121 by Antoine Pitrou in branch '3.4':
Closes #21173: Fix len() on a WeakKeyDictionary when .clear() was called with 
an iterator alive.
https://hg.python.org/cpython/rev/657d21b4b121

New changeset 27533444b964 by Antoine Pitrou in branch 'default':
Closes #21173: Fix len() on a WeakKeyDictionary when .clear() was called with 
an iterator alive.
https://hg.python.org/cpython/rev/27533444b964

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

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



[issue18348] Additional code pages for EBCDIC

2014-10-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Currently Python includes codecs for cp037, cp273, and cp500.

--
nosy: +serhiy.storchaka

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



[issue18459] readline: libedit support on non-apple platforms

2014-10-05 Thread Mark Lawrence

Mark Lawrence added the comment:

Just a gentle reminder.

--
components: +Extension Modules
nosy: +BreamoreBoy
versions: +Python 2.7, Python 3.5

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



[issue18493] make profile-opt fails with pre-existing python2.7 in path

2014-10-05 Thread Mark Lawrence

Mark Lawrence added the comment:

Can somebody please take a look at the inline patch in msg193313.

--
nosy: +BreamoreBoy
type:  - behavior
versions: +Python 3.4, Python 3.5

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



[issue18372] _Pickler_New() doesn't call PyObject_GC_Track(self)

2014-10-05 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Mark, could you please stop touching every issue on the tracker? I appreciate 
the effort, but giving thoughtful feedback, patches, or reviews on a just a few 
issues would be much more helpful.

--
nosy: +benjamin.peterson

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



[issue4343] tkinter: add _get_master() and use it consistently

2014-10-05 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The new function should be private. I closed #18131 as partially a duplicate of 
this.  It has a couple of other suggested wordings for the exception.

I consider the current behavior, in particular the failure of Variable and 
subclasses when the supposedly optional master is not passed, to be buggy.  So 
I think backporting should be considered when we settle on a patch.

--
nosy: +serhiy.storchaka
title: New function in Tkinter.py: setup_master - tkinter: add _get_master() 
and use it consistently

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



[issue21081] missing vietnamese codec TCVN 5712:1993 in Python

2014-10-05 Thread Serhiy Storchaka

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


--
nosy: +serhiy.storchaka
stage:  - needs patch

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



[issue18494] PyType_GenericSet/GetDict functions misnamed in docs?

2014-10-05 Thread Mark Lawrence

Mark Lawrence added the comment:

Can someone with knowledge of the C code associated with the object/type system 
comment on this please.

--
nosy: +BreamoreBoy

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



[issue18372] _Pickler_New() doesn't call PyObject_GC_Track(self)

2014-10-05 Thread Mark Lawrence

Mark Lawrence added the comment:

Sorry but no, when I started out on this a couple of months ago there were over 
600 issues that nobody had even bothered to reply to.  That number is now down 
to 369.  I believe that around 200 issues have been closed as a result of my 
efforts.  Do you have a problem with me showing just how easy it is to get 
issues resolved?

--

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



[issue21965] Add support for Memory BIO to _ssl

2014-10-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a79003f25a41 by Antoine Pitrou in branch 'default':
Issue #21965: Add support for in-memory SSL to the ssl module.
https://hg.python.org/cpython/rev/a79003f25a41

--
nosy: +python-dev

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



[issue15273] Remove unnecessarily random behavior from test_unparse.py

2014-10-05 Thread Berker Peksag

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


--
components: +Tests
nosy: +berker.peksag
stage: needs patch - patch review
versions: +Python 3.5

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



[issue18494] PyType_GenericSet/GetDict functions misnamed in docs?

2014-10-05 Thread eryksun

eryksun added the comment:

See changeset 78f93eb7dd75. The names in the docs are wrong.

--
nosy: +eryksun

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



[issue22351] NNTP constructor exception leaves socket for garbage collector

2014-10-05 Thread Rishi

Rishi added the comment:

patch updated to use just plain exception

--
Added file: http://bugs.python.org/file36819/issue22351_1.patch

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



[issue18372] _Pickler_New() doesn't call PyObject_GC_Track(self)

2014-10-05 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Mark, I also appreciate your efforts, as I hope should be obvious from my prior 
responses to many of your other posts.  I also agree that somewhat fewer, 
higher quality posts would be even more helpful.  Please do not slip into a 
'confrontational' mode, as you did a few years ago.  And please lets discuss 
this further by private email.

--
nosy: +terry.reedy

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



[issue22559] [backport] ssl.MemoryBIO

2014-10-05 Thread Alex Gaynor

New submission from Alex Gaynor:

Attached patch is a first-cut at a backport patch. Note that it is not quite a 
1-1 with the original:

The SSL module backport added a new field for the Python-level SSLSocket 
reference (ssl_sock), which was a different object from the _socket.socket 
(PySocketObject *) object. This is all effectively supplanted by the new owner 
field, so this patch does that as well.

The patch looks basically complete to me, but the tests hang for some reason: 
in a test where the client side hangs up (test_check_hostname) the server side 
of the socket blocks in a call to read(). I'm not sure why.

Antoine, or anyone else who worked on the original patch, did you run into any 
issues like this, or have any other insights into what might be causing it?

--
files: memory-bio.diff
keywords: patch
messages: 228618
nosy: alex, christian.heimes, dstufft, giampaolo.rodola, janssen, pitrou
priority: normal
severity: normal
status: open
title: [backport] ssl.MemoryBIO
versions: Python 2.7
Added file: http://bugs.python.org/file36820/memory-bio.diff

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



[issue22559] [backport] ssl.MemoryBIO

2014-10-05 Thread Geert Jansen

Changes by Geert Jansen gee...@gmail.com:


--
nosy: +geertj

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



[issue18372] _Pickler_New() doesn't call PyObject_GC_Track(self)

2014-10-05 Thread STINNER Victor

STINNER Victor added the comment:

Le 5 oct. 2014 20:04, Mark Lawrence rep...@bugs.python.org a écrit :


 Mark Lawrence added the comment:

 @Christian/Victor could either of you provide a patch for this, it's way
beyond my knowledge I'm afraid.

I agree with Benjamin. Asking directly two developers to write a patch
don't add any value to the issue, it only puts pressure on them. If I
didn't write a patch before, it's probably because I'm not really
interested by the topic.

If you would like to contribute, you can close directly issues, test and
review patches, suggest an implementation, etc.

It's not all black or all white. Sometimes, your ping messages are
helpful reminders to finish the work or simply to close the issue.

By experience, most old issues are not finished because the bug only impact
a few people and it's possible to work around it, or because the feature
request is not interesting enough.

I didn't read this issue (i'm replying in my mail client), my remarks are
general.

--

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



[issue18372] _Pickler_New() doesn't call PyObject_GC_Track(self)

2014-10-05 Thread STINNER Victor

STINNER Victor added the comment:

I don't know the PyObject_GC_Track() function. Why is it an issue to not call 
it? Can you elaborate Christian? What do you suggest?

--

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



[issue21965] Add support for Memory BIO to _ssl

2014-10-05 Thread Geert Jansen

Geert Jansen added the comment:

Thanks Antoine for merge!

 SSLPipe looks interesting. I wonder if it can be used to reimplement 
 _SelectorSslTransport in asyncio.selector_events (at least as an experiment).

Yes, it could be done quite easily. SslPipe has no dependency on other parts of 
Gruvi and if this is for Python 3.5 only then you don't need sslcompat either.

Basically you want to install a read callback on the socket that, when fired, 
reads from the socket and stuffs the bytes into the memory BIO. It should then 
write() the returning data back to the socket. If there's a short write, then 
it should install a write callback to retry the write.

The above is almost identical to what SslTransport in Gruvi does. The only 
different is that Gruvi uses a proactor on all platforms, so that it does not 
need to call read() itself but the callback is already called with the buffer.

--

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



[issue18372] _Pickler_New() doesn't call PyObject_GC_Track(self)

2014-10-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

From Doc/c-api/gcsupport.rst:

 Constructors for container types must conform to two rules:
 
 #. The memory for the object must be allocated using :c:func:`PyObject_GC_New`
or :c:func:`PyObject_GC_NewVar`.
 
 #. Once all the fields which may contain references to other containers are
 
initialized, it must call :c:func:`PyObject_GC_Track`.

_pickle.Pickler and _pickle.Unpickler have the Py_TPFLAGS_HAVE_GC flag, 
implement tp_traverse and tp_clear, but PyObject_GC_Track is newer called.

--
nosy: +serhiy.storchaka

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



[issue21965] Add support for Memory BIO to _ssl

2014-10-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le 05/10/2014 23:24, Geert Jansen a écrit :
 
 Yes, it could be done quite easily. SslPipe has no dependency on
 other
parts of Gruvi and if this is for Python 3.5 only then you don't need
sslcompat either.

Yes, it works. Note that I had to modify SSLPipe to also notify of
handshake failures (by passing an argument to the handshake callback).

Here is draft diff against asyncio:
https://gist.github.com/pitrou/f04fa9cbfec88cc37050

However, I don't think this the right approach actually. Rather, the SSL
layer should be implemented as a Protocol object that's also able to act
as a transport for the actual application-level Protocol. It would
completely decouple it from the transport and event loop implementation
details.

(I think that's how Twisted does it, btw)

--

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



[issue21965] Add support for Memory BIO to _ssl

2014-10-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8da1aa71cd73 by Antoine Pitrou in branch 'default':
Remove unused block argument in SSLObject.do_handshake() (issue #21965)
https://hg.python.org/cpython/rev/8da1aa71cd73

--

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



[issue22559] [backport] ssl.MemoryBIO

2014-10-05 Thread Geert Jansen

Geert Jansen added the comment:

It seems that SSLSocket.close() doesn't actually close the socket, and that's 
why the server side read() blocks.

It's a bit of a mystery to me how socket.close(), which is called by SSLSocket 
to do the actual close, is supposed to work. I don't see any calls to 
_sock.close() in there..

If I add the following 3 lines to socket.py then it works (but there's a few 
unexpected EOF errors in return).

diff -r ae64614b66b7 Lib/socket.py
--- a/Lib/socket.py Sat Oct 04 18:24:32 2014 -0400
+++ b/Lib/socket.py Sun Oct 05 18:16:51 2014 -0400
@@ -192,6 +192,9 @@
 def close(self, _closedsocket=_closedsocket,
   _delegate_methods=_delegate_methods, setattr=setattr):
 # This function should not reference any globals. See issue #808164.
+if hasattr(self._sock, '_dummy'):
+return
+self._sock.close()
 self._sock = _closedsocket()
 dummy = self._sock._dummy
 for method in _delegate_methods:

I'm probably overlooking something b/c I can't imagine socket.close() being a 
no-op.

--

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



  1   2   >