Stefan Behnel added the comment:
Add all the element methods to the elementtree object.
Ok, but why? An ElementTree object *is not* an Element. It's a
representation of a document that *has* a root Element.
It makes sense for a document to allow searches over its content, and the
ElementTree
dellair jie added the comment:
Neil,
It doesn't look like a duplicate of Issue6672.
The one in Issue6672 was for Mingw, all the patches simply added __MINGW32__ to
__CYGWIN__ build structure.
While my issue is, the build failed with _struct.c on Cygwin. So the module is
recognized, just
Raymond Hettinger added the comment:
ElementTree class currently supports that,
using the find*() or iter() methods.
That would be great except that ElementTree doesn't actually have an __iter__
method.
Ok, but why?
The short answer is that every time I conduct Python training, people
Stefan Behnel added the comment:
I don't see any benefit from having this code fail:
from xml.etree.ElementTree import parse
catalog = parse('books.xml')
for book in catalog:
print book.get('id')
Why would you expect it to work? And how?
Why would it only iterate
Jonas Wagner added the comment:
Thanks Ned, this is interesting!
I don't know about Mac OS, but on Ubuntu, LTO and PGO apparently make Python
around 10% faster (see #17781). However, that data point refers to GCC's LTO,
not LLVM's.
Personally I'm interested in LTO because I want to obtain
New submission from Thomas Heller:
I think that 'equivalent' functools.partial objects should compare equal, so
the following snippet SHOULD print True:
import functools
f = lambda x: x
a = functools.partial(f, 42)
b = functools.partial(f, 42)
a == b
False
--
components: Library
Ronald Oussoren added the comment:
I've used -O4 for extensions in the past (which until recently implied LTO) and
that worked fine.
I'm pretty sure that I haven't used LTO for python itself, apart from a some
tests with an early version llvm-gcc where using LTO for building python used
to
New submission from Bohuslav Slavek Kabrda:
test_faulthandler.test_register_chain fails on some 64bit architectures (arm8,
ppc64) with kernel = 3.10:
==
FAIL: test_register_chain (__main__.FaultHandlerTests)
Ronald Oussoren added the comment:
Have you tried the -export_dynamic option for ld(1):
-export_dynamic
Preserves all global symbols in main executables during LTO.
Without this option, Link Time Optimization is allowed to inline and remove
global functions. This
Ronald Oussoren added the comment:
This works for me (with a separate build directory):
CC=clang CXX=clang++ CFLAGS=-g -flto LDFLAGS=-flto -Wl,-export_dynamic
../configure
This is on OSX 10.9.2, with Xcode 5.1, and clang --version says:
$ clang --version
Apple LLVM version 5.1
Changes by STINNER Victor victor.stin...@gmail.com:
--
nosy: +haypo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21131
___
___
Python-bugs-list
STINNER Victor added the comment:
test_faulthandler.test_register_chain fails on some 64bit architectures (arm8,
ppc64) with kernel = 3.10
I am a little bit surprised that the bug depends on the kernel version.
Does test_register_chain_segfault_reproducer.py also crash with chain=False?
Can
Raymond Hettinger added the comment:
Even equivalent functions don't compare as equal:
(lambda x: x*x) == (lambda x: x*x)
False
--
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21130
STINNER Victor added the comment:
Would it be possible to list the kernel version (full version including the
minor version) on which the test works or crash? You are talking about 3.10
without the minor version. It may be a regression in the kernel.
Example of change in Linux kernel 3.10.17:
Bohuslav Slavek Kabrda added the comment:
I'm also surprised that this depends on kernel version, however that's what I
found out (and the opensuse guys seem to only have reproduced this on kernel =
3.10, too).
- Full kernel version (uname -r output): 3.13.0-0.rc7.28.sa2.aarch64
- The
Roundup Robot added the comment:
New changeset 3e2354dde892 by Raymond Hettinger in branch '3.4':
Issue #18652: Add an itertools recipe for first_true()
http://hg.python.org/cpython/rev/3e2354dde892
--
nosy: +python-dev
___
Python tracker
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18652
___
Bohuslav Slavek Kabrda added the comment:
Ok, so with #undef HAVE_SIGACTION both the reproducer and the original test
(as well as all tests in test_faulthandler) pass fine.
--
___
Python tracker rep...@bugs.python.org
Thomas Heller added the comment:
Sure. I'm not sure 'equivalent' is the word I should have used.
I suggest (and I would have expected) that partial instances (a, b) should
compare equal when
a.func == b.func \
and a.args == b.args \
and a.keywords == b.keywords
--
Sreepriya Chalakkal added the comment:
Hi David,
The variable decode_data is included to control decoding. But I am not sure
what needs to be done while calling the process_message inside found_terminator
when it is binary data. How to work around with binary data? Can you tell me
what are
Martin v. Löwis added the comment:
The limitation of build.bat (as you also reported) is that it builds a debug
build.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17846
___
eryksun added the comment:
Function equality is based on identity, as inherited from object. But there's a
precedent for this idea in method_richcompare, which compares the method's
__func__ and __self__:
http://hg.python.org/cpython/file/04f714765c13/Objects/classobject.c#l208
--
New submission from David Woakes:
I've seen issue 21050 and tried a complete uninstall, delete c:\python34 and
install of python 3.4.
I can't get win32api to load unless I copy pythoncom34.dll and
psywintypes34.dll to C:\Python34\Lib\site-packages\win32 from
Masayuki Yamamoto added the comment:
I wrote a patch file.
In other extention module source codes, global variable PyTypeObject has
initialized to using PyVarObject_HEAD_INIT(NULL, 0).
And so, as with other modules, I tried to edit and compiling _struct.c in
Cygwin 1.7.28.
The module compiling
New submission from the mulhern:
You can run python -m unittest discover some args and the unittests
discovered by discover will be run. This is nice.
However, it is actually desirable to run each unittest package individually,
rather than in the same interpreter instance. When run via
Eli Bendersky added the comment:
I left some comments in Rietveld.
There shouldn't be a problem getting these into 3.4 too - doc changes are
usually excempt from most restrictions.
--
___
Python tracker rep...@bugs.python.org
Eli Bendersky added the comment:
Do you have concrete suggestions? Make the tree iterable?
Add all element methods to the tree, implicitly forwarding to the root?
Yes, that is the feature request. Add all the element methods to the
elementtree object.
Implicitly forwarding to the root
Changes by Brett Cannon br...@python.org:
--
nosy: +brett.cannon
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21128
___
___
Python-bugs-list
Stefan Behnel added the comment:
How about just making a sensibly-behaving __iter__ for ElementTree?
Well, the problem is to determine what sensibly-behaving is. I can see
three options.
1) tree.iter() == tree.getroot().iter()
2) iter(tree.getroot())
3) iter([tree.getroot()])
The second
New submission from Marek Kowalski:
I'm attaching a minimal script to reproduce. I tested only with 3.2 and 2.7
versions. Its possible that it has been fixed since 3.2.
--
components: Unicode
files: segv.py
messages: 215384
nosy: Marek.Kowalski, ezio.melotti, haypo
priority: normal
dellair jie added the comment:
Yamamoto,
Thanks, the patch you offered did make the _struct error disappeared. I will do
a bit more testing.
Dellair
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21124
STINNER Victor added the comment:
Python 3.2 is not getting bugfixes anymore, only 3.4 and 3.5 (and 2.7).
--
versions: +Python 3.4, Python 3.5 -Python 3.2
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21134
Changes by Jesús Cea Avión j...@jcea.es:
--
nosy: +jcea
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21120
___
___
Python-bugs-list mailing list
Antoine Pitrou added the comment:
bytes.translate() is much faster because it builds a C array of 256
items to fast table lookup, whereas str.translate() requires a Python
dict lookup for each character, which is much slower.
It should be easy to devise a simple hash table for the common
bagrat lazaryan added the comment:
guys,
the filename should be the first thing on the titlebar of idle editor window.
that way, on taskbar, one can see the file that's open in editor. i suggest the
format of editor's title be changed to:
xxx.py - python x.y.z - path
or whatever you will as
Roundup Robot added the comment:
New changeset 140c5da3dc82 by Benjamin Peterson in branch '3.4':
bail in unicode error's __str__ methods if the objects are not properly
initialized (closes #21134)
http://hg.python.org/cpython/rev/140c5da3dc82
New changeset afa7fb2cbe3b by Benjamin Peterson in
STINNER Victor added the comment:
Benjamin: I don't like your change. You silently ignore the error. I would
prefer to raise an exception on str(exc) if the Unicode exception object was
not properly initialized.
--
resolution: fixed -
status: closed - open
Benjamin Peterson added the comment:
I don't care as long as it doesn't segfault.
--
nosy: +benjamin.peterson
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21134
___
Changes by Tshepang Lekhonkhobe tshep...@gmail.com:
--
nosy: +tshepang
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21019
___
___
Changes by Tshepang Lekhonkhobe tshep...@gmail.com:
--
nosy: +tshepang
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21027
___
___
Changes by Tshepang Lekhonkhobe tshep...@gmail.com:
--
nosy: +tshepang
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21034
___
___
Terry J. Reedy added the comment:
Since a debug build (F7 in VS) is the only thing I have ever built, or that a
developer like me needs to build, that is not a limitation.
--
___
Python tracker rep...@bugs.python.org
Terry J. Reedy added the comment:
Bagrat, are you on XP by any chance? In Win7, all windows for a program are
attached to one program icon on the taskbar, which has the program name. When I
hover over the program icon, mini views of each window are displayed, with each
window view showing
Boštjan Mejak added the comment:
No one interested in fixing this anymore, despite the patch and all?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20942
___
Brett Cannon added the comment:
My Python free time is on Fridays, which is when I plan to make a final call
and either apply to Python 3.4 and 3.5 or just Python 3.5.
--
assignee: - brett.cannon
___
Python tracker rep...@bugs.python.org
New submission from Eijebong:
The parameter _vb_pattern parameter in cgi.valid_boundary has no reason to
exist since it's forced to a value later.
--
components: Library (Lib)
files: valid_boundary.patch
keywords: patch
messages: 215396
nosy: Eijebong
priority: normal
severity: normal
Raymond Hettinger added the comment:
What is the use case?
What would be the criteria for comparing functions? Would the func_name have
to match? Would the func_defaults have to match? Would the
f.__code__.co_names have to match (the internal variable names? Do the
function attributes in
Changes by Sreepriya Chalakkal sreepriya1...@gmail.com:
Added file: http://bugs.python.org/file34704/switch_while_decode2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19662
___
Raymond Hettinger added the comment:
Victor, I don't think the added complexity is worth 2k per named tuple class.
Every time I've gone down the path of lazy evaluation, I've paid an unexpected
price for it down the road. If the savings were huge, it might be worth it,
but that isn't the
bagrat lazaryan added the comment:
terry, i'm on 7 but i have my taskbar configured not to combine buttons. see
the screenshot attached.
(does anyone know why on earth i am not receiving email notifications when
someone posts to an issue i have started or i have commented to?)
--
Raymond Hettinger added the comment:
Nothing new is happening in this thread, so I'm closing it for the reasons
listed in the other posts.
The main issue is that the generic concept of break data into chunks tends to
occur is situations where the iterator protocol would be at odds with a
bagrat lazaryan added the comment:
well... ElementTree.py imports some c accelerators as can be seen at the end of
the file. i have no idea how to get to those accelerators, and even if i had, i
don't think i would make anything of them.
as far as the pure python code concerns in the rest of
Changes by bagrat lazaryan bagra...@live.com:
--
versions: +Python 3.4
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20198
___
___
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
Removed message: http://bugs.python.org/msg215397
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21130
___
Yury Selivanov added the comment:
Please review the attached patch.
Here's the new partial signature semantics:
foo(a, b, /, c, d, *args, e)
partial(foo, 10) - (b, /, c, d, *args, e)
partial(foo, 10, c=11) - (b, /, *, c=11, d, e)
partial(foo, 10, 20, 30) - (d, *args, e)
R. David Murray added the comment:
But since the two partial instances are (conceptually, I don't care how they
are implemented) two separate functions, then reasoning by analogy from two
identical functions not comparing equal, I would expect two partial instances
to not compare equal.
Charles-François Natali added the comment:
Zero-filling mmap's backing file isn't really optimal: why not use truncate()
instead? This way, it'll avoid completely I/O on filesystems that support
sparse files, and should still work on FS that don't.
--
nosy: +neologix
R. David Murray added the comment:
Of course, as soon as I hit send, I had second thoughts :). I guess a partial
is a binding, not a function.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21130
Ezio Melotti added the comment:
Other editors (e.g. Kate) use the format filename - editor name. This is
common for other applications as well (e.g. Firefox uses page title - Mozilla
Firefox), so the request seems reasonable to me.
If you want to go the extra mile you could have an option to
Médéric Boquien added the comment:
If I remember correctly the problem is that some OS like linux (and probably
others) do not really allocate space until something is written. If that's the
case then the process may get killed later on when it writes something in the
array.
Here is a quick
Richard Oudkerk added the comment:
Using truncate() to zero extend is not really portable: it is only guaranteed
on XSI-compliant POSIX systems.
Also, the FreeBSD man page for mmap() has the following warning:
WARNING! Extending a file with ftruncate(2), thus creating a big
hole, and then
New submission from William Ehlhardt:
The following Python runs unnecessarily slowly:
import fractions
fractions.Fraction(6249919, 625) ** 89993
The problem here is that Fraction.__pow__ constructs a new Fraction() to
return, and Fraction.__new__ tries to gcd to normalize the
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
nosy: +ezio.melotti, mark.dickinson, rhettinger
stage: - needs patch
versions: +Python 3.5 -Python 2.7, Python 3.2
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21136
paul j3 added the comment:
There are a couple of complications to using 'fileno'.
We probably don't want to close 'sys.stdin' or 'sys.stdout' (not even if they
are redirected to other files?). That means using:
open(sys.stdin.fileno(), ..., closefd=False)
'closefd', on the other hand,
Josiah Carlson added the comment:
Had some time to work on this today.
I was missing something in my earlier versions of the code, and have managed to
get overlapped IOs to work, so at least I'm not quite so far behind the dozen
or so core developers who know more about the Windows pieces
Raymond Hettinger added the comment:
This looks easily doable.
--
assignee: - rhettinger
keywords: +easy
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21136
___
New submission from Raymond Hettinger:
It is really nice to have the open/closed status in the __repr__ of file
objects:
open file 'data.txt', mode 'r' at 0x102c8ec90
closed file 'data.txt', mode 'r' at 0x102c8ec90
I would like to have the same for locks:
unlocked thread.lock object
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
keywords: +patch
Added file: http://bugs.python.org/file34707/fraction_pow.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21136
New submission from tanbro:
when new a mimetypes.MimeType instance in a my Windows, whose default coding is
mbcs, UnicdeDecodeError occurred.
Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win
32
Type help, copyright, credits or license for more information.
from
Nikolaus Rath added the comment:
Thanks for your feedback! I've attached an updated patch.
--
Added file: http://bugs.python.org/file34708/issue20375.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20375
Changes by Nikolaus Rath nikol...@rath.org:
Added file: http://bugs.python.org/file34709/issue20375.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20375
___
Berker Peksag added the comment:
Here's a patch with a test. Example repr of threading.Lock():
$ ./python -c import threading; print(threading.Lock())
unlocked _thread.lock object
--
keywords: +patch
nosy: +berker.peksag
Added file:
New submission from Terry J. Reedy:
PEP 8 specifies a limit of 72 chars for flowing text (comments, multiline
strings). The current default limit for Idle's Format / Reformat Paragraph is
70. Increase it to PEP 8's 72.
--
messages: 215417
nosy: terry.reedy
priority: normal
severity:
Changes by Terry J. Reedy tjre...@udel.edu:
--
components: +IDLE
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21139
___
___
Python-bugs-list
tanbro added the comment:
and in line 249, changes:
if isinstance(ctype, unicode):
ctype = ctype.encode(default_encoding) # omit in 3.x!
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21138
New submission from Terry J. Reedy:
If possible, when saving an instance of an OutputWindow, the file type should
default to .txt (or possibly even nothing) instead of .py. At present,
OutputWindows are only used for Find in Files (grep) output, which is very much
not Python code. The same
eryksun added the comment:
multiprocessing.connection uses the _winapi module for overlapped I/O and named
pipes in case you're looking for examples:
http://hg.python.org/cpython/file/3.4/Lib/multiprocessing/connection.py
--
nosy: +eryksun
___
New submission from Zachary Ware:
Attached is a patch that prevents mentioning Perl in the Windows build output,
thereby avoiding giving the indication that Perl is necessary to build Python.
To make this work, the patch converts PCbuild/build_ssl.py into
PCbuild/prepare_ssl.py and removes
Terry J. Reedy added the comment:
The general issue of Idle title bars is definitely not finished, though I may
close this issue and open others.
1. 'Python' versus Idle' versus neither in titles (assuming not both).
1a. Shell: Since the link in msg183874 is dead, I don't know what Bagrat
Raymond Hettinger added the comment:
Sorry, I don't think this makes the tests any better as all. It is code churn
for no benefit.
In our own code, the more specific tests risk hiding important details behind
the abstraction (losing knowledge of what is actually tested). For example, I
Raymond Hettinger added the comment:
This is approved. Go ahead and apply the patch.
One minor nit, please position the three new views classes before the _Link
class rather than after.
--
assignee: rhettinger - serhiy.storchaka
versions: +Python 3.5 -Python 3.4
81 matches
Mail list logo