holger krekel added the comment:
On Sun, Feb 10, 2013 at 12:41 PM, Antoine Pitrou rep...@bugs.python.orgwrote:
Antoine Pitrou added the comment:
Please don't commit I think we still need a discussion as to whether
subtests or paramaterized tests are a better approach. I certainly
don't
holger krekel added the comment:
On Sun, Feb 10, 2013 at 12:43 PM, Nick Coghlan rep...@bugs.python.orgwrote:
Nick Coghlan added the comment:
You can use subtests to build parameterized tests, you can't use
parameterized tests to build subtests.
I doubt you can implement parametrized tests
Mark Dickinson added the comment:
Hmm; good point. Well, +1 to the functionality, anyway; I'll leave the
discussion about the name.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4591
New submission from Chris Withers:
from types import new_class
from datetime import datetime
new_class('tdatetime', (datetime, ), kwds={'foo':'bar'})
Traceback (most recent call last):
File console, line 1, in module
File /src/Python-3.3.0/Lib/types.py, line 52, in new_class
return
New submission from Milko Krachounov:
When copying the mode of a file with copy, copy2, copymode, copystat or
copytree, all permission bits are copied (including setuid and setgit), but the
owner of the file is not. This can be used for privilege escalation.
An example:
-rwSr--r-- 1 milko
Serhiy Storchaka added the comment:
There is a problem with test_pwd on 64-bit platform. It expects KeyError on
pwd.getpwuid(sys.maxsize). Actually the test is not looks robust. On 32-bit
platform sys.maxsize = 2**31-1 2**32 and this value only by chance was not in
the user database. On
Nick Coghlan added the comment:
On Mon, Feb 11, 2013 at 11:46 AM, Terry J. Reedy rep...@bugs.python.org wrote:
I am also puzzled by the 'from None' part in
+ raise TypeError('{!r}' is not a Python function.format(func)) from None
While I remember that being in the pydev discussion and while
Antoine Pitrou added the comment:
what if there are 500 subtests in a loop and you don't want 500 failures to be
registered for that test case?
Parametered tests have the same issue. In this case you simply don't use
subtests
or test cases. On the other hand, the issue doesn't exist in most
New submission from Daniel Black:
I think my original implementation of the SNI callback to see a original
sslcontext was wrong. It would be much more useful for the
SSLContext.set_servername_callback to take a callable and an object as an
argument.
This would allow constructs like the
Daniel Black added the comment:
Ack. Have fix. Simple if self.certfile or self.keyfile: test added before
load_cert_chain.
part way through developing test. Thinking #17181 would help.
--
___
Python tracker rep...@bugs.python.org
Michael Foord added the comment:
I think you're right! Thanks.
--
assignee: - michael.foord
resolution: fixed -
status: closed - open
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17052
Jesús Cea Avión added the comment:
we have a -1, so I close this as rejected.
I still think it is a valuable idea to pursuit.
--
resolution: - rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
Changes by Jesús Cea Avión j...@jcea.es:
--
stage: - committed/rejected
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17152
___
___
Changes by Florent Xicluna florent.xicl...@gmail.com:
--
nosy: +flox
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17044
___
___
Python-bugs-list
Roundup Robot added the comment:
New changeset ece0a2e6b08e by Michael Foord in branch '2.7':
Correction to issue 17052 fix
http://hg.python.org/cpython/rev/ece0a2e6b08e
New changeset 867763eb6985 by Michael Foord in branch '3.2':
Correction to issue 17052 fix
New submission from Antoine Pitrou:
Having a dedicated optional attribute on KeyboardInterrupt receiving the signal
number would be useful in certain circumstances, for example if you want to
propagate the signal to a child process.
--
components: Extension Modules
messages: 181894
Michael Foord added the comment:
I still don't particularly like the idea of the assert_* methods returning
something.
If the call args tuples had args and kwargs attributes, for which there are
outstanding feature requests, then you could simply do:
my_mock(1, someobj(), bar=someotherobj())
R. David Murray added the comment:
Thanks, Jeremy.
--
resolution: - fixed
stage: - committed/rejected
status: open - closed
type: - behavior
versions: +Python 2.7, Python 3.2 -Python 3.5
___
Python tracker rep...@bugs.python.org
Antoine Pitrou added the comment:
This would allow constructs like the following where self can be used
within the callback. Example:
def cb_sni(ssl_sock, server_name, self):
self.sniname = server_name
self.context.set_servername_callback(cb_sni, self)
The
Eric V. Smith added the comment:
+1 for PyIndex_AsLong()
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4591
___
___
Roundup Robot added the comment:
New changeset bbeff2958cc5 by R David Murray in branch '3.2':
#17064: fix sporadic permission errors in test_mailbox on windows.
http://hg.python.org/cpython/rev/bbeff2958cc5
New changeset 3e3915cbfde3 by R David Murray in branch '3.3':
Merge: #17064: fix
R. David Murray added the comment:
Lacking a reproducer, there's not much we can do here, so closing.
--
resolution: - works for me
stage: test needed - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
Changes by R. David Murray rdmur...@bitdance.com:
--
type: - behavior
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17171
___
___
Changes by Barry A. Warsaw ba...@python.org:
--
nosy: +barry
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15767
___
___
Python-bugs-list mailing
Barry A. Warsaw added the comment:
For me, it mostly comes down to whether end-users are expected to see such
errors generally or not. We see ImportErrors all the time, and they are
clearly errors. If we're expected to see and deal with MNF, and if in such
cases it's generally considered an
Zachary Ware added the comment:
Sure can. With a little luck, I'll have the patch ready later today; with less
luck it'll be sometime later this week.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16935
New submission from Guido Reina:
In the file: Lib/_markupbase.py, function: _parse_doctype_element there is:
if '' in rawdata[j:]:
return rawdata.find(, j) + 1
rawdata[j:] is being scanned twice.
It would be better to do:
pos = rawdata.find(, j)
if pos != -1:
return pos + 1
Same
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
assignee: - ezio.melotti
components: +Library (Lib)
nosy: +ezio.melotti
stage: - needs patch
versions: -Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python
3.5
___
Python tracker
Serhiy Storchaka added the comment:
if '' in rawdata[j:]:
return rawdata.find(, j) + 1
See issue17170 for this idiom.
--
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17183
Roundup Robot added the comment:
New changeset f83581135ec4 by R David Murray in branch '3.2':
#17171: fix email.encoders.encode_7or8bit when applied to binary data.
http://hg.python.org/cpython/rev/f83581135ec4
New changeset cabcddbed377 by R David Murray in branch '3.3':
Merge: #17171: fix
R. David Murray added the comment:
Since this was straightforwardly similar to the issue 16564 fix I didn't bother
with a review. The 2.7 commit is backporting the behavior-confirming test,
just for thoroughness.
--
resolution: - fixed
stage: needs patch - committed/rejected
status:
Serhiy Storchaka added the comment:
(perhaps we need as PyNumber_AsLongIndex() to do the direct conversion
to a C long, it would make things easier in many cases)
In this case we need PyNumber_AsLongAndOverflowIndex() and
PyNumber_AsUnsignedLongIndex(). And a lot of other parallel functions
Serhiy Storchaka added the comment:
Not technically the topic of this issue, but should we just lock
down _Py_Uid_Converter() to ints?
I just copied this code from PyArg_ParseTuple*() for 'l' format.
This is still accepted:
os.setuid(Decimal(1000.2))
Any C implemented function which
Zachary Ware added the comment:
I think this patch should cover the test and Doc changes necessary. Of course,
let me know if it doesn't :)
--
Added file: http://bugs.python.org/file29039/issue16935.v2.diff
___
Python tracker rep...@bugs.python.org
Stefan Krah added the comment:
Serhiy Storchaka rep...@bugs.python.org wrote:
Not technically the topic of this issue, but should we just lock
down _Py_Uid_Converter() to ints?
I just copied this code from PyArg_ParseTuple*() for 'l' format.
os.setuid(Decimal(1000.2))
I know that this
Guido van Rossum added the comment:
Antoine, what about the decorator? I've come across a few use cases.
--Guido van Rossum (sent from Android phone)
On Feb 10, 2013 10:14 AM, Antoine Pitrou rep...@bugs.python.org wrote:
Antoine Pitrou added the comment:
+1 for runcall() and the context
Chris Jerdonek added the comment:
Thanks a lot for taking care of this issue, Michael.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17052
___
Giampaolo Rodola' added the comment:
See issue 9285 in which I wrote a decorator for profile/cProfile.
That can be modified to work both as a decorator or a context manager by using
contextlib.contextmanager.
Shall I continue in issue 9285 and rewrite that patch?
--
nosy:
Brett Cannon added the comment:
Right, so what's typical? =) I mean do most people see ImportError for optional
modules (e.g. not on support platforms), or do most people see ImportError
because they messed up and tried to import something that they expected but
actually isn't there for some
Franck Michea added the comment:
Here is at least a correction of Descriptors' HowTo. There are two versions
since some stuff differs (object inheritance, ...).
Here are some of my interrogations though:
- RevealAccess is not using instance parameter, so value is shared. Is this
intended?
-
Changes by Franck Michea franck.mic...@gmail.com:
Added file:
http://bugs.python.org/file29041/12077_descriptor_howto_python2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12077
___
Guido van Rossum added the comment:
Sure, I will comment on that issue.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17130
___
___
Guido van Rossum added the comment:
Brief comments:
- Please don't call it profile -- we already have a module by that name.
- Please make it so that both the decorator and context manager can specify a
file where to dump the raw data -- basically it needs to have the same
functionality as
Giampaolo Rodola' added the comment:
Ok, will look into this soon.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9285
___
___
Python-bugs-list
Barry A. Warsaw added the comment:
On Feb 11, 2013, at 05:31 PM, Brett Cannon wrote:
Right, so what's typical? =) I mean do most people see ImportError for
optional modules (e.g. not on support platforms), or do most people see
ImportError because they messed up and tried to import something
Serhiy Storchaka added the comment:
There is a problem with test_pwd on 64-bit platform.
Fixed in changesets a0983e46feb1 and 1e9fa629756c: Raise KeyError instead of
OverflowError when getpwuid's argument is out of uid_t range.
--
___
Python
Antoine Pitrou added the comment:
Antoine, what about the decorator? I've come across a few use cases.
I don't know, I'm thinking that there should be one obvious way to do
it :-)
By that I mean that the context manager is more generic than the
decorator. Or do you want to decorate functions
Antoine Pitrou added the comment:
In this case we need PyNumber_AsLongAndOverflowIndex() and
PyNumber_AsUnsignedLongIndex(). And a lot of other parallel functions
for other cases. This can exponentially increase a number of functions.
I don't think it will be exponential :-)
--
Antoine Pitrou added the comment:
(functools.partial is another solution to the problem)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17181
___
Guido van Rossum added the comment:
If I quickly want to profile one function, with the decorator I have to
insert a with-statement in its body and mess with the indentation of the
entire body. With a decorator it's just a one-line insertion.
--
___
Antoine Pitrou added the comment:
Ah, fair enough.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17130
___
___
Python-bugs-list mailing list
Brett Cannon added the comment:
Screw it, I'll go with ModuleNotFoundError since it is a subclass of
ImportError and so it might come off as weird as saying the superclass is an
Error but the subclass is not.
--
___
Python tracker
New submission from Roy Smith:
# Python 2.7.3
# Ubuntu 12.04
import re
pattern = r( ?Pphrase.*)
regex = re.compile(pattern, re.VERBOSE)
The above raises an exception in re.compile():
Traceback (most recent call last):
File ./try.py, line 6, in module
regex = re.compile(pattern,
Changes by Roy Smith r...@panix.com:
--
nosy: +roysmith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15606
___
___
Python-bugs-list mailing list
Changes by Florent Xicluna florent.xicl...@gmail.com:
--
nosy: +flox, haypo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17170
___
___
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
components: +Regular Expressions
nosy: +ezio.melotti, mrabarnett
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17184
___
Serhiy Storchaka added the comment:
See also related issue11204.
--
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15606
___
Giampaolo Rodola' added the comment:
As for runcall() we haven't the ability to freely support kwargs *and* filename.
I see two possibilities.
Kill kwargs, as such:
+def runcall(func, *args, filename=None, sort=-1):
+Run func(*args) under profiler, optionally saving results in
+
Changes by Roy Smith r...@panix.com:
--
nosy: +roysmith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11204
___
___
Python-bugs-list mailing list
Chris Jerdonek added the comment:
what if there are 500 subtests in a loop and you don't want 500 failures to
be
registered for that test case?
Parametered tests have the same issue. In this case you simply don't use
subtests
or test cases.
Right, but then you lose out on both of the
Matthew Barnett added the comment:
It does look like a duplicate to me.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17184
___
___
Changes by Brett Cannon br...@python.org:
--
nosy: -brett.cannon
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16997
___
___
Python-bugs-list
Changes by Yaroslav Halchenko yarikop...@gmail.com:
--
nosy: -Yaroslav.Halchenko
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16997
___
___
Changes by Michael Foord mich...@voidspace.org.uk:
--
assignee: - michael.foord
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15351
___
___
Changes by Serhiy Storchaka storch...@gmail.com:
Removed file: http://bugs.python.org/file29020/pickle_overflow-3.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13555
___
Serhiy Storchaka added the comment:
Test updated too. Now it doesn't try to write a string larger than 2 GiB (it's
impossible), instead writes a lot of shorter strings with total size larger
than 2 GiB.
--
Added file: http://bugs.python.org/file29042/pickle_overflow-4.diff
Terry J. Reedy added the comment:
A related issue: the speed of finding and hence replacing chars in strings is
known to have regressed in 3.3 relative to 3.2, especially on Windows. For long
strings, that will negate in 3.3 the speedup for the initial method call. See
#16061, with patches.
New submission from Chris Withers:
Sticking an issue in at Michael's request...
Older versions of mock had a helper called mocksignature.
In newer versions, create_autospec replaces this, but doesn't get it right
sometimes:
from inspect import getargspec
from mock import create_autospec
New submission from Chris Withers:
Python 2 had a private but usable way of introspecting and manipulating
registered atexit handlers by way of the atexit._exithandlers.
In Python 3, registering and unregistering are handled, but there is no longer
a way to see what atexit handlers are
New submission from Larry Hastings:
Python 3.3 added a nice new feature: if you don't supply enough positional
parameters to a function, it tells you the names of the positional parameters
you omitted.
Unfortunately, the code that prints this error message assumes that the
function is
Changes by Larry Hastings la...@hastings.org:
--
keywords: +patch
Added file:
http://bugs.python.org/file29044/lch.bandaid.for.malformed.fn.crash.1.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17187
Greg Couch added the comment:
In my opinion, the Python 2.7 results are wrong.
In Python 2.7, inspect.ismethod returns True for both bound and unbound methods
-- ie., is broken according to the documentation. As a workaround, I'm using:
def is_bound_method(obj):
return hasattr(obj,
Andrew Bennetts added the comment:
googletest (an xUnit style C++ test framework) has an interesting feature: in
addition to assertions like ASSERT_EQ(x, y) that stop the test, it has
EXPECT_EQ(x, y) etc that will cause the test to fail without causing it to
stop. I think this decoupling of
New submission from Terry J. Reedy:
Language manual, section 7.8. The raise statement has no mention of the 'from
None' option. Indeed it says if given, the second expression must be another
exception class or instance, which would exclude None.
Library manual, Ch 5. Built-in Exceptions, says
Terry J. Reedy added the comment:
I opened separate issue #17188:
Document 'from None' in raise statement doc.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17159
___
New submission from William Mallard:
This patch enables creation of 64-bit zip files via make_archive().
make_archive uses ZipFile to create zip files. ZipFile already supports
creation of 64-bit archives via a kwarg, but make_archive hard-codes it to
32-bit. This patch exposes the option in
Larry Hastings added the comment:
It sort of looks like this was closed because we assumed we were moving to
Unladen Swallow. We're not. Should this be reopened?
--
nosy: +larry
___
Python tracker rep...@bugs.python.org
Roundup Robot added the comment:
New changeset 9497adb7355f by Ned Deily in branch '2.7':
Issue #17111: Prevent test_surrogates (test_fileio) failure on OS X 10.4.
http://hg.python.org/cpython/rev/9497adb7355f
--
nosy: +python-dev
___
Python tracker
Changes by Ned Deily n...@acm.org:
--
resolution: - fixed
stage: commit review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17111
___
New submission from Larry Hastings:
The implementations for LOAD_FAST, STORE_FAST, and DELETE_FAST don't check that
the index is = the size of fastlocals. So it's a snap to crash the
interpreter with hand-written bytecode, by going past the end of the fastlocals
array. Kaboom!
Attached is
Raymond Hettinger added the comment:
It could be that this is not an interesting bug,
that policy suggests that anyone who can write their
own bytecode is a Consenting Adult.
Yes, that is correct on all counts.
Sorry, this is an *ancient* discussion, long ago put to bed.
Besides, did you
Antoine Pitrou added the comment:
See issue 10401.
Quoting myself: “Here is the Nth patch for a globals/builtins cache. As other
caches at the same kind, it shows very small to no gain on non-micro
benchmarks, showing that contrary to popular belief, globals/builtins lookup
are not a major
Roundup Robot added the comment:
New changeset 3893ab574c55 by Serhiy Storchaka in branch '3.2':
Issue #4591: Uid and gid values larger than 2**31 are supported now.
http://hg.python.org/cpython/rev/3893ab574c55
New changeset 035cbc654889 by Serhiy Storchaka in branch '2.7':
Issue #4591: Uid
83 matches
Mail list logo