R. David Murray added the comment:
try the reflected operation is not our standard terminology. There is a
reason I suggested *copying* the parenthetical statement. We essentially have
two places where NotImplemented is described (language reference and library
reference), and the
R. David Murray added the comment:
Specifically, this works (in 2.7):
enumerate(sequence=myvar)
Changing sequence to iterable would break any code that was written like the
above.
--
___
Python tracker rep...@bugs.python.org
New submission from Sam Bishop:
The output of performing dir(__class__) during a class' __init__ method,
seems to be lacking the new '__qualname__' attribute in python 3.
This rough test can be pasted right into the python 3.4 REPL to see the issue.
Tested on 64bit python 3.4 running on OSX
New submission from INADA Naoki:
In [1]: import datetime
In [2]: datetime.datetime.utcfromtimestamp(0)
Out[2]: datetime.datetime(1970, 1, 1, 0, 0)
In [3]:
datetime.datetime.utcfromtimestamp(0).replace(tzinfo=datetime.timezone.utc)
Out[3]: datetime.datetime(1970, 1, 1, 0, 0,
Amaury Forgeot d'Arc added the comment:
Why did you specify during class initialization only? When I print
dir(Foo.Bar) at top-level, there is no __qualname__.
Then, note that '__name__' is not listed either, so it's not about new
attributes.
It was chosen that dir(someClass) tries to list
Georg Brandl added the comment:
@Amaury: this is not what I read there:
If the object is a type or class object, the list contains the names of its
attributes, and recursively of the attributes of its bases.
This implies that class attributes are definitely supposed to be in there.
Sam Bishop added the comment:
I specified 'during class initialisation' because that was the only case I
confirmed.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22790
___
Georg Brandl added the comment:
The missing attributes are some of those defined in type_getsets, i.e.
__name__
__qualname__
__bases__
__abstractmethods__
__text_signature__
The latter two are obscure enough that it probably doesn't matter, but the
first three should definitely be there.
Georg Brandl added the comment:
Ah yes, and some type_members are also missing.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22790
___
___
eryksun added the comment:
You won't find the __qualname__ data descriptor in dir(Foo.Bar) because it's
defined by the metaclass, `type`. Attributes from the metaclass have always
been excluded from the dir() of a class.
--
nosy: +eryksun
___
eryksun added the comment:
See type_dir:
https://hg.python.org/cpython/file/ab2c023a9432/Objects/typeobject.c#l2984
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22790
___
Antoine Pitrou added the comment:
This is similar to the idea of loading the stdlib from a zip file (but less
intrusive and more debugging-friendly). The time savings will depend on whether
the filesystem cache is cold or hot. In the latter case, my intuition is that
decompression will slow
New submission from housetier:
https://docs.python.org/3.4/library/string.html does not explain the replace()
function. I suppose it is very similar, if not identical, to 2.7:
https://docs.python.org/2.7/library/string.html#string.replace
--
components: Distutils
messages: 230601
Georg Brandl added the comment:
Attributes from the metaclass have always been excluded from the dir() of a
class.
Be that as it may, I think it is wrong. I can understand excluding methods of
the metaclass, but __qualname__ (and friends) are only defined in the metaclass
because they are
Georg Brandl added the comment:
BTW, the same implementation detail means that you can ask an instance for its
class' __module__, but not the __name__.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22790
eryksun added the comment:
Follow the String Methods link at the top of the string module documentation.
Or use this link:
https://docs.python.org/3.4/library/stdtypes.html#str.replace
See also help(str.replace) and help(str) in the interactive shell.
--
assignee: - docs@python
Georg Brandl added the comment:
However, it may not be possible to change this for backward compatibility
reasons. People shouldn't be using dir() for determining attributes and the
like, but they do, as documented by the multiprocessing module in the stdlib.
This should at least be noted
Georg Brandl added the comment:
There is already a see also: string methods at the top of the page.
--
nosy: +georg.brandl
resolution: - works for me
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22792
Marc-Andre Lemburg added the comment:
On 04.11.2014 10:41, Antoine Pitrou wrote:
Antoine Pitrou added the comment:
This is similar to the idea of loading the stdlib from a zip file (but less
intrusive and more debugging-friendly). The time savings will depend on
whether the filesystem
Antoine Pitrou added the comment:
I definitely think this should be changed. I just don't know how to do it :-)
--
stage: - needs patch
versions: +Python 3.5
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22790
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +benjamin.peterson
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22790
___
___
Python-bugs-list
Georg Brandl added the comment:
Attaching prototype patch without test suite adjustments.
--
keywords: +patch
Added file: http://bugs.python.org/file37126/type_dir_patch.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22790
Antoine Pitrou added the comment:
Ok, comparison between zlib/snappy/lz4:
$ python3.4 -m timeit -s import zlib; data =
zlib.compress(open('Lib/__pycache__/threading.cpython-35.pyc', 'rb').read());
print(len(data)) zlib.decompress(data)
1 loops, best of 3: 181 usec per loop
$ python3.4 -m
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
nosy: +Arfrever
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22790
___
Antoine Pitrou added the comment:
lz4 also has a high compression mode which improves the compression ratio (-
17091 bytes compressed), for a similar decompression speed.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22789
Antoine Pitrou added the comment:
I have a question: why would do it for classes and not for regular objects?
--
assignee: docs@python -
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22790
Antoine Pitrou added the comment:
Ah, I misunderstood the patch, sorry. Nevermind.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22790
___
___
Georg Brandl added the comment:
Basically beacuse with the current patch, this is because object_dir also does
merge_class_dict, to get class attributes. This means that attributes like
__qualname__ would show up in dir(instance), but are not actually available on
the instance.
Fixing this
Georg Brandl added the comment:
Both lz4 and snappy are BSD-licensed, but snappy is written in C++.
--
nosy: +georg.brandl
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22789
___
Changes by Georg Brandl ge...@python.org:
--
Removed message: http://bugs.python.org/msg230614
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22790
___
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +belopolsky
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22791
___
___
Python-bugs-list
Jeffrey Armstrong added the comment:
There's not much to look into. If the Python function encounters an argument
error, it returns an uninitialized integer as an error code. This patch
fixes incorrect C code, nothing more.
--
___
Python tracker
Michael Foord added the comment:
With one minor doc change (break up the really long sentence), this looks good
to go to me.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22457
___
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
nosy: +Arfrever
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22725
___
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
nosy: +Arfrever
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22780
___
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
nosy: +Arfrever
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22789
___
eryksun added the comment:
__doc__ and __module__ are also getsets (to support built-in types), but it's
nothing to worry about since the attributes can't be deleted.
I think the most value added here is for listing __mro__ and the others that
Georg mentioned. Should the following attributes
Tim Graham added the comment:
The patch from #16611 applies cleanly to 3.2. I added a mention in Misc/NEWS
and confirmed that all tests pass.
--
Added file: http://bugs.python.org/file37127/secure-httponly-3.2-backport.diff
___
Python tracker
Rishi added the comment:
Patch updated from review comments. Also added a few corner test cases.
--
Added file: http://bugs.python.org/file37128/issue1610654_2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1610654
Roundup Robot added the comment:
New changeset c4b5a5d44254 by Antoine Pitrou in branch '3.4':
Issue #22773: fix failing test with old readline versions due to issue #19884.
https://hg.python.org/cpython/rev/c4b5a5d44254
New changeset be374b8c40c8 by Antoine Pitrou in branch 'default':
Issue
Roundup Robot added the comment:
New changeset c4b5a5d44254 by Antoine Pitrou in branch '3.4':
Issue #22773: fix failing test with old readline versions due to issue #19884.
https://hg.python.org/cpython/rev/c4b5a5d44254
New changeset be374b8c40c8 by Antoine Pitrou in branch 'default':
Issue
Roundup Robot added the comment:
New changeset eba6e68e818c by Antoine Pitrou in branch '2.7':
Issue #22773: fix failing test with old readline versions due to issue #19884.
https://hg.python.org/cpython/rev/eba6e68e818c
--
___
Python tracker
Roundup Robot added the comment:
New changeset eba6e68e818c by Antoine Pitrou in branch '2.7':
Issue #22773: fix failing test with old readline versions due to issue #19884.
https://hg.python.org/cpython/rev/eba6e68e818c
--
___
Python tracker
Roundup Robot added the comment:
New changeset ce0dd5e4b801 by Robert Collins in branch 'default':
Close #22457: Honour load_tests in the start_dir of discovery.
https://hg.python.org/cpython/rev/ce0dd5e4b801
--
nosy: +python-dev
resolution: - fixed
stage: - resolved
status: open -
Changes by Antoine Pitrou pit...@free.fr:
--
resolution: - fixed
stage: patch review - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22773
___
New submission from Antoine Pitrou:
http://buildbot.python.org/all/builders/AMD64%20OpenIndiana%203.x/builds/8840/steps/test/logs/stdio
testIssue8621 (test.test_uuid.TestUUID) ... ok
test_UUID (test.test_uuid.TestUUID) ... ok
test_exceptions (test.test_uuid.TestUUID) ... ok
test_find_mac
Roundup Robot added the comment:
New changeset 2aac2d76035e by Robert Collins in branch 'default':
Fix regression in issue 22457 fix.
https://hg.python.org/cpython/rev/2aac2d76035e
--
___
Python tracker rep...@bugs.python.org
New submission from Robert Collins:
I did a brownbag fix for my change to issue22457 which exposed a untested
corner case - this issue is for me to come back and add a regression test for
it.
--
messages: 230628
nosy: rbcollins
priority: normal
severity: normal
status: open
title:
Robert Collins added the comment:
This was reported as https://code.google.com/p/unittest-ext/issues/detail?id=71
a while back. I think blacklisting FunctionTestCase in TestLoader is entirely
reasonable.
--
___
Python tracker rep...@bugs.python.org
Changes by David Edelsohn dje@gmail.com:
--
components: Tests
nosy: David.Edelsohn, haypo
priority: normal
severity: normal
status: open
title: Intermittent
type: behavior
versions: Python 3.6
___
Python tracker rep...@bugs.python.org
New submission from David Edelsohn:
test_list_command_verbose intermittently fails because the date comparison
differs by six hours. I suspect a bad interaction between tests, but have not
been able to find the culprit.
FAIL: test_list_command_verbose (test.test_tarfile.CommandLineTest)
Brett Cannon added the comment:
Just FYI, there can easily be added into importlib since it works through
marshal's API to unmarshal the module's data. There is also two startup
benchmarks in the benchmark suite to help measure possible performance
gains/losses which should also ferret out if
Changes by Berker Peksag berker.pek...@gmail.com:
--
nosy: +berker.peksag, serhiy.storchaka
versions: +Python 3.4, Python 3.5 -Python 3.6
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22795
R. David Murray added the comment:
I don't find the keyword to be superior to the 'replace' spelling, myself. I
think the replace spelling makes it clearer what the intent is.
--
nosy: +r.david.murray
___
Python tracker rep...@bugs.python.org
R. David Murray added the comment:
To clarify for the OP: in python3 the 'string' module does not contain a
replace function, whereas in 2.7 it did. 'replace' is only a method on str in
python3, whereas in 2.7 it is both an str method and a function in the string
module.
--
nosy:
Changes by Christian Heimes li...@cheimes.de:
--
nosy: +christian.heimes
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22789
___
___
Ethan Furman added the comment:
R. David Murray said:
try the reflected operation is not our standard terminology.
Parenthetical under discussion:
---
(The interpreter will then try the reflected operation, or some other
fallback,
depending
David Edelsohn added the comment:
Victor, can this patch be applied to Python 2.7 branch also?
--
components: +Tests
type: - behavior
versions: +Python 2.7
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19753
INADA Naoki added the comment:
This is not a spelling issue.
When people writing code converting between unixtime and datetime,
they should find `.timestamp()` and `.utcfromtimestamp()`.
But they may not awake about `.replace(tzinfo=datetime.timezone.utc)` is very
important.
Since
New submission from Tim Graham:
As noted in the comments of #22758 by Georg Brandle:
* Django uses __init__(str()) roundtripping, which is not explicitly supported
by the library, and worked by accident with previous versions. That it works
again with 3.3+ is another accident, and a bug.
Tim Graham added the comment:
I also created #22796 for the lax parsing issue.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22758
___
___
Arfrever Frehtes Taifersar Arahesis added the comment:
__base__ exists also in Jython and PyPy (#22456).
I think that all attributes could be listed.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22790
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
nosy: +Arfrever
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22796
___
New submission from Joshua Chin:
The documentation for urlopen states that it Raises URLError on errors.
However, urlopen can raise a ValueError. In fact, test_urllib.
urlopen_FileTests.test_relativelocalfile specifically checks if urlopen raises
a ValueError. I suggest removing the
R. David Murray added the comment:
OK, you got me there :)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22780
___
___
Python-bugs-list mailing
R. David Murray added the comment:
This is a general principle in Python. A module may raise specific errors, but
there are always other errors that may be raised. The wording could be
clarified, but it should not be removed.
--
nosy: +r.david.murray
R. David Murray added the comment:
Yes, I agree that a doc note would be appropriate. timezone is relatively new,
originally there was no way to produce aware datetimes from the datetime module
without writing your own tzinfo class. Now that there is, there are may be
more than one place in
R. David Murray added the comment:
This test still exists, so the change didn't cause it to trigger. What is the
security bug? The commit doesn't say, and doesn't reference an issue number.
So if that test still passes, what's the bug?
--
___
Georg Brandl added the comment:
Well, with this change you can again (e.g.) pass
Set-cookie: foo=bar
which isn't a valid cookie. It doesn't reintroduce the same vulnerability, but
it will still silently consume invalid cookies (i.e. such with attribute-like
tokens upfront) and return a
Amaury Forgeot d'Arc added the comment:
So, dir(C) contains '__mro__', but not 'mro'?
I'm -1 on the change.
From https://docs.python.org/3.4/library/functions.html#dir :
Note Because dir() is supplied primarily as a convenience for use at an
interactive prompt, it tries to supply an
Georg Brandl added the comment:
So, dir(C) contains '__mro__', but not 'mro'?
That can be discussed.
But I would argue that at least __name__, __bases__ and __qualname__ are
interesting attributes for the user. Same for methods like __subclasses__().
Otherwise, it's quite ironic to prevent
Ethan Furman added the comment:
Why are __flags__, __basicsize__, __itemsize__, __dictoffset__, and
__weakrefoffset__ interesting?
I agree with Georg about the others.
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
Georg Brandl added the comment:
Why are __flags__, __basicsize__, __itemsize__, __dictoffset__, and
__weakrefoffset__ interesting?
I haven't said they are, but on the other hand I don't see why consistency is a
bad thing.
--
___
Python tracker
Antoine Pitrou added the comment:
The security issue isn't easy to explain, it involves an elaborated set of
services (browser, Web site...) each having a slightly different notion of
cookie parsing to mount an attack allowing to bypass CSRF protection on certain
Python-powered frameworks.
Antoine Pitrou added the comment:
This qualification isn't really accurate:
The change for #16611 reintroduces lax parsing behavior that the security
fix [1] was supposed to prevent
since the #16611 changes were committed *before* the security fix.
--
Ethan Furman added the comment:
Whew!
If a different wording is better, I'm happy to change both places. :)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22780
___
Antoine Pitrou added the comment:
Note that f81846c2b746 adds an explicit test for acceptance of invalid cookie
strings (test_bad_attrs).
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22796
Georg Brandl added the comment:
These are unknown attributes after a key=value pair. What this issue is about
is accepting attributes *before* any key=value pair.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22796
Antoine Pitrou added the comment:
Well, if we want to become stricter, I don't it makes sense to stop at the
middle of the road.
In any case, here is a patch enabling strict parsing.
--
keywords: +patch
Added file: http://bugs.python.org/file37130/cookie_strict_parsing.patch
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +PaulMcMillan
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22796
___
___
Python-bugs-list
Changes by Joshua Chin joshuarc...@gmail.com:
Added file: http://bugs.python.org/file37131/urlopen_doc.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22797
___
Martin v. Löwis added the comment:
Right, the entire patch might be processed in 30 minutes. I won't have these 30
minutes any time soon.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21931
Changes by Devin Jeanpierre jeanpierr...@gmail.com:
--
nosy: +Devin Jeanpierre
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22785
___
___
Changes by Jeffrey Armstrong jeffrey.armstr...@approximatrix.com:
--
resolution: - wont fix
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20597
___
R. David Murray added the comment:
(Looking at your new patch...thanks for giving it a try even though I wasn't
clear).
There are lots of other errors it can raise, too. I was thinking more along
the lines of raises URLError on http protocol errors. The problem is that's
not completely
Changes by Berker Peksag berker.pek...@gmail.com:
--
stage: - patch review
versions: -Python 3.6
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22668
___
Changes by Antoine Pitrou pit...@free.fr:
--
stage: - needs patch
versions: +Python 3.5
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22785
___
Tim Graham added the comment:
Django's test suite passes with the proposed patch after some updates:
https://github.com/django/django/pull/3455
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22796
Steve Dower added the comment:
Had a look at where libffi is at, and we're such a long way from them now that
I don't think we can easily merge (a.k.a. I don't want to be the one to do it
:) )
I want to run this patch through some builds with the right compilers, but then
I'll check it in.
Dmitry Kazakov added the comment:
I'm not sure what would be the best way to support negative limit for stack
functions. Actually, I think the current behavior is not intuitive. For example
we could make positive limit mean the same thing for traceback and stack
functions (load N entries,
Tshepang Lekhonkhobe added the comment:
Oh, I see now. The documentation doesn't make it clear.
Anyways, what were the advantages of making it a keyword, instead of
just a positional argument?
--
___
Python tracker rep...@bugs.python.org
Martin v. Löwis added the comment:
Reopening. I still don't understand the issue for 3.4, especially in the light
of #21274
--
status: closed - open
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20597
Martin v. Löwis added the comment:
Reopening. What problem does this fix? AFAICT, PATH_MAX isn't used at all
(anymore).
--
nosy: +loewis
resolution: fixed -
status: closed - open
___
Python tracker rep...@bugs.python.org
Georg Brandl added the comment:
Missing keyword argument support is not the norm, it's the exception that is
only due to implementation details in C code. Eventually, we'd like every C
function to support keyword arguments.
Converting everything is tedious work, though, and still makes things
94 matches
Mail list logo