[issue19445] heapq.heapify is n log(n), not linear
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 worst case log(n). One example of the documentation pages that are wrong. http://docs.python.org/3.4/library/heapq.html#heapq.heappush -- assignee: docs@python components: Documentation messages: 201712 nosy: Blaise.Gassend, docs@python priority: normal severity: normal status: open title: heapq.heapify is n log(n), not linear versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19445 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19072] classmethod doesn't honour descriptor protocol of wrapped callable
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 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19072] classmethod doesn't honour descriptor protocol of wrapped callable
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 list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19446] Integer division for negative numbers
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: normal status: open title: Integer division for negative numbers type: enhancement versions: Python 3.3 Added file: http://bugs.python.org/file32420/Integer_division.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19446 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19445] heapq.heapify is n log(n), not linear
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 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19446] Integer division for negative numbers
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 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19446] Integer division for negative numbers
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 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19446] Integer division for negative numbers
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 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19446 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19445] heapq.heapify is n log(n), not linear
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 at on-line references for heapifying. -- resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19445 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19444] mmap.mmap() allocates a file descriptor that isn't CLOEXEC
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19444 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19444] mmap.mmap() allocates a file descriptor that isn't CLOEXEC
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 rep...@bugs.python.org http://bugs.python.org/issue19444 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19446] Integer division for negative numbers
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 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 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19446 ___ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19446 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19444] mmap.mmap() allocates a file descriptor that isn't CLOEXEC
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 -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19444 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19444] mmap.mmap() allocates a file descriptor that isn't CLOEXEC
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +neologix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19444 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19447] py_compile.compile raises if a file has bad encoding
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 not sure it's problem there. (Background: During RPM build of Python 3 in Fedora, we use py_compile.compile to make sure all files are properly compiled and have newer timestamps. We use 'find' to get all *.py files under 'python3.3/' and then xargs to pass the files to Python script that compiles them. If one of the files causes py_compile.compile to raise, the rest doesn't get compiled.) -- components: Build files: 00186-dont-raise-from-py_compile.patch keywords: patch messages: 201721 nosy: bkabrda priority: normal severity: normal status: open title: py_compile.compile raises if a file has bad encoding versions: Python 3.3 Added file: http://bugs.python.org/file32422/00186-dont-raise-from-py_compile.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19447 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19444] mmap.mmap() allocates a file descriptor that isn't CLOEXEC
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 dup(). I don't see why we wouldn't do this, because if we are calling exec(), we are blowing away all python state, and only the mmap object should be using this file descriptor (since its existence is hidden from the user). Users should not be depending on the old behavior, because the interface which is presented to them gives them no indication that this fd even exists. Users are probably expecting the proposed behavior, because anyone who has worked with unix file descriptors in C would not expect: fd = os.open(...) mmap = mmap.mmap(fd, size) # do some stuff os.close(fd) To result in an extra inheritable fd still being there. Nothing in the documentation indicates that this would happen, either. -- components: +Library (Lib) versions: -Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19444 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19447] py_compile.compile raises if a file has bad encoding
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 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19447 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19448] SSL: add OID / NID lookup
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 OpenSSL's internal numeric id (NID), by OID or by name: ssl.txt2obj(MD5, name=True) ASN1Object(nid=4, shortname='MD5', longname='md5', oid='1.2.840.113549.2.5') ssl.txt2obj(clientAuth, name=True) ASN1Object(nid=130, shortname='clientAuth', longname='TLS Web Client Authentication', oid='1.3.6.1.5.5.7.3.2') ssl.txt2obj(1.3.6.1.5.5.7.3.1) ASN1Object(nid=129, shortname='serverAuth', longname='TLS Web Server Authentication', oid='1.3.6.1.5.5.7.3.1') -- files: ssl_asn1obj.patch keywords: patch messages: 201724 nosy: christian.heimes, giampaolo.rodola, janssen, pitrou priority: normal severity: normal stage: patch review status: open title: SSL: add OID / NID lookup type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file32423/ssl_asn1obj.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19448 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19447] py_compile.compile raises if a file has bad encoding
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 http://bugs.python.org/issue19447 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19444] mmap.mmap() allocates a file descriptor that isn't CLOEXEC
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 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19444 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19449] csv.DictWriter can't handle extra non-string fields
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 in fieldnames: + , .join(wrong_fields)) to: raise ValueError(dict contains fields not in fieldnames: + , .join(repr(wrong_field) for wrong_field in wrong_fields)) Attached is a patch that fixes the problem (works in both 2.6 and 2.7, I haven't tried anything else). Here is a simple test to demonstrate the problem: import cStringIO, csv sio=cStringIO.StringIO() writer=csv.DictWriter(sio, [foo, bar]) writer.writerow({1:hello, 2:world}) -- files: csv-patch.diff keywords: patch messages: 201727 nosy: tomas_grahn priority: normal severity: normal status: open title: csv.DictWriter can't handle extra non-string fields type: behavior versions: Python 2.6, Python 2.7 Added file: http://bugs.python.org/file32425/csv-patch.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19449 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19450] Bug in sqlite in Windows binaries
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: import sqlite3 conn = sqlite3.connect(':memory:') conn.execute('PRAGMA foreign_keys = ON') fk = (conn.execute(PRAGMA foreign_keys).fetchone()[0]) print 'version = %s, foreign keys = %r' % (sqlite3.sqlite_version, bool(fk)) if not fk: raise Exception('No foreign keys!?') c = conn.cursor() c.executescript(''' create table if not exists main.one (resource_id TEXT PRIMARY KEY, data TEXT); create table if not exists main.two (node_id INTEGER PRIMARY KEY, data TEXT); create table if not exists main.mapping (node_id INTEGER REFERENCES two, resource_id TEXT REFERENCES one); insert into main.one(resource_id, data) values('A', 'A one thing'); insert into main.two(node_id, data) values(1, 'A two thing'); insert into main.mapping(resource_id, node_id) values('A', 1); insert into main.one(resource_id, data) values('B', 'Another one thing'); insert into main.two(node_id, data) values(2, 'Another two thing'); insert into main.mapping(resource_id, node_id) values('B', 2); insert into main.one(resource_id, data) values('C', 'Yet another one thing'); ''') for tbl in 'one', 'two', 'mapping': print 'TABLE main.%s:\n%s\n' % (tbl, '\n'.join(repr(r) for r in c.execute('select * from main.%s' % tbl).fetchall())) del_cmd = delete from main.one where resource_id='B' print 'Attempting: %s' % (del_cmd,) try: c.execute(del_cmd) except Exception, e: print 'Failed to delete: %s' % e cmd = delete from main.one where resource_id='C' print 'Attempting: %s' % (cmd,) c.execute(cmd) cmd = delete from main.mapping where resource_id='B' AND node_id=2 print '\nAttempting: %s' % (cmd,) c.execute(cmd) for tbl in 'one', 'two', 'mapping': print 'TABLE main.%s:\n%s\n' % (tbl, '\n'.join(repr(r) for r in c.execute('select * from main.%s' % tbl).fetchall())) print 'Attempting: %s' % (del_cmd,) c.execute(del_cmd) This fails with sqlite3.IntegrityError: foreign key constraint failed. Original report comes from SO: http://stackoverflow.com/questions/9342763/sqlite3-foreign-keys-remembered The proposed solution (to upgrade sqlite) is not possible on Windows as it comes bundled with Python. So please update the bundled sqlite version where this bug is solved. -- components: Extension Modules messages: 201728 nosy: schlamar priority: normal severity: normal status: open title: Bug in sqlite in Windows binaries versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19450 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18683] Core dumps on CentOS
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 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18683 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19451] urlparse accepts invalid hostnames
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 and Identifiers, urlparse is supposed to deal with the latter (correct me if I'm wrong). According to RFC 2181 section 11 on the syntax of DNS names the use of the underscore is allowed and in use around the internet, especially in TXT and SRV records. However, RFC 1738 on Uniform Resource Locators section 3.1 (and its updates) always define the 'hostname' part of the URL as being: Such a name consists of a sequence of domain labels separated by ., each domain label starting and ending with an alphanumeric character and possibly also containing - characters. On top of that, RFC 2396 on URI's section 3.2.2: Hostnames take the form described in Section 3 of [RFC1034] and Section 2.1 of [RFC1123]: a sequence of domain labels separated by ., each domain label starting and ending with an alphanumeric character and possibly also containing - characters. The underscore is never mentioned as being a valid character nor do any of the references in the RFC's as far as I've been able to see. Languages implementations vary: * Ruby URI.parse does not allow for underscores in domain labels. * Perl URI and URI::URL allow for underscores. * java.net.uri treats the underscore as an illegal character in the domain part. * org.apache.http.httphost since 4.2.3 treats the underscore as an illegal character in the domain part. Httpd's: * Apache: Seems to tolerate underscores but there's been a whole discussion about this on the mailing lists. * nginx: Matches a server_name of '_' to 'any invalid domain name'. It seems to accept server_names with underscores in them but the behaviour is currently unknown to me. Browsers: * IE cannot write cookies since IE 5.5 if host or subdomain part includes an underscore. * Just about every other browser is fine with it. Please note that I'm only talking about the host/domain/subdomain part of URI's and URL's, something like http://en.wikipedia.org/wiki/12-hour_clock is perfectly valid and should parse. -- components: Library (Lib) messages: 201730 nosy: daenney, orsenthil priority: normal severity: normal status: open title: urlparse accepts invalid hostnames type: behavior versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19451 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19443] add to dict fails after 1,000,000 items on py 2.7.5
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 ... d[n] = n ... i += 1 ... import os os.system(grep VmRSS /proc/%s/status % os.getpid()) VmRSS:637984 kB 0 On Py 2.7.5 (windows7, x64, 4GB ram) this program slowed down obviously after passing 1,000,000 adds and never completed or raised an exception. What is the exception? How much free memory do you have? If Python has not enough memory, Windows will probably starts to move memory to the disk and the system will becomes slower and slower. -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19443 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19449] csv.DictWriter can't handle extra non-string fields
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 rep...@bugs.python.org http://bugs.python.org/issue19449 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19449] csv.DictWriter can't handle extra non-string fields
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.) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19449 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19452] ElementTree iterparse documentation
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 data. events is a list of events to report back. But 'events' must be a *tuple* or iterparse raises TypeError: invalid event tuple Possibly also worth explaining that start-ns event is accompanied by a tuple of (namespace, url) rather than an element from the XML document. Currently the description just says ns events are used to get detailed namespace information but doesn't say how or give an example. -- assignee: docs@python components: Documentation messages: 201734 nosy: Peter.Harris, docs@python priority: normal severity: normal status: open title: ElementTree iterparse documentation versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19452 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19449] csv.DictWriter can't handle extra non-string fields
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 through str before being written anyway... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19449 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19451] urlparse accepts invalid hostnames
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 interesting overview on the just the DNS question: http://networkadminkb.com/KB/a156/windows-2003-dns-and-the-underscore.aspx Given that changing this would be a backward incompatible change, I recommend closing this as won't fix. I suspect the long term trend will be that everyone will eventually accept underscores, regardless of what the RFCs say. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19451 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19407] PEP 453: update the Installing Python Modules documentation
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 rep...@bugs.python.org http://bugs.python.org/issue19407 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19449] csv.DictWriter can't handle extra non-string fields
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 http://bugs.python.org/issue19449 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19414] OrderedDict.values() behavior for modified instance
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 behave this way as well. -- nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19414 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19413] Reload semantics changed unexpectedly in Python 3.3
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 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19063] Python 3.3.3 encodes emails containing non-ascii data as 7bit
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 content-transfer-encoding 8bit with 8bit data, I can modify the patch. But it doesn't feel right... -- keywords: +patch nosy: +vajrasky Added file: http://bugs.python.org/file32426/fix_8bit_data_charset_none_set_payload.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19063 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19414] OrderedDict.values() behavior for modified instance
Armin Rigo added the comment: 'list' doesn't, precisely. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19414 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19414] OrderedDict.values() behavior for modified instance
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 rep...@bugs.python.org http://bugs.python.org/issue19414 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19445] heapq.heapify is n log(n), not linear
Blaise Gassend added the comment: I stand corrected. Sorry for the noise. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19445 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19414] OrderedDict.values() behavior for modified instance
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 changes during iteration? I think these two things actually come together quite naturally, since it is the existence of an ordering that makes the behavior under changes during iteration well defined. Is there really a danger that people will get confused because a previously undefined operation now becomes officially supported with a defined meaning? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19414 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19452] ElementTree iterparse documentation
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 aspect of a tuple/list/sequence has no meaning for it. -- components: +XML nosy: +eli.bendersky, scoder type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19452 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19435] Directory traversal attack for CGIHTTPRequestHandler
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 the run_cgi method (closes #19435) http://hg.python.org/cpython/rev/b1ddcb220a7f New changeset dda1a32748e0 by Benjamin Peterson in branch '3.2': merge 3.1 (#19435) http://hg.python.org/cpython/rev/dda1a32748e0 New changeset 544b654d000c by Benjamin Peterson in branch '3.3': merge 3.2 (#19435) http://hg.python.org/cpython/rev/544b654d000c New changeset 493a99acaf00 by Benjamin Peterson in branch 'default': merge 3.3 (#19435) http://hg.python.org/cpython/rev/493a99acaf00 -- nosy: +python-dev resolution: - fixed stage: test needed - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19435 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18458] interactive interpreter crashes and test_readline fails on OS X 10.9 Mavericks due to libedit update
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 be patched - skipped -- 3.2 not found - skipped -- 3.3 not found - skipped -- 3.4 not found - skipped -- done -- nosy: +mrichman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18458 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19424] _warnings: patch to avoid conversions from/to UTF-8
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] ..\Objects\unicodeobject.c(10592): warning C4018: '' : signed/unsigned mismatch [P:\Projects\OSS\Python\cpython\PCbuild\pythoncore.vcxproj] ..\Objects\unicodeobject.c(10594): warning C4018: '' : signed/unsigned mismatch [P:\Projects\OSS\Python\cpython\PCbuild\pythoncore.vcxproj] Vajrasky's patch doesn't fix the Windows warnings (but doesn't create any new ones either); the attached patch does (but likely doesn't do anything for the other). I don't know nearly enough C to say whether my patch is any good or not, just enough to say it compiles, doesn't break anything immediately obvious, and removes the warnings on Windows. -- nosy: +zach.ware Added file: http://bugs.python.org/file32427/issue19424-windows-warnings.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19424 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19453] pydoc.py doesn't detect IronPython, help(foo) can hang
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 sys.platform and needs to check for cli as well to detect IronPython running on mono on linux/mac os or on windows. My naive change to workaround the problem was to add the two line test for cli amidst getpager() here: if sys.platform == 'win32' or sys.platform.startswith('os2'): return lambda text: tempfilepager(plain(text), 'more ') if sys.platform == 'cli': return plainpager # IronPython if hasattr(os, 'system') and os.system('(less) 2/dev/null') == 0: return lambda text: pipepager(text, 'less') That two line addition allowed basic function and prevents the hang though maybe there is a better pager type that would work on IronPython. In our linux and windows tests though neither the tempfilepager nor pipepager would function on either platform. I submitted the report to the IronPython issues tracker and someone there suggested posting the patch here. -- components: Windows messages: 201750 nosy: owlmonkey priority: normal severity: normal status: open title: pydoc.py doesn't detect IronPython, help(foo) can hang type: crash versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19453 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19414] OrderedDict.values() behavior for modified instance
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 dict and we're good to go; and this trick works with dicts, defaultdicts, sets, lists (when you don't want the skipping behavior), etc. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19414 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19424] _warnings: patch to avoid conversions from/to UTF-8
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 http://bugs.python.org/issue19424 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19451] urlparse accepts invalid hostnames
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 a mess anyway so lets ignore the RFC. There's an RFC for a reason and if more implementations started to behave accordingly the mess would clear itself up instead of becoming even more of a nightmare. I can agree with the practical over strict approach though. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19451 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19451] urlparse accepts invalid hostnames
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? It appears that the current RFCs have no provision for handling that case. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19451 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19444] mmap.mmap() allocates a file descriptor that isn't CLOEXEC
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 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19452] ElementTree iterparse documentation
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 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19414] OrderedDict.values() behavior for modified instance
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: if some_condition: del ordered_dict[key] to be working? Is it really just the fact that the above could does not work for regular dicts? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19414 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19414] OrderedDict.values() behavior for modified instance
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 were allowed for ordered dicts? You're not forced to use the feature, since you can still safely continue to use ordered dicts like regular dicts. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19414 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19377] Backport SVG mime type to Python 2
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. -- resolution: wont fix - status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19377 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19172] selectors: add keys() method
Guido van Rossum added the comment: LGTM. Commit! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19172 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19172] selectors: add keys() method
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 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19454] devguide: Document what a platform support is
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: Devguide, Documentation messages: 201762 nosy: docs@python, ezio.melotti, techtonik priority: normal severity: normal status: open title: devguide: Document what a platform support is ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19454 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19414] OrderedDict.values() behavior for modified instance
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 any other mapping type the same way, whereas if you make OrderedDict special in this area you've locked out the other types. In my opinion the differences in OrderedDict should be limited to what is necessary to make a dict ordered. The ability to insert/delete keys while iterating is not necessary to maintaining an order, and the break from other dicts doesn't add enough value to make it worth it. So, yes, the short answer is because Python's other similar types don't do it that way, OrderedDict shouldn't either. [1] If the dict is large, collect the to_be_deleted keys in a separate list and remove them after the loop. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19414 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19377] Backport SVG mime type to Python 2
anatoly techtonik added the comment: Added issue19454 to settle this down. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19377 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19437] More failures found by pyfailmalloc
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(), fix code handling PyMem_New() error http://hg.python.org/cpython/rev/b49f9aa12dae -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19437 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19414] OrderedDict.values() behavior for modified instance
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 this an OrderedDict? 3) (yes) oh, okay, it's fine then done 3) (no) hmm, well, it was supposed to be, but a regular dict was passed in 4) okay, we either fix the code here to handle regular dicts (use list idiom); or go back to calling code and make this an OrderedDict I see that as a lot of extra effort for a non-necessary change. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19414 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19443] add to dict fails after 1,000,000 items on py 2.7.5
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 after 44,000,000 adds. However, the program did not stop or raise an exception, which is a concern. The size of the dict was 1.6 GB at that level. My current suspicion is that Windows is not doing a good job of pushing memory already allocated by the process to the virtual file system as the process continues to request more memory. But in my opinion Python should be able to detect failure to complete an allocation request on Windows, and raise an appropriate exception, as it does for Linux. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19443 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19443] add to dict fails after 1,000,000 items on py 2.7.5
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?) -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19443 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19443] add to dict fails after 1,000,000 items on py 2.7.5
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 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19063] Python 3.3.3 encodes emails containing non-ascii data as 7bit
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* have any 8bit data in it. Unicode is not an 8bit channel (in SMTP terms) it is a 7bit channel (ie: restricted to ASCII). The *decoded* version of the message can have non-ASCII in it, but as_string is producing an *encoded* version. The CTE applies only to an encoded version. It gets a little confusing because in Python we are used to 'decoding' to unicode and 'encoding' to bytes, but in the email package we also sometimes 'encode' to ASCII but use unicode strings to store it. If we didn't have to maintain backward compatibility it would probably be better to just drop as_string :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19063 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19172] selectors: add keys() method
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 rep...@bugs.python.org http://bugs.python.org/issue19172 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18458] interactive interpreter crashes and test_readline fails on OS X 10.9 Mavericks due to libedit update
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 otherwise installed into /Library/Frameworks). Please check which python you are using. Using whatever command name you enter to start the failing python, try the following (I'll assume you use python2.7): type python2.7 which python2.7 python2.7 -c import sys;print(sys.version) python2.7 -c import sys;print(sys.executable) The value for sys.executable should be: /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python In any case, you could manually rename _readline.so as shown in one of the earlier messages (substituting 2.7 for 3.3). Or you could install 2.7.6rc1. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18458 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18923] Use the new selectors module in the subprocess module
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 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18923 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18458] interactive interpreter crashes and test_readline fails on OS X 10.9 Mavericks due to libedit update
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 30, 2013 at 3:32 PM, Ned Deily rep...@bugs.python.org wrote: 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 otherwise installed into /Library/Frameworks). Please check which python you are using. Using whatever command name you enter to start the failing python, try the following (I'll assume you use python2.7): type python2.7 which python2.7 python2.7 -c import sys;print(sys.version) python2.7 -c import sys;print(sys.executable) The value for sys.executable should be: /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python In any case, you could manually rename _readline.so as shown in one of the earlier messages (substituting 2.7 for 3.3). Or you could install 2.7.6rc1. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18458 ___ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18458 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19414] OrderedDict.values() behavior for modified instance
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 RuntimeError (as Armin suggested), or just end the iteration? Note that RuntimeError would only be raised when the current element is removed from the dict, and the ordered dict would still tolerate other kinds of modifications. Both variants would also be a change from previous behavior (were removing the current elements works as long as you do not remove the next one as well). The minimally intrusive change would be to skip over elements that have been removed, but that comes at the expense of an additional membership test in each iteration. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19414 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19172] selectors: add keys() method
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 http://bugs.python.org/issue19172 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17134] Use Windows' certificate store for CA certs
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 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17134] Use Windows' certificate store for CA certs
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 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17134] Use Windows' certificate store for CA certs
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 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19414] OrderedDict.values() behavior for modified instance
Ethan Furman added the comment: Personally, I would rather see a RuntimeError raised. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19414 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17134] Use Windows' certificate store for CA certs
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 OIDs or True. The OIDs can be interpreter with the new functions #19448. Both functions are intended to be low level interfaces to Window's cert store. -- Added file: http://bugs.python.org/file32430/enum_cert_trust2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17134 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19414] OrderedDict.values() behavior for modified instance
Serhiy Storchaka added the comment: See also issue19332. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19414 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19332] Guard against changing dict during iteration
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 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19450] Bug in sqlite in Windows binaries
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 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19455] LoggerAdapter class lacks documented setLevel method
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 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19455 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19063] Python 3.3.3 encodes emails containing non-ascii data as 7bit
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 process(self, msg, kwargs): return '[%s] %s' % (self.extra['connid'], msg), kwargs logger = logging.getLogger(__name__) adapter = CustomAdapter(logger, {'connid': '1234'}) adapter.setLevel (logging.WARN) adapter.warning (Ahoy matey) -- nosy: +Eric.Hanchrow ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19063 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19063] Python 3.3.3 encodes emails containing non-ascii data as 7bit
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 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19455] LoggerAdapter class lacks documented setLevel method
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): def process(self, msg, kwargs): return '[%s] %s' % (self.extra['connid'], msg), kwargs logger = logging.getLogger(__name__) adapter = CustomAdapter(logger, {'connid': '1234'}) adapter.setLevel (logging.WARN) adapter.warning (Ahoy matey) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19455 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19444] mmap.mmap() allocates a file descriptor that isn't CLOEXEC
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19444 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19456] ntpath doesn't join paths correctly when a drive is present
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 2.7 and 3.3) (Let's also make sure PEP 428 / pathlib fixes this.) -- components: Library (Lib) keywords: easy messages: 201784 nosy: gvanrossum, pitrou priority: normal severity: normal status: open title: ntpath doesn't join paths correctly when a drive is present type: behavior versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19456 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19455] LoggerAdapter class lacks documented setLevel method
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 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19455 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19414] iter(ordered_dict) yields keys not in dict in some circumstances
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 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19457] test.test_codeccallbacks.CodecCallbackTest.test_xmlcharrefreplace_with_surrogates() and test.test_unicode.UnicodeTest.test_encode_decimal_with_surrogates() loaded from *.pyc files fail wi
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 files (test_codeccallbacks.pyc, test_unicode.pyc). (This bug can be reproduced when running `make test`, which runs test suite twice, firstly with *.pyc files initially absent.) This bug is a regression in 2.7.6rc1. These tests are absent in 2.7.5. These tests were added in 719ee60fc5e2. $ ./configure --enable-unicode=ucs4 ... $ make ... $ LD_LIBRARY_PATH=$(pwd) ./python Lib/test/regrtest.py -v test_codeccallbacks ... $ LD_LIBRARY_PATH=$(pwd) ./python Lib/test/regrtest.py -v test_codeccallbacks == CPython 2.7.6rc1 (2.7:dd12639b82bf, Oct 30 2013, 23:53:21) [GCC 4.8.1] == Linux-3.11.6 == /tmp/cpython/build/test_python_6715 Testing with flags: sys.flags(debug=0, py3k_warning=0, division_warning=0, division_new=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, tabcheck=0, verbose=0, unicode=0, bytes_warning=0, hash_randomization=0) test_codeccallbacks test_backslashescape (test.test_codeccallbacks.CodecCallbackTest) ... ok test_badandgoodbackslashreplaceexceptions (test.test_codeccallbacks.CodecCallbackTest) ... ok test_badandgoodignoreexceptions (test.test_codeccallbacks.CodecCallbackTest) ... ok test_badandgoodreplaceexceptions (test.test_codeccallbacks.CodecCallbackTest) ... ok test_badandgoodstrictexceptions (test.test_codeccallbacks.CodecCallbackTest) ... ok test_badandgoodxmlcharrefreplaceexceptions (test.test_codeccallbacks.CodecCallbackTest) ... ok test_badhandlerresults (test.test_codeccallbacks.CodecCallbackTest) ... ok test_badlookupcall (test.test_codeccallbacks.CodecCallbackTest) ... ok test_badregistercall (test.test_codeccallbacks.CodecCallbackTest) ... ok test_bug828737 (test.test_codeccallbacks.CodecCallbackTest) ... ok test_callbacks (test.test_codeccallbacks.CodecCallbackTest) ... ok test_charmapencode (test.test_codeccallbacks.CodecCallbackTest) ... ok test_decodehelper (test.test_codeccallbacks.CodecCallbackTest) ... ok test_decodeunicodeinternal (test.test_codeccallbacks.CodecCallbackTest) ... ok test_decoding_callbacks (test.test_codeccallbacks.CodecCallbackTest) ... ok test_encodehelper (test.test_codeccallbacks.CodecCallbackTest) ... ok test_longstrings (test.test_codeccallbacks.CodecCallbackTest) ... ok test_lookup (test.test_codeccallbacks.CodecCallbackTest) ... ok test_translatehelper (test.test_codeccallbacks.CodecCallbackTest) ... ok test_unencodablereplacement (test.test_codeccallbacks.CodecCallbackTest) ... ok test_unicodedecodeerror (test.test_codeccallbacks.CodecCallbackTest) ... ok test_unicodeencodeerror (test.test_codeccallbacks.CodecCallbackTest) ... ok test_unicodetranslateerror (test.test_codeccallbacks.CodecCallbackTest) ... ok test_uninamereplace (test.test_codeccallbacks.CodecCallbackTest) ... ok test_unknownhandler (test.test_codeccallbacks.CodecCallbackTest) ... ok test_xmlcharnamereplace (test.test_codeccallbacks.CodecCallbackTest) ... ok test_xmlcharrefreplace (test.test_codeccallbacks.CodecCallbackTest) ... ok test_xmlcharrefreplace_with_surrogates (test.test_codeccallbacks.CodecCallbackTest) ... FAIL test_xmlcharrefvalues (test.test_codeccallbacks.CodecCallbackTest) ... ok == FAIL: test_xmlcharrefreplace_with_surrogates (test.test_codeccallbacks.CodecCallbackTest) -- Traceback (most recent call last): File /tmp/cpython/Lib/test/test_codeccallbacks.py, line 93, in test_xmlcharrefreplace_with_surrogates exp, msg='%r.encode(%r)' % (s, encoding)) AssertionError: u'\U0001f49d'.encode('ascii') -- Ran 29 tests in 0.071s FAILED (failures=1) test test_codeccallbacks failed -- Traceback (most recent call last): File /tmp/cpython/Lib/test/test_codeccallbacks.py, line 93, in test_xmlcharrefreplace_with_surrogates exp, msg='%r.encode(%r)' % (s, encoding)) AssertionError: u'\U0001f49d'.encode('ascii') 1 test failed: test_codeccallbacks $ LD_LIBRARY_PATH=$(pwd) ./python Lib/test/regrtest.py -v test_unicode ... $ LD_LIBRARY_PATH=$(pwd) ./python Lib/test/regrtest.py -v test_unicode == CPython 2.7.6rc1 (2.7:dd12639b82bf, Oct 30 2013, 23:53:21) [GCC 4.8.1] == Linux-3.11.6 == /tmp/cpython/build/test_python_7518 Testing with flags: sys.flags(debug=0, py3k_warning=0, division_warning=0, division_new=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, tabcheck=0, verbose=0, unicode=0, bytes_warning=0, hash_randomization=0) test_unicode test___contains__ (test.test_unicode.UnicodeTest) ... ok test__format__
[issue19063] Python 3.3.3 encodes emails containing non-ascii data as 7bit
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 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19063] Python 3.3.3 encodes emails containing non-ascii data as 7bit
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 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19455] LoggerAdapter class lacks documented setLevel method
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(), exception(), critical(), log(), isEnabledFor(), getEffectiveLevel(), setLevel(), hasHandlers(). So the code and the docs disagree. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19455 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19455] LoggerAdapter class lacks documented setLevel method
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 http://bugs.python.org/issue19455 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19455] LoggerAdapter class lacks documented setLevel method
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 I'll update the documentation. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19455 ___ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19455 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19455] LoggerAdapter class lacks documented setLevel method
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 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19455 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15873] datetime: add ability to parse RFC 3339 dates and times
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15873 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19458] Invitation to connect on LinkedIn
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: https://www.linkedin.com/e/-3qcne3-hnfe5x2a-17/isd/10674146693/f8KKDSuG/?hs=falsetok=1ZDH7D-C56MRY1 -- You are receiving Invitation to Connect emails. Click to unsubscribe: http://www.linkedin.com/e/-3qcne3-hnfe5x2a-17/z2oU7dKDzpt2G7xQz2FC2SclHmnUGzmsk0c/goo/report%40bugs%2Epython%2Eorg/20061/I5845690646_1/?hs=falsetok=1LjfL2tR56MRY1 (c) 2012 LinkedIn Corporation. 2029 Stierlin Ct, Mountain View, CA 94043, USA. -- messages: 201791 nosy: hankchristian priority: normal severity: normal status: open title: Invitation to connect on LinkedIn ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19458 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19458] Invitation to connect on LinkedIn
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 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19458] spam
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 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19063] Python 3.3.3 encodes emails containing non-ascii data as 7bit
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 = Message() msg.set_payload('АБВ', cs) msg.as_string() == cte - 7bit message - АБВ or \\u0410\\u0411\\u0412 or \xd0\x90\xd0\x91\xd0\x92? msg.as_bytes() == cte - 8bit message - \\u0410\\u0411\\u0412 or \xd0\x90\xd0\x91\xd0\x92? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19063 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19063] Python 3.3.3 encodes emails containing non-ascii data as 7bit
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 Generator, it will get converted to 7bit clean by doing (I think) a base64 encode and emitting that as the CTE. I have to look through the code to remind myself how it all works, which I haven't had time for yet, which is why I haven't tried to make a fix myself yet. (Yes, this is poor design, but we are dealing with a long line of legacy code and API here...) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19063 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com