New submission from Blaise Gassend:
The documentation for heapq.heapify indicates that it runs in linear time. I
believe that this is incorrect, and that it runs in worst case n * log(n) time.
I checked the implementation, and there are indeed n _siftup operations, which
each appear to be
Raymond Hettinger added the comment:
Graham, do we have a contributor agreement from you?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19072
___
Graham Dumpleton added the comment:
I don't believe so.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19072
___
___
Python-bugs-list mailing
New submission from Nitin Kumar:
Mathematically python is not giving correct output for integer division for
negative number, e.g. : -7//2= -3 but python is giving output -4.
--
components: IDLE
files: Integer_division.py
messages: 201715
nosy: Nitin.Kumar
priority: normal
severity:
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
assignee: docs@python - rhettinger
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19445
___
Changes by Nitin Kumar nitinkumar@gmail.com:
Removed file: http://bugs.python.org/file32420/Integer_division.py
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19446
___
Changes by Nitin Kumar nitinkumar@gmail.com:
Added file: http://bugs.python.org/file32421/Integer_division.py
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19446
___
Georg Brandl added the comment:
Hi Nitin,
a // b is defined as the floor division operation, same as what math.floor(a
/ b) gives: the largest integer = a / b.
-7/2 is -3.5, the largest integer = -3.5 is -4.
--
nosy: +georg.brandl
resolution: - invalid
status: open - closed
Raymond Hettinger added the comment:
The run time is O(n) because the heapify algorithm runs bottom-to-top so most
of the n//2 sift operations are working on very short heaps (i.e. half of them
are at depth 1, a quarter of them are at depth 2, one eight at depth 3, etc).
Please take a look
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +haypo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19444
___
___
Python-bugs-list mailing
Christian Heimes added the comment:
Can you suggest a documentation update?
--
assignee: - docs@python
components: +Documentation -Library (Lib)
nosy: +christian.heimes, docs@python
stage: - needs patch
versions: +Python 3.2
___
Python tracker
Nitin Kumar added the comment:
Hi Georg,
Is there any operator for integer division in python?
On Wed, Oct 30, 2013 at 1:00 PM, Georg Brandl rep...@bugs.python.orgwrote:
Georg Brandl added the comment:
Hi Nitin,
a // b is defined as the floor division operation, same as what
STINNER Victor added the comment:
the file descriptor that mmap.mmap() allocates is not set to close-on-exec
In Python 3.4, the file descriptor is now non-inheritable, as a side effect of
the PEP 446.
http://www.python.org/dev/peps/pep-0446/
--
versions: +Python 3.3, Python 3.4
Changes by STINNER Victor victor.stin...@gmail.com:
--
nosy: +neologix
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19444
___
___
New submission from Bohuslav Slavek Kabrda:
If py_compile.compile is used on a file with bad encoding (e.g.
Lib/test/bad_coding2.py), the function raises even if doraise=False is passed.
I'm attaching a patch that fixes this in 3.3 - I haven't tried on 3.4 yet and
the code has changed, so I'm
Robert Merrill added the comment:
I'm adding Library again because I think the current behavior is a bug and
should be fixed in the 2.7 tree. Perhaps the documentation in older versions
should be updated
mmap.mmap should always set the FD_CLOEXEC flag on the descriptor that it gets
from
STINNER Victor added the comment:
py_compile.compile() has been modified in Python 3.4. The encoding is now
detected in the try/except block.
You should write a unit test for your patch.
http://docs.python.org/devguide/runtests.html#writing
--
nosy: +haypo
New submission from Christian Heimes:
For #17134 I need a decent way to map OIDs to human readable strings and vice
versa. OpenSSL has a couple of method for the task, e.g.
http://www.openssl.org/docs/crypto/OBJ_nid2obj.html
The patch implements three ways to lookup NID, SN, LN and OID: by
Bohuslav Slavek Kabrda added the comment:
Ok, I'm attaching a patch for 3.3 with a test case included.
--
Added file:
http://bugs.python.org/file32424/dont-raise-from-py_compile-test-included.patch
___
Python tracker rep...@bugs.python.org
Robert Merrill added the comment:
Sorry, I correct my earlier statement: even if the fd you pass to mmap.mmap()
is set to FD_CLOEXEC, the dup'd fd /will not be/
So this is a REALLY bad bug because users cannot workaround it except by just
not using mmap
--
New submission from Tomas Grahn:
When csv.DictWriter.writerow is fed a dict with extra fieldnames (and
extrasaction='raise') and any of those extra fieldnames aren't strings, a
TypeError-exception is thrown. To fix the issue; in csv.py, edit the line:
raise ValueError(dict contains fields not
New submission from Marc Schlaich:
My System:
$ python
Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)] on
win32
Type help, copyright, credits or license for more information.
import sqlite3
sqlite3.version
'2.6.0'
sqlite3.sqlite_version
'3.6.21'
Test Script:
Marc Schlaich added the comment:
Ok, these issues were probably due to the shipped version of PyGTK (which is
used as event scheduler). Since I built my own Python and own PyGTK everything
looks fine.
--
resolution: - invalid
status: open - closed
New submission from Daniele Sluijters:
Python 2's urlparse.urlparse() and Python 3's urllib.parse.urlparse() accept
URI/URL's with underscores in the host/domain/subdomain. I believe this
behaviour to be incorrect.
A distinction needs to be made between DNS names and Uniform Resource Locators
STINNER Victor added the comment:
It works for me on Linux 64-bit:
$ python
Python 2.7.3 (default, Aug 9 2012, 17:23:57)
[GCC 4.7.1 20120720 (Red Hat 4.7.1-5)] on linux2
Type help, copyright, credits or license for more information.
d, i = {}, 0
while (i 1000):
... n = i + 1
...
R. David Murray added the comment:
I would argue that the TypeError is correct (field names must be strings), even
though the way it is generated is a bit unorthodox :)
Let's see what others think.
--
nosy: +r.david.murray
___
Python tracker
R. David Murray added the comment:
Rereading my post I disagree with myself. ValueError is probably better in
this context (the difference between ValueError and TypeError is a bit grey,
and Python is not necessarily completely consistent about it.)
--
New submission from Peter Harris:
Documentation on python website says:
xml.etree.ElementTree.iterparse(source, events=None, parser=None)
Parses an XML section into an element tree incrementally, and reports what’s
going on to the user. source is a filename or file object containing XML
Tomas Grahn added the comment:
If non-string field names aren't allowed then shouldn't they be caught at an
earlier stage, rather then when the user feeds writerow a dict with an
unexpected key?
But why should the field names have to be strings in the first place?
Everything else is passed
R. David Murray added the comment:
Python often defaults to the practical over the strictly-conforming (unless
there is a 'strict' flag :) We generally follow the lead of the browsers in
implementing our web related modules.
The situation here appears to be a real mess. Here's an
Nick Coghlan added the comment:
Alternative (more sensible) option - leave the packaging user guide hosted on
ReadTheDocs, and if we decide to add a python.org subdomain for it later, that
won't break any existing links.
--
___
Python tracker
R. David Murray added the comment:
But why should the field names have to be strings in the first place?
Everything else is passed through str before being written anyway...
Good point.
--
___
Python tracker rep...@bugs.python.org
Ethan Furman added the comment:
Do we currently have any data structures in Python, either built-in or in the
stdlib, that aren't documented as raising RuntimeError if the size changes
during iteration? list, dict, set, and defaultdict all behave this way.
If not, I think OrderedDict should
Brett Cannon added the comment:
Fine with fixing it, but in context of PEP 451, not 3.3.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19413
___
Vajrasky Kok added the comment:
Here is the preliminary patch to fix the problem. My patch produces 8bit for
msg.as_string and msg.as_bytes for simplicity reason.
If msg.as_string should gives content-transfer-encoding 7bit with 8bit data but
msg.as_bytes should gives
Armin Rigo added the comment:
'list' doesn't, precisely.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19414
___
___
Python-bugs-list mailing
Ethan Furman added the comment:
Ah, right you are: list just acts wierd. ;)
So the question then becomes is OrderedDict more like a list or more like a
dict?
It seems to me that OrderedDict is more like a dict.
--
___
Python tracker
Blaise Gassend added the comment:
I stand corrected. Sorry for the noise.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19445
___
___
Nikolaus Rath added the comment:
I agree that OrderedDict is more a dict than a list, but it is not clear to me
why this means that it cannot extend a dict's functionality in that respect.
OrderedDict already adds functionality to dict (preserving the order), so why
shouldn't it also allow
Stefan Behnel added the comment:
How about actually allowing a list in addition to a tuple? And, in fact, any
sequence? I can't see a reason not to.
For reference, lxml only expects it to be either None or an iterable.
Essentially, I consider it more of a set-like filter, since the linear
Roundup Robot added the comment:
New changeset e4fe8fcaef0d by Benjamin Peterson in branch '2.7':
use the collapsed path in the run_cgi method (closes #19435)
http://hg.python.org/cpython/rev/e4fe8fcaef0d
New changeset b1ddcb220a7f by Benjamin Peterson in branch '3.1':
use the collapsed path in
Mark Richman added the comment:
I had to do `sudo sh ./patch_readline_issue_18458.sh` or the patch script
itself would cause Python to crash.
After applying this patch, I got the following output, and the problem is still
*not* solved for me:
-- running on OS X 10.9
-- 2.7 does not need to
Zachary Ware added the comment:
Adding to Vajrasky's report, the same commit also adds 3 warnings when building
on Windows:
..\Objects\unicodeobject.c(10588): warning C4018: '' : signed/unsigned
mismatch [P:\Projects\OSS\Python\cpython\PCbuild\pythoncore.vcxproj]
New submission from David Evans:
The pager functions used by help() in StdLib's pydoc.py don't detect IronPython
correctly and the result is a lack of functionality or in some cases a hang.
This is similar to issue 8110 in that the code attempts to detect windows with
a check for win32 from
Ethan Furman added the comment:
The further from dict it goes, the more there is to remember. Considering the
work around is so simple, I just don't think it's worth it:
for key in list(ordered_dict):
if some_condition:
del ordered_dict[key]
A simple list around the
Roundup Robot added the comment:
New changeset 52ec6a3eeda5 by Victor Stinner in branch 'default':
Issue #19424: Fix a compiler warning
http://hg.python.org/cpython/rev/52ec6a3eeda5
--
___
Python tracker rep...@bugs.python.org
Daniele Sluijters added the comment:
The link you mention only deals with the DNS side of things, this issue is
specifically not about that, it's about the URI/URL side of things which is a
very important distinction in this case.
I'm also not entirely sure I agree with the sentiment of it's
R. David Murray added the comment:
Yes, I said that link only dealt with the DNS side of things...where there are
also incompatibilities.
I don't think that strictly adhering to the URI RFCs would clear things up.
What about those domains that have _s and want to run web services on them?
Charles-François Natali added the comment:
I agree this should be fixed.
Robert, want to submit a patch?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19444
___
Peter Harris added the comment:
Yeah it would make sense to accept any iterable, but I'm only proposing a
documentation fix not a feature enhancement.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19452
Nikolaus Rath added the comment:
The workaround is trivial, but there is no technical necessity for it, and it
involves copying the entire dict into a list purely for.. what exactly? I guess
I do not understand the drawback of allowing changes. What is wrong with
for key in ordered_dict:
Nikolaus Rath added the comment:
Ethan: when you say ..the more there is to remember, what exactly do you
mean? I can see that it is important to remember that you're *not allowed* to
make changes during iteration for a regular dict. But is there really a
significant cognitive burden if it
anatoly techtonik added the comment:
I think we are talking about double standards.
Why the .xz and .txz are worthy including in 2.7.5 and .svg is not? See issue
#16316.
http://bugs.python.org/issue15207 will break a lot of this stuff anyway, so I
hope it will fix the issue.
--
Guido van Rossum added the comment:
LGTM. Commit!
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19172
___
___
Python-bugs-list mailing list
Guido van Rossum added the comment:
(Adding CF's new patch so I can compare and review it.)
--
Added file: http://bugs.python.org/file32428/selectors_map-2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19172
New submission from anatoly techtonik:
As a followup to issue19377 it would be nice if devguide contained a paragraph
to resolve the conflicting point provided by http://bugs.python.org/msg187373
and http://bugs.python.org/msg201141 arguments.
--
assignee: docs@python
components:
Ethan Furman added the comment:
Firstly, you're not copying the entire dict, just its keys. [1]
Secondly, you're only copying the keys when you'll be adding/deleting keys from
the dict.
Thirdly, using the list idiom means you can use OrderedDicts, defaultdicts,
dicts, sets, and most likely
anatoly techtonik added the comment:
Added issue19454 to settle this down.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19377
___
___
Roundup Robot added the comment:
New changeset 7097b5c39db0 by Victor Stinner in branch 'default':
Issue #19437: Fix os.statvfs(), handle errors
http://hg.python.org/cpython/rev/7097b5c39db0
New changeset b49f9aa12dae by Victor Stinner in branch 'default':
Issue #19437: Fix select.epoll.poll(),
Ethan Furman added the comment:
Nikolaus, in reply to your question about more to remember:
Even though I may not use it myself, if it is allowed then at some point I will
see it in code; when that happens the sequence of events is something like:
1) hey, that won't work
2) oh, wait, is
Milton Mobley added the comment:
I followed the suggestion of email responders to use xrange instead of while,
and observed that 32-bit Suse Linux got past 44,000,000 adds before exiting
with Memory Error, while 64-bit Windows 7 slowed down markedly after
22,000,000 adds and was unusable
Antoine Pitrou added the comment:
But in my opinion Python should be able to detect failure to complete an
allocation request on Windows
Which failure? You're telling us it doesn't fail, it just becomes slow.
(by the way, have you checked whether your machine is swapping when that
happens?)
Matthew Barnett added the comment:
Works for me: Python 2.7.5, 64-bit, Windows 8.1
--
nosy: +mrabarnett
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19443
___
R. David Murray added the comment:
msg.as_string should not be producing a CTE of 8bit. I haven't looked at your
patch so I don't know what you mean by having as_string produce 8bit data, but
it can't be right :)
To clarify: as_string must produce valid unicode data, and therefore *cannot*
Roundup Robot added the comment:
New changeset b0ae96700301 by Charles-François Natali in branch 'default':
Issue #19172: Add a get_map() method to selectors.
http://hg.python.org/cpython/rev/b0ae96700301
--
nosy: +python-dev
___
Python tracker
Ned Deily added the comment:
Mark, I'm not sure I understand what you saw but the patch script will cause a
Python crash as part of its testing so that is to be expected. You should not
have to run the script using sudo. This script also only applies to Pythons
installed from python.org (or
Charles-François Natali added the comment:
Here's an updated patch using the new selector.get_map() method.
It removes ~100 lines to subprocess, which is always nice.
--
Added file: http://bugs.python.org/file32429/subprocess_selectors-1.diff
___
Mark Richman added the comment:
My mistake. I'm using
/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
--
*Mark Richman*
web: www.markrichman.com
email: m...@markrichman.com
tel: (954) 234-9049
http://www.linkedin.com/in/mrichman
On Wed, Oct
Nikolaus Rath added the comment:
Hmm. I see your point. You might be right (I'm not fully convinced yet though),
but this bug is probably not a good place to go into more detail about this.
So what would be the best way to fix the immediate problem this was originally
about? Raise a
Charles-François Natali added the comment:
Committed.
Antoine, thanks for the idea and patch!
--
resolution: - fixed
stage: patch review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
Changes by Christian Heimes li...@cheimes.de:
Removed file: http://bugs.python.org/file30497/enumcertstore.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17134
___
Changes by Christian Heimes li...@cheimes.de:
Removed file: http://bugs.python.org/file32234/enum_cert_trust.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17134
___
Changes by Christian Heimes li...@cheimes.de:
Removed file: http://bugs.python.org/file30500/enumcertstore2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17134
___
Ethan Furman added the comment:
Personally, I would rather see a RuntimeError raised.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19414
___
Christian Heimes added the comment:
Here is a simplified version of my patch with doc updates.
Changes:
- Different functions for certs and CRLs: enum_certificates() / enum_crls()
- encoding is now a string ('x509_asn' or 'pkcs_7_asn')
- for certificates trust information is either a set of
Serhiy Storchaka added the comment:
See also issue19332.
--
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19414
___
___
Ethan Furman added the comment:
Raymond, please don't be so concise.
Is the code unimportant because the scenario is so rare, or something else?
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19332
Changes by Ned Deily n...@acm.org:
--
components: +Build, Windows -Extension Modules
nosy: +loewis
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19450
___
Changes by Eric Hanchrow eric.hanch...@gmail.com:
--
components: Library (Lib)
nosy: Eric.Hanchrow
priority: normal
severity: normal
status: open
title: LoggerAdapter class lacks documented setLevel method
type: behavior
versions: Python 2.7
___
Eric Hanchrow added the comment:
Put the following into a file named repro.py, then type python repro.py at
your shell. You'll see ``AttributeError: 'CustomAdapter' object has no
attribute 'setLevel'``
import logging logging.basicConfig ()
class CustomAdapter(logging.LoggerAdapter):
def
Eric Hanchrow added the comment:
Gaah, please ignore that last message; I accidentally pasted it into the wrong
page :-(
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19063
___
New submission from Eric Hanchrow:
Put the following into a file named repro.py, then type python repro.py at
your shell. You'll see ``AttributeError: 'CustomAdapter' object has no
attribute 'setLevel'``
import logging logging.basicConfig ()
class CustomAdapter(logging.LoggerAdapter):
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
nosy: +Arfrever
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19444
___
New submission from Guido van Rossum:
(Bruce Leban, on python-ideas:)
ntpath still gets drive-relative paths wrong on Windows:
ntpath.join(r'\\a\b\c\d', r'\e\f')
'\\e\\f'
# should be r'\\a\b\e\f'
ntpath.join(r'C:\a\b\c\d', r'\e\f')
'\\e\\f'
# should be r'C:\e\f'
(same behavior in Python
Vinay Sajip added the comment:
The adapter provides only the logging methods such as debug(), info() etc., but
not methods to configure the logger (such as setLevel). Just use
adapter.logger.setLevel(logging.WARNING)
--
nosy: +vinay.sajip
resolution: - invalid
status: open - closed
Changes by Nikolaus Rath nikol...@rath.org:
--
title: OrderedDict.values() behavior for modified instance -
iter(ordered_dict) yields keys not in dict in some circumstances
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19414
New submission from Arfrever Frehtes Taifersar Arahesis:
test.test_codeccallbacks.CodecCallbackTest.test_xmlcharrefreplace_with_surrogates()
and test.test_unicode.UnicodeTest.test_encode_decimal_with_surrogates() fail
with Python supporting wide unicode, when they have been loaded from *.pyc
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
Removed message: http://bugs.python.org/msg201781
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19063
___
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
Removed message: http://bugs.python.org/msg201782
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19063
___
Eric Hanchrow added the comment:
I should have been clearer: the problem is that the docs
(http://docs.python.org/2/library/logging.html#logging.LoggerAdapter) say
In addition to the above, LoggerAdapter supports the following methods of
Logger, i.e. debug(), info(), warning(), error(),
Vinay Sajip added the comment:
Okay, I see. I can't add the methods to the code (as feature additions aren't
allowed in micro releases, and 2.7 is the last 2.x release). So I'll update the
documentation.
--
___
Python tracker rep...@bugs.python.org
Eric Hanchrow added the comment:
Thanks!
On Wed, Oct 30, 2013 at 5:36 PM, Vinay Sajip rep...@bugs.python.org wrote:
Vinay Sajip added the comment:
Okay, I see. I can't add the methods to the code (as feature additions aren't
allowed in micro releases, and 2.7 is the last 2.x release). So
Roundup Robot added the comment:
New changeset db40b69f9c0a by Vinay Sajip in branch '2.7':
Issue #19455: Corrected inaccuracies in documentation and corrected some
incorrect cross-references.
http://hg.python.org/cpython/rev/db40b69f9c0a
--
nosy: +python-dev
Changes by Martin Panter vadmium...@gmail.com:
--
nosy: +vadmium
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15873
___
___
Python-bugs-list
New submission from Hank Christian:
LinkedIn
Python,
I'd like to add you to my professional network on LinkedIn.
- Henry
Henry Christian
ADJUNCT PROFESSOR at Central Texas College
Greater Los Angeles Area
Confirm that you know Henry Christian:
Changes by R. David Murray rdmur...@bitdance.com:
--
Removed message: http://bugs.python.org/msg201791
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19458
___
Changes by R. David Murray rdmur...@bitdance.com:
--
status: open - closed
title: Invitation to connect on LinkedIn - spam
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19458
___
Vajrasky Kok added the comment:
Okay, so for this case, what are the correct outputs for the cte and the
message?
from email.charset import Charset
from email.message import Message
cs = Charset('utf-8')
cs.body_encoding = None # disable base64
msg =
R. David Murray added the comment:
cte base64 I think (see below).
Basically, set_payload should be putting the surrogateescape encoded utf-8 into
the _payload (which it should now be doing), and probably calling set_charset.
The cte will at that point be 8bit, but when as_string calls
99 matches
Mail list logo