anon added the comment:
Pros for x.bits being a view:
- seems slightly cleaner (in my opinion)
- can potentially abstract slicing bits without copying the underlying int
(e.g. x.bits[2:][4:])
Pros for x.bits being a function:
- Victor's point
- no need to depreciate x.bit_length
- no need to
Georg Brandl added the comment:
Clarifying some comments in this one.
--
Added file:
http://bugs.python.org/file36778/exception_proper_subclass_matching_v3.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12029
Changes by Georg Brandl ge...@python.org:
Removed file:
http://bugs.python.org/file36776/exception_proper_subclass_matching.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12029
___
Mark Lawrence added the comment:
Can someone respond to this please as I know nothing about CentOS builds.
--
nosy: +BreamoreBoy
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19372
___
Changes by Mark Lawrence breamore...@yahoo.co.uk:
--
nosy: +orsenthil
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19402
___
___
Python-bugs-list
Georg Brandl added the comment:
This needs a lot more information, such as the full config.log and output of
make.
Kernel 2.6.18 is also quite old, so if there is no feedback if this is still an
issue I'd suggest to close the report.
--
nosy: +georg.brandl
status: open - pending
Mark Lawrence added the comment:
The patch is a one line change, can we have a commit review please.
--
nosy: +BreamoreBoy
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19434
___
Changes by Georg Brandl ge...@python.org:
--
status: pending - open
title: getaddrinfo() bug - configure and compile problems with older CentOS
releases
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19372
anon added the comment:
Giving it more thought: to get the int we'd need something like
int(x.bits[2:][4:]) which seems quite annoying for the general case of
int(x.bits[0:52]). So actually I'm not sure that views would add any more
abstraction for their extra complexity without becoming a
Mark Lawrence added the comment:
A quick glance says the patch is okay so can we have a commit review please.
--
nosy: +BreamoreBoy
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19460
___
Georg Brandl added the comment:
While everybody is throwing ideas around: what about the opposite?
If extracting bit ranges from bitfields is common enough to warrant this
addition, updating bitfields with a bit range is probably just as common.
This'd need something like
i.with_bits(value,
Roundup Robot added the comment:
New changeset 41f46f7f2722 by Georg Brandl in branch '3.4':
Closes #19434: fix copy-paste error in MIMENonMultipart docstring.
https://hg.python.org/cpython/rev/41f46f7f2722
--
nosy: +python-dev
resolution: - fixed
stage: - resolved
status: open -
Roundup Robot added the comment:
New changeset a53f2cf4b556 by Georg Brandl in branch '2.7':
Closes #19434: fix copy-paste error in MIMENonMultipart docstring.
https://hg.python.org/cpython/rev/a53f2cf4b556
--
___
Python tracker
Drekin added the comment:
stijn: You are mixing two issues here. One is reading text from a file. There
is no problem with it. You just call open(path,
encoding=the_encoding_of_the_file). Since the encoding of the file depends on
the file, you should provide the information about it.
Another
Roundup Robot added the comment:
New changeset 1e0156aef491 by Georg Brandl in branch '3.4':
Closes #18729: minor markup improvement.
https://hg.python.org/cpython/rev/1e0156aef491
--
nosy: +python-dev
resolution: - fixed
stage: patch review - resolved
status: open - closed
Antoine Pitrou added the comment:
I'm worried about the runtime cost of this. Code like this is an extremely
common idiom and should remain fast:
try:
x = d[key]
except KeyError:
# do something else
--
___
Python tracker
stijn added the comment:
Drekin: you're right for both input and output. Using encoding with plain
open() works just fine and using the latest win-unicode-console does give
correct output for the second example as well. Thanks!
--
___
Python
anon added the comment:
@Georg: I don't think it would be as common but do agree it'd be useful.
I think it can be implemented efficiently in pure Python currently.
def with_bits(i, value, pos, width=1):
width = min(width, value.bit_length())
mask = ((1 width) - 1)
v = value mask
i =
Georg Brandl added the comment:
This is why I proposed it (and also because I had to write that quite a few
times already). Efficient maybe, but very hard to get right on the first try :)
--
___
Python tracker rep...@bugs.python.org
Georg Brandl added the comment:
Agreed.
Since type has __subclasscheck__ (why I don't know) this might result in a
slowdown since all checks have to go through calling it in PyObject_IsSubclass.
Just noticed that given_exception_matches_inner can be simplified a bit since
PyObject_IsSubclass
Georg Brandl added the comment:
Quick microbenchmark:
try:
{}[a]
except KeyError:
pass
original tip: 1.35 usec
with patch v3: 1.55 usec
so it's about 15% slowdown for catching a simple exception on my machine.
--
Antoine Pitrou added the comment:
Since type has __subclasscheck__ (why I don't know)
Ouch, really? That means the PyType_IsSubtype path in PyObject_IsSubclass() is
never taken?
I think we should add a tp_subclasscheck slot to minimize the general cost of
this. Also, try to see if there
Georg Brandl added the comment:
OK, with these two patches (speedup and v4) I can't see a significant slowdown
anymore.
--
Added file:
http://bugs.python.org/file36779/pyobject_issubclass_isinstance_speedup.patch
___
Python tracker
Changes by Georg Brandl ge...@python.org:
Added file:
http://bugs.python.org/file36780/exception_proper_subclass_matching_v4.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12029
___
New submission from Artur de Sousa Rocha:
Tables in pydoc are formatted incorrectly -- some lines are missing. Example in
Python 3.4.1:
help('TUPLES')
...
++--++
| Operation | Result
New submission from Georg Brandl:
With the introduction of ABCs, PyObject_IsInstance (and for this issue,
everything is also valid for PyObject_IsSubclass) has to check for a type's
__instancecheck__ before falling back to the built-in behavior.
However, the type type has an __instancecheck__
Georg Brandl added the comment:
IsSubclass speedup patch now tracked in #22540.
--
dependencies: +speed up isinstance and issubclass for the usual cases
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12029
Mark Dickinson added the comment:
- no need to depreciate x.bit_length
No matter how this issue progresses, deprecating `int.bit_length` should be out
of the question. Much better to have (somewhat) duplicated functionality than
to gratuitously break code that's already using
Matthias Klose added the comment:
fixed in 2.7, 3.4 and 3.5
--
resolution: - fixed
status: open - closed
versions: +Python 2.7 -Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18096
Matthias Klose added the comment:
fixed in 2.7, 3.4 and 3.5
--
resolution: - fixed
status: open - closed
versions: +Python 2.7, Python 3.5
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17219
anon added the comment:
All I had meant by depreciating was changing the x.bit_length documentation to
point towards len(x.bits).
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19915
___
New submission from Dima Tisnek:
Original use case:
I want to mock something that on invocation does 2 things:
* updates database
* returns custom, unrelated value
The problem:
side_effect is a catch-all setting that is used for:
* true side-effects
* return values
* exceptions
Moreover,
R. David Murray added the comment:
Can you explain why you can't use side_effect to set the return value?
--
nosy: +r.david.murray
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22541
___
Dima Tisnek added the comment:
I can, as shown in workaround #2.
However it's hackey when true side-effect's own return value has nothing in
common with return value for the mock.
The shortest workaround I managed is this:
mock.Mock(side_effect=lambda *arg: db.update(...) or my_return_value)
R. David Murray added the comment:
Oh, sorry, I missed the workarounds when I read the issue. So your issue is
you want to use a lambda rather than a full function for the side effect and it
looks ugly.
I agree that given the names 'side_effect' and 'return_value' you'd think
return_value
Stefan Krah added the comment:
FWIW, I think it would be good to make this change early in the
3.5 release cycle, so issues can be found. Sebastian, do you
have an idea when the change will be decided in numpy?
Regarding the discussion here ...
https://github.com/numpy/numpy/issues/5085
HCT added the comment:
maybe someone should start a PEP with all of the thoughts organized?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19915
___
Shy Shalom added the comment:
Any chance this would be merged to 2.7 as well?
The comment from 2014-01-11 06:33:18 says 2.7 but PC/pyconfig.h still has
#define hypot _hypot
--
nosy: +Shy.Shalom
___
Python tracker rep...@bugs.python.org
STINNER Victor added the comment:
Yes, it's a good idea to start a PEP to modify most important builtin
types like int and str.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19915
___
anon added the comment:
That's something that a Python comitter would have to do isn't it?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19915
___
STINNER Victor added the comment:
That's something that a Python comitter would have to do isn't it?
Python is open. Anyone can propose an enhancement (a PEP).
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19915
Serhiy Storchaka added the comment:
There is complete implementation of FileIO in pure Python in issue21859. It is
free from this bug.
import _pyio as io
class MyIO(io.FileIO):
... def flush(self):
... print('closed:', self.closed)
...
f = MyIO('test.out', 'wb')
f.close()
TJ added the comment:
Thanks for the help. For my linux box, I have no issue. This is Ubuntu 13.10:
Linux localhost 3.11.0-26-generic #45-Ubuntu SMP Tue Jul 15 04:02:06 UTC
2014 x86_64 x86_64 x86_64 GNU/Linux
2.7.5+ (default, Feb 27 2014, 19:37:08)
[GCC 4.8.1]
However, I'm still
Changes by STINNER Victor victor.stin...@gmail.com:
--
title: Possible Memory Leak with 'shelve' - bsddb memory leak on Mac OS X 10.9
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22534
___
Ethan Furman added the comment:
I, myself, wrote:
-
At least, it will until we fix that bug. ;)
Happily, reading the whole documentation revealed that non-integer values are
allowed, so it's not a bug. :)
--
___
Python tracker
TJ added the comment:
No issue with 3.4 on the Mac box.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22534
___
___
Python-bugs-list mailing
Terry J. Reedy added the comment:
Works great. Thanks.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22537
___
___
Python-bugs-list mailing
Ethan Furman added the comment:
Ignore that last comment -- I don't know what I did yesterday, but unary minus
is working as expected today. :/
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22533
Serhiy Storchaka added the comment:
Synchronized with the tip. _io.FileIO now behave same as _pyio,FileIO when
there is a NUL in name.
--
Added file: http://bugs.python.org/file36782/pyio_fileio_6.patch
___
Python tracker rep...@bugs.python.org
Changes by Serhiy Storchaka storch...@gmail.com:
--
assignee: - ronaldoussoren
components: +Extension Modules, Macintosh -Library (Lib)
nosy: +ronaldoussoren
type: - resource usage
___
Python tracker rep...@bugs.python.org
Changes by Serhiy Storchaka storch...@gmail.com:
--
status: open - pending
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3824
___
___
STINNER Victor added the comment:
[10:55:57] ~$ python -c import anydbm;d = anydbm.open('bla',
'c');print(type(d))
class 'bsddb._DBWithCursor'
Hum, on Mac OS X, I don't have the bsddb module installed by default. How did
you install it?
--
___
Terry J. Reedy added the comment:
Further experiments reveal that the **s mean 'the undo buffer is not empty'.
Enter
import time; time.sleep(2)
and ** do not disappear until sleep finishes and a new prompt is displayed.
Enter a character at the prompt and ** appear. Delete the char and **
Changes by Terry J. Reedy tjre...@udel.edu:
--
dependencies: +IDLE - Add an extension configuration dialog
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20577
___
Ned Deily added the comment:
Thanks for the detailed information. I'm not able to reproduce on OS X 10.9.5
with the python.org Python 2.7.8 which builds and links with its own copy of
Sleepycat DB 4.7.25. However, I do see the memory leak when using a MacPorts
Python 2.7.8 that is linked
Serhiy Storchaka added the comment:
May be this patch will fix the issue.
--
components: +Interpreter Core
keywords: +patch
nosy: +serhiy.storchaka
stage: - patch review
type: - behavior
versions: -Python 2.6
Added file: http://bugs.python.org/file36783/issue8627.patch
TJ added the comment:
I should have mentioned that this a Macports environment. So python, bsddb all
come from there. Looks like that might be the culprit.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22534
New submission from 700eb415:
Trying to run the python interpreter in a chroot fails if /dev/urandom is not
present. Removing the nodev flag from the filesystem is not ideal in many
situations.
Instead, we should utilize functions such as OpenBSD's arc4random(3) and the
new potential
Terry J. Reedy added the comment:
As the 'crash' seems to have been solved, this should probably be closed and a
new issue about encodings opened. Also, since the re module used to search
lines within files can work with both bytes and strings, there might be an
option to search undecoded
Ned Deily added the comment:
Yeah, and I'm not sure why they have their build pegged to bdb 4.6; they
provide newer ports as well. I think we can close this issue then. Perhaps
you could open a MacPorts issue and ask them to update their python27 port to
use at least db47.
--
Changes by Ned Deily n...@acm.org:
--
title: bsddb memory leak on Mac OS X 10.9 - bsddb memory leak with MacPorts
bdb 4.6
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22534
___
Alex Gaynor added the comment:
arc4random() should be avoided IMO, on many systems (including OS X) it really
is still arc4; this is basically a dupe of http://bugs.python.org/issue22181
--
nosy: +alex
resolution: - duplicate
status: open - closed
Changes by Serhiy Storchaka storch...@gmail.com:
--
status: open - pending
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13407
___
___
700eb415 added the comment:
It's worth noting that LibreSSL has now enabled the blocked code. If anyone is
interested, I would be willing to help port it.
--
nosy: +700eb415
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22181
Changes by Berker Peksag berker.pek...@gmail.com:
--
components: +Devguide
keywords: +easy
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13472
___
Serhiy Storchaka added the comment:
The actual fix in the previous issue, as in Python 3, was to always write the
filename, but with errors replaced with '?/.
Filename is optional in gzip file. If it can't be encoded to Latin1, it should
be just omitted.
Here is a patch which backports the
Terry J. Reedy added the comment:
A few years ago there was an issue where starting a new user process left the
old user process continuing as a zombie. This time, it seems to be the idle
process that becomes the zombie. I determined this by starting Idle in
edit-only mode, noting the memory
Terry J. Reedy added the comment:
I am not particularly interested in having Idle run on no-uhicode builds. I
believe the usecase is to reduce the memory footprint of a python installation,
and that would suggest not including tcl/tk, tkinter, and idlelib.
Having Idle tests not fail on such
Terry J. Reedy added the comment:
This would have to be an extension, default off unless overridden, which is why
I added config-extensions as dependency.
--
dependencies: +IDLE - Add an extension configuration dialog
title: Automatic insertion of the closing parentheses, brackets, and
Changes by Terry J. Reedy tjre...@udel.edu:
--
title: Enhance 2.7 IDLE to exec IDLESTARTUP/PYTHONSTARTUP on restart - IDLE:
exec IDLESTARTUP/PYTHONSTARTUP on restart
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5233
Andriy Sokolovskiy added the comment:
Hi! Here is first version of patch. What I've done:
* Ported 10 new image formats from PIL (tests included)
* Improved existing file detections like PIL does.
* Add some byte manipulation routines
One more thing - I removed `ord()` calls, because python3
Changes by Andriy Sokolovskiy sokand...@yandex.ru:
Added file: http://bugs.python.org/file36786/issue21574.zip
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21574
___
Terry J. Reedy added the comment:
Closing since the immediate problem has been fixed and there is a reference to
this in #21696
--
dependencies: -Idle: test configuration files
resolution: - fixed
___
Python tracker rep...@bugs.python.org
Terry J. Reedy added the comment:
I closed #12274, but it might be consulted before closing this.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21696
___
Changes by Ned Deily n...@acm.org:
--
nosy: +georg.brandl
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22539
___
___
Python-bugs-list mailing
Terry J. Reedy added the comment:
The patch for #17511 did not solve the issue; I proposed a revision in #22179.
A patch for that may fix this also.
--
dependencies: +Idle. Search dialog found text not highlited on Windows
___
Python tracker
Gregory P. Smith added the comment:
thanks. btw an alternative type check to consider in these situations:
PyIndex_Check
https://docs.python.org/2/c-api/number.html#c.PyIndex_Check
but what you wrote works.
--
nosy: +gregory.p.smith
___
Python
New submission from Rémi Rampin:
warnings._processoptions is called very early, before site-packages are
enabled. Because of this, using a non-standard 'category' will almost certainly
fail with the message:
Invalid -W option ignored: invalid module name: '...'
The -W option would be a
Santiago Gala added the comment:
Something like this should do it:
$ diff -u /usr/lib/python2.7/wsgiref/simple_server.py{~,}
--- /usr/lib/python2.7/wsgiref/simple_server.py~2014-10-02
23:32:47.718382895 +0200
+++ /usr/lib/python2.7/wsgiref/simple_server.py 2014-10-02 14:36:10.662220865
Terry J. Reedy added the comment:
Which tk? Did you ever activate Debugger in the session (known problem, see
#15347)? Can you reproduce this with a series of step you can post? How were
you shutting down (I have had problems with 'Close Windows on a Windows Taskbar
icon right-click menu)?
Mark Lawrence added the comment:
Can a linux guru comment on this please.
--
nosy: +BreamoreBoy
versions: +Python 2.7, Python 3.4, Python 3.5 -Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17824
Mark Lawrence added the comment:
The patch changes four lines in Modules/_ctypes/libffi/configure.ac which means
nothing to me, can someone review it please.
--
nosy: +BreamoreBoy
versions: +Python 3.5
___
Python tracker rep...@bugs.python.org
Mark Lawrence added the comment:
@Eric what is your opinion on this?
--
nosy: +BreamoreBoy
type: - enhancement
versions: +Python 3.5
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18027
___
Ned Deily added the comment:
From the traceback, it does appear that the debugger was in use. Since
there's not much else to go on here, I suggest closing this as a duplicate of
#15347.
--
assignee: ronaldoussoren -
title: IDLE crash on OS X 1.9 upon shut-down with many windows open
Terry J. Reedy added the comment:
Divyanshu, please do not hijack by changing the title to a different issue.
There are multiple causes for the message, some unknown. Your non-standard
system is different from that of clikkeb.
--
title: IDLE: IDLE's subprocess didn't make
Terry J. Reedy added the comment:
I have a recent idea that there should be a separate and persistent execution
process for each file run. This would make it easy to persist the cmd lines
args for a particular module.
--
versions: +Python 3.4, Python 3.5 -Python 3.1, Python 3.2
Mark Lawrence added the comment:
Can someone please confirm that my assessment of this as an enhancement is
correct, thanks.
--
nosy: +BreamoreBoy
type: behavior - enhancement
versions: +Python 3.5 -Python 2.6
___
Python tracker
Mark Lawrence added the comment:
Who is best placed to look at this as nobody is listed on the experts index?
--
nosy: +BreamoreBoy
versions: +Python 3.4, Python 3.5
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16425
Terry J. Reedy added the comment:
Steve, would it possible for the installer to tell users to Restart to get
(Idle) icons working properly? (Assuming that this cannot be made unnecessary.)
--
components: -IDLE
nosy: +steve.dower
title: IDLE 3.3.2 Windows taskbar icon regression -
Mark Lawrence added the comment:
Can we or can't we remove the check as Eric has proposed in msg201874?
--
nosy: +BreamoreBoy
versions: +Python 3.5 -Python 3.4
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19468
Mark Lawrence added the comment:
Sorry I've no idea whether this should be set to enhancement request, behaviour
or what.
--
nosy: +BreamoreBoy
versions: +Python 3.5 -Python 3.3
___
Python tracker rep...@bugs.python.org
Terry J. Reedy added the comment:
#21339, closed as a duplicate of this, has a traceback might be helpful.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15347
___
Terry J. Reedy added the comment:
I added a note to #21339 about the traceback here.
--
resolution: - duplicate
stage: - resolved
status: open - closed
superseder: - IDLE crash on OS X 10.9 upon shut-down with many windows open
___
Python tracker
Changes by Yury Selivanov yseliva...@gmail.com:
--
nosy: +yselivanov
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22540
___
___
Python-bugs-list
Mark Lawrence added the comment:
@Stefan can you provide a patch for this?
--
nosy: +BreamoreBoy
versions: +Python 3.5 -Python 3.1, Python 3.2, Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19477
Mark Lawrence added the comment:
If this is referring to the box on docs.python.org shouldn't this be logged
elsewhere?
--
nosy: +BreamoreBoy
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19489
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
keywords: +easy
nosy: +ezio.melotti
stage: - needs patch
type: - enhancement
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19489
___
Steve Dower added the comment:
This is probably because the program items are advertised. I have 2.7 and 3.3
installed, and when I pin the 3.3 Idle it switches to the 2.7 one. I guess
there's a GUID somewhere that makes the two icons identical, but I don't know
where that would be. This
Mark Lawrence added the comment:
Just a gentle reminder guys.
--
nosy: +BreamoreBoy
versions: +Python 3.5
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19469
___
Mark Lawrence added the comment:
@Yury do you agree with this?
--
nosy: +BreamoreBoy, yselivanov
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19472
___
101 - 200 of 238 matches
Mail list logo