Re: how to string format when string have {

2014-04-21 Thread Peter Otten
Chris Angelico wrote: On Mon, Apr 21, 2014 at 8:34 AM, Mariano DAngelo marianoa.dang...@gmail.com wrote: And I want to format like this: context = { project_name:project_name, project_url:project_url, } nginx_conf.format(**context) but since the string have { i can't. Is there a

Re: how to string format when string have {

2014-04-21 Thread Chris Angelico
On Mon, Apr 21, 2014 at 6:51 PM, Peter Otten __pete...@web.de wrote: Some regex gymnastics in the morning (not recommended): You ask me to believe that a regex would be the best solution here? There's no use trying; one CAN'T believe impossible things. ChrisA (There goes the shawl again!) --

Read TLS cert serial number?

2014-04-21 Thread Anthony Papillion
Is there a way to read the serial number of a TLS cert my app receives? Anthony Sent from my mobile device -- https://mail.python.org/mailman/listinfo/python-list

Re: Why Python 3?

2014-04-21 Thread wxjmfauth
wxPhoenix. The funny side of wxPhoenix is, that it *also* has its own understanding of unicode and it finally only succeeds to produce mojibakes. I've tried to explained... (I was an early wxPython user from wxPython 2.0 (!). I used, tested, reported about, all wxPython versions up to the shift

Re: symple programming task

2014-04-21 Thread Joshua Landau
On 20 April 2014 20:27, Ivan Ivanivich ivriabt...@gmail.com wrote: thanks, i found the bag G'day. This [https://xkcd.com/979/] applies to threads ending in nvm, solved it too. I know the problem in your case isn't likely to be widely useful, but there are other benefits of pointing out what

Re: symple programming task

2014-04-21 Thread Ivan Ivanivich
On Sunday, April 20, 2014 10:43:37 PM UTC+4, Ivan Ivanivich wrote: hi all, i have simple programming task: [quot] If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples

Recommended exception for objects that can't be pickled

2014-04-21 Thread Stefan Schwarzer
Hi, Recently, I got a request [1] to support pickling of `FTPHost` instances in my `ftplib` library. I explained in the ticket why I think it's a bad idea and now want to make explicit that `FTPHost` objects can't be pickled. The usual way to do this seems to be defining a `__getstate__` method

Re: symple programming task

2014-04-21 Thread Tim Chase
On 2014-04-21 06:21, Ivan Ivanivich wrote: Find the sum of all the multiples of 3 or 5 below 1000. my new version of script: total = 0 div1 = 3 div2 = 5 for basis in range(0, 1000): mod = basis % div1 if mod == 0: total = total + basis

Re: symple programming task

2014-04-21 Thread Chris Angelico
On Mon, Apr 21, 2014 at 11:21 PM, Ivan Ivanivich ivriabt...@gmail.com wrote: if basis is 15, then mod == 0 twice - when the divider is 3 and 15 Good! Yes, you worked out exactly what the problem is. :) There are ways to simplify your code, but it's now giving the correct result, so that's the

selective (inheriting?) dir()?

2014-04-21 Thread Skip Montanaro
Before I get up to my neck in gators over this, I was hoping perhaps someone already had a solution. Suppose I have two classes, A and B, the latter inheriting from the former: class A: def __init__(self): self.x = 0 class B(A): def __init__(self): A.__init__(self)

which book to read next??

2014-04-21 Thread lee
Hi, I have read the book 'a byte of python' and now I want to read another book. But I just get confused about which one to read next. There is a book list below: 1, pro python 2, python algorithms 3, python cookbook 4, the python standard library by examples which one is suitable for me?? Or I

Re: selective (inheriting?) dir()?

2014-04-21 Thread Chris Angelico
On Tue, Apr 22, 2014 at 12:06 AM, Skip Montanaro s...@pobox.com wrote: Without examining the source, is it possible to define some kind of selective dir, with a API like def selective_dir(inst, class_): pass which will list only those attributes of inst which were first defined in (some

Re: selective (inheriting?) dir()?

2014-04-21 Thread Steven D'Aprano
On Mon, 21 Apr 2014 09:06:14 -0500, Skip Montanaro wrote: [...] Now, dir(inst_b) will list both 'x' and 'y' as attributes (along with the various under under attributes). Without examining the source, is it possible to define some kind of selective dir, with a API like def

Re: which book to read next??

2014-04-21 Thread Alan Gauld
On 21/04/14 15:13, lee wrote: Hi, I have read the book 'a byte of python' and now I want to read another book. But I just get confused about which one to read next. There is a book list below: 1, pro python 2, python algorithms 3, python cookbook 4, the python standard library by examples which

Re: selective (inheriting?) dir()?

2014-04-21 Thread Skip Montanaro
Thanks for the responses. I'm not really interested in perfection here. I do most of my programming in a mature internally developed platform written in Python. As the platform has grown and approaches to different problems have changed 12-15 year period, some of the classes which are

Re: which book to read next??

2014-04-21 Thread Joel Goldstick
On Mon, Apr 21, 2014 at 11:41 AM, Alan Gauld alan.ga...@btinternet.comwrote: On 21/04/14 15:13, lee wrote: Hi, I have read the book 'a byte of python' and now I want to read another book. But I just get confused about which one to read next. There is a book list below: 1, pro python 2,

Re: which book to read next??

2014-04-21 Thread Tim Chase
On 2014-04-21 22:13, lee wrote: Hi, I have read the book 'a byte of python' and now I want to read another book. But I just get confused about which one to read next. There is a book list below: 1, pro python 2, python algorithms 3, python cookbook 4, the python standard library by examples

Re: which book to read next??

2014-04-21 Thread Chris Angelico
On Tue, Apr 22, 2014 at 2:20 AM, Tim Chase python.l...@tim.thechases.com wrote: Problem: I'm bored Solution: write yourself a game in pygame Alternative solution: Join python-ideas as well as python-list, and pledge to read *every* post. ChrisA --

Re: which book to read next??

2014-04-21 Thread Mark Lawrence
On 21/04/2014 17:22, Chris Angelico wrote: On Tue, Apr 22, 2014 at 2:20 AM, Tim Chase python.l...@tim.thechases.com wrote: Problem: I'm bored Solution: write yourself a game in pygame Alternative solution: Join python-ideas as well as python-list, and pledge to read *every* post. ChrisA

which book to read next??

2014-04-21 Thread lee
Thanks for all of the respones, Writing a game in pygame is a good idea. Thank you! -- 发自 Android 网易邮箱-- https://mail.python.org/mailman/listinfo/python-list

Re: [OT] Testing and credentials best practices?

2014-04-21 Thread Miki Tebeka
How do you deal with tests (both on dev machine and Jenkins) that need credentials (such as AWS keys)?. I've done several of these. Another option that may work in some contexts is to mock the test altogether; Thanks, but mocking is last resort for me, it reduces the value of testing greatly

Re: Recommended exception for objects that can't be pickled

2014-04-21 Thread Terry Reedy
On 4/21/2014 9:23 AM, Stefan Schwarzer wrote: Hi, Recently, I got a request [1] to support pickling of `FTPHost` instances in my `ftplib` library. I explained in the ticket why I think it's a bad idea and now want to make explicit that `FTPHost` objects can't be pickled. The usual way to do

Re: selective (inheriting?) dir()?

2014-04-21 Thread Terry Reedy
On 4/21/2014 10:06 AM, Skip Montanaro wrote: Before I get up to my neck in gators over this, I was hoping perhaps someone already had a solution. Suppose I have two classes, A and B, the latter inheriting from the former: class A: def __init__(self): self.x = 0 class B(A):

Re: which book to read next??

2014-04-21 Thread Emile van Sebille
On 4/21/2014 7:13 AM, lee wrote: 4, the python standard library by examples I'd take this on -- it provides a comprehensive overview of what's where in the standard library which you'll likely use a lot. which one is suitable for me?? That we can't answer. :) Emile --

Re: Why Python 3?

2014-04-21 Thread Gregory Ewing
Chris Angelico wrote: Earlier it was said that having both / and // lets you explicitly choose whether you want a float result or an int by picking an operator. I'm saying that's not so; the operator and the type aren't quite orthogonal, but close to. I don't think I said that, or if I did I

Re: Why Python 3?

2014-04-21 Thread Gregory Ewing
Chris Angelico wrote: All other basic arithmetic operations on two numbers of the same type results in another number of that type. ... There's just one special case: dividing an integer by an integer yields a float, if and only if you use truediv. It sticks out as an exception. I take your

Re: Why Python 3?

2014-04-21 Thread Chris Angelico
On Tue, Apr 22, 2014 at 8:28 AM, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: The reason it doesn't work well is because of the automatic promotion of ints to floats when they meet other floats. This leads to a style where people often use ints to stand for int-valued floats and expect

How to properly get the microseconds from the timestamps?

2014-04-21 Thread Igor Korot
Hi, ALL, C:\Documents and Settings\Igor.FORDANWORK\My Documents\GitHub\webapp\django\mysql_db_loaderpython 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 datetime

Unicode in Python

2014-04-21 Thread Rustom Mody
On Sunday, April 20, 2014 3:29:00 PM UTC+5:30, Steven D'Aprano wrote: On Fri, 18 Apr 2014 23:40:18 -0700, Paul Rubin wrote: It's just that the improvement from 2 to 3 is rather small, and 2 works perfectly well and people are used to it, so they keep using it. Spoken like a true

Re: Unicode in Python

2014-04-21 Thread Terry Reedy
On 4/21/2014 11:57 PM, Rustom Mody wrote: As a unicode user (ok wannabe unicode user :D ) Ive written up some unicode ideas that have been discussed here in the last couple of weeks: http://blog.languager.org/2014/04/unicoded-python.html With python 3 we are at a stage where python programs

[issue1234674] filecmp.cmp's shallow option

2014-04-21 Thread Steven Barker
Steven Barker added the comment: A recent Stack Overflow question (http://stackoverflow.com/q/23192359/1405065) relates to this bug. The questioner was surprised that filecmp.cmp is much slower than usual for certain large files, despite the shallow parameter being True. It is pretty clear

[issue21320] dict() allows keyword expansion with integer keys, e.g. dict(**{5:'v'})

2014-04-21 Thread Cyphase
New submission from Cyphase: Python 2.7.6: Affected Python 3.2.3: Not affected dict() allows keyword expansion using a dict() with integer keys, whereas attempting to do so with most other functions raises a TypeError with the message, keywords must be strings. The same thing happens with

[issue21321] itertools.islice() doesn't release reference to the source iterator when the slice is exhausted

2014-04-21 Thread Anton Afanasyev
New submission from Anton Afanasyev: This issue results in redundant memory consumption for e.g. in this case: from itertools import * def test_islice(): items, lookahead = tee(repeat(1, int(1e9))) lookahead = islice(lookahead, 10)

[issue21321] itertools.islice() doesn't release reference to the source iterator when the slice is exhausted

2014-04-21 Thread Anton Afanasyev
Anton Afanasyev added the comment: Added patch for 2.7 version (no need to change '__reduce__()' method since it's not implemented). -- Added file: http://bugs.python.org/file34991/issue21321_2.7_e3217efa6edd.diff ___ Python tracker

[issue21303] Python 2.7 Spinbox Format Behaves Differently On Windows Versus Linux

2014-04-21 Thread Michael Boldischar
Michael Boldischar added the comment: Windows 7 64-bit: python --version Python 2.7.6 Debian 7 Linux 64-bit: $ python --version Python 2.7.3 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21303

[issue21303] Python 2.7 Spinbox Format Behaves Differently On Windows Versus Linux

2014-04-21 Thread Michael Boldischar
Michael Boldischar added the comment: Windows 7 64-bit: root.tk.eval('info patchlevel') '8.5.2' Debian 7 Linux 64-bit: root.tk.eval('info patchlevel') '8.5.11' -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21303

[issue18967] Find a less conflict prone approach to Misc/NEWS

2014-04-21 Thread R. David Murray
R. David Murray added the comment: In order for things to work with a patch gating system, I believe it will be the most practical for the news items to be each in a separate file. -- ___ Python tracker rep...@bugs.python.org

[issue21283] A escape character is used when a REGEXP is an argument of strip string function

2014-04-21 Thread Tito Bouzout
Tito Bouzout added the comment: Thanks guys for the information! Is still weird to me that the escape character is used, but well ! Will remember this bug. Kind regards, -- ___ Python tracker rep...@bugs.python.org

[issue18967] Find a less conflict prone approach to Misc/NEWS

2014-04-21 Thread Ezio Melotti
Ezio Melotti added the comment: Unless one looks carefully, it does not help the problen of merging maintenance bugfix items into a default list that also contains enhancement news not in the maintenance list*. What if instead of having sections in Misc/NEWS for

[issue21320] dict() allows keyword expansion with integer keys, e.g. dict(**{5:'v'})

2014-04-21 Thread R. David Murray
R. David Murray added the comment: 2.7 can't be changed for backward compatibility reasons, and python3 enforces the restriction in dict, as you observe. I don't know if a python2 documentation note is worthwhile, but given the conversations at pycon about adding additional -3 warnings to

[issue21303] Python 2.7 Spinbox Format Behaves Differently On Windows Versus Linux

2014-04-21 Thread Zachary Ware
Zachary Ware added the comment: From some testing, this looks like a Tcl/Tk bug, fixed somewhere between 8.5.9 and 8.5.11: Python 3.2.5 which shipped with Tcl/Tk 8.5.9 shows this bug; Python 3.3.5 which shipped with Tcl/Tk 8.5.11 does not, and Python 2.7 built with Tcl/Tk 8.5.11 doesn't show

[issue21303] Python 2.7 Spinbox Format Behaves Differently On Windows Versus Linux

2014-04-21 Thread Benjamin Peterson
Benjamin Peterson added the comment: On Mon, Apr 21, 2014, at 8:54, Zachary Ware wrote: Zachary Ware added the comment: From some testing, this looks like a Tcl/Tk bug, fixed somewhere between 8.5.9 and 8.5.11: Python 3.2.5 which shipped with Tcl/Tk 8.5.9 shows this bug; Python 3.3.5

[issue21303] Python 2.7 Spinbox Format Behaves Differently On Windows Versus Linux

2014-04-21 Thread Zachary Ware
Zachary Ware added the comment: Any opinions on which version to update to? 8.5.11 is easy and available and fixes the bug; 8.5.15 is the newest 8.5 but not on svn.python.org; 8.6.1 is available and is also what 3.4 (and currently 3.5) ships with. --

[issue21322] Pathlib .owner() and .group() methods fail on broken links

2014-04-21 Thread Iñigo Serna
New submission from Iñigo Serna: Pathlib .owner() and .group() methods fail on broken symlinks. They use: return pwd.getpwuid(self.stat().st_uid).pw_name and: return grp.getgrgid(self.stat().st_gid).gr_name It should be self.lstat(). Attached simple fix as unified diff. --

[issue19771] runpy should check ImportError.name before wrapping it

2014-04-21 Thread R. David Murray
R. David Murray added the comment: Hmm. It seems to me that .name not being set is a bug in importlib. It appears that importlib doesn't set it in the 'from x import y' case. After a bit of experimenting at the python prompt, I'm not even sure what that code in runpy is *doing*

[issue12916] Add inspect.splitdoc

2014-04-21 Thread R. David Murray
R. David Murray added the comment: It should receive a string. This is parallel to cleandoc, and I think splitdoc should go in the documentation right after cleandoc. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12916

[issue12916] Add inspect.splitdoc

2014-04-21 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: I will fix this issue asap, but I was too tired with the travel to Belgium. Hope to propose patch during this week. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12916

[issue18401] Tests for pdb import ~/.pdbrc

2014-04-21 Thread R. David Murray
R. David Murray added the comment: Thanks, Sam. It is more helpful if the NEWS entry is *not* put in the patch given the current state of the tooling. What's needs to be added is an entry in Doc/whatsnew/3.5. For the new test, you can take advantage of the temp_dir and EnvironmentVarGuard

[issue18967] Find a less conflict prone approach to Misc/NEWS

2014-04-21 Thread R. David Murray
R. David Murray added the comment: That would probably work for now, but it wouldn't work for the patch gating system. On the other hand, it would sure make it easier to build/check whatsnew. -- ___ Python tracker rep...@bugs.python.org

[issue20962] Rather modest chunk size in gzip.GzipFile

2014-04-21 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +nadeem.vawda, serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20962 ___ ___

[issue21303] Python 2.7 Spinbox Format Behaves Differently On Windows Versus Linux

2014-04-21 Thread Ned Deily
Ned Deily added the comment: FWIW, ActiveState is shipping 8.5.15 and 8.6.1 in ActiveTcl. For the OS X installers, we have been using 8.5.x (for the 64-bit/32-bit installer) because that's also what Apple has been shipping in recent OS X versions. Serhiy has committed a number of fixes in

[issue21303] Python 2.7 Spinbox Format Behaves Differently On Windows Versus Linux

2014-04-21 Thread Benjamin Peterson
Benjamin Peterson added the comment: On Mon, Apr 21, 2014, at 9:38, Zachary Ware wrote: Zachary Ware added the comment: Any opinions on which version to update to? 8.5.11 is easy and available and fixes the bug; 8.5.15 is the newest 8.5 but not on svn.python.org; 8.6.1 is available and

[issue18967] Find a less conflict prone approach to Misc/NEWS

2014-04-21 Thread Ezio Melotti
Ezio Melotti added the comment: Also having a list of enhancements and bug fixes might be more meaningful for users than a list of core issues vs library issues vs other similar sections. This could also be done with two separate files, with the new features/enhancements file existing only on

[issue18967] Find a less conflict prone approach to Misc/NEWS

2014-04-21 Thread R. David Murray
R. David Murray added the comment: That makes the tooling of the gating system harder, though. If the NEWS can just be a file in the patch, we don't have to have any special tooling for it in the gating system. -- ___ Python tracker

[issue21323] CGI HTTP server not running scripts from subdirectories

2014-04-21 Thread Konstantin S. Solnushkin
New submission from Konstantin S. Solnushkin: Somewhere between Python 3.3 and 3.4, a bug was introduced that forbids the http.server module, working in CGI server mode, to run scripts residing in subdirectories. This will break existing software that relies on this feature. How to reproduce

[issue18967] Find a less conflict prone approach to Misc/NEWS

2014-04-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: If we put news items in a database keyed by issue number (and I think it reasonable that all news-worthy patches should have a tracker issue), then there would be no conflicts. (We already avoid simultaneous commits to the same issue.) If the database had

[issue18967] Find a less conflict prone approach to Misc/NEWS

2014-04-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: Moving News items from the repository to the tracker, where I think they initially belong anyway, would also remove them as an issue for a future gating system. -- ___ Python tracker rep...@bugs.python.org

[issue18967] Find a less conflict prone approach to Misc/NEWS

2014-04-21 Thread Zachary Ware
Zachary Ware added the comment: Terry J. Reedy wrote: Moving News items from the repository to the tracker, where I think they initially belong anyway, would also remove them as an issue for a future gating system. I think News items are best left in the repository just so that for any given

[issue18967] Find a less conflict prone approach to Misc/NEWS

2014-04-21 Thread R. David Murray
R. David Murray added the comment: Yeah, Guido was strongly in favor of that too. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18967 ___ ___

[issue18967] Find a less conflict prone approach to Misc/NEWS

2014-04-21 Thread Ezio Melotti
Ezio Melotti added the comment: Agreed. Once the gating system is in place nothing prevent us to read the NEWS entry either from the patch that is being committed or from a field in the tracker and then including it together with the patch once it is approved. --

[issue21324] dbhash leaks random memory fragments to a database

2014-04-21 Thread Marcin Szewczyk
New submission from Marcin Szewczyk: As stated in the subject. Example is in a remote Git repository: https://bitbucket.org/wodny/python-dbm-experiments/ It shows how some random data gets into the database (into some gaps between keys and values). There is also a C example which hasn't been

[issue837046] pyport.h redeclares gethostname() if SOLARIS is defined

2014-04-21 Thread Michael Stahl
Michael Stahl added the comment: (note that i haven't used any Solaris myself since 2011) * the #ifdef SOLARIS block still exists in current hg checkout * according to comment http://bugs.python.org/msg18910 the SOLARIS macro can not be defined during a build of python itself, so: - the

[issue21324] dbhash leaks random memory fragments to a database

2014-04-21 Thread Jakub Wilk
Changes by Jakub Wilk jw...@jwilk.net: -- nosy: +jwilk ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21324 ___ ___ Python-bugs-list mailing list

[issue17552] socket.sendfile()

2014-04-21 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Attached is a simple benchmark script transmitting a 100MB file. On my Linux box sendfile() is almost twice as fast as send(): send() real 0.0613s user 0.0100s sys 0.0900s total0.1000s sendfile() real 0.0318s user 0.s sys

[issue18967] Find a less conflict prone approach to Misc/NEWS

2014-04-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: A sequential log of commit messages for a particular branch would give one an even better snapshot view of activity since not all commits have news messages and even when they do, commit messages sometimes have additional info. But see below. The essence of

[issue21225] io.py: Improve docstrings for classes

2014-04-21 Thread R. David Murray
R. David Murray added the comment: Looks good to me. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21225 ___ ___

[issue19771] runpy should check ImportError.name before wrapping it

2014-04-21 Thread Luiz Poleto
Changes by Luiz Poleto luiz.pol...@gmail.com: Added file: http://bugs.python.org/file34995/issue_19771.patch.v2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19771 ___

[issue21322] Pathlib .owner() and .group() methods fail on broken links

2014-04-21 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21322 ___ ___ Python-bugs-list

[issue21322] Pathlib .owner() and .group() methods fail on broken links

2014-04-21 Thread Antoine Pitrou
Antoine Pitrou added the comment: Most other Path methods operate on the link target, not the link itself, so I don't see why these methods would work otherwise. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21322

[issue21228] Missing enumeration of HTTPResponse Objects methods of urllib.request.urlopen's http.client.HTTPResponse?

2014-04-21 Thread R. David Murray
R. David Murray added the comment: That section of the docs is indeed rather confusing. Probably it just needs to be changed to say for the methods supported by this object, see HTTPResponse Objects. I'd like to see the docs reorganized so that the '.. class' declaration in the docs is

[issue17552] socket.sendfile()

2014-04-21 Thread Josh Rosenberg
Josh Rosenberg added the comment: For TransmitFile support, the Windows function to turn an integer file descriptor into a WinAPI file HANDLE should be _get_osfhandle: http://msdn.microsoft.com/en-us/library/ks2530z6.aspx -- nosy: +josh.rosenberg

[issue21225] io.py: Improve docstrings for classes

2014-04-21 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21225 ___ ___ Python-bugs-list

[issue6305] islice doesn't accept large stop values

2014-04-21 Thread Alok Singhal
Alok Singhal added the comment: This updated patch has support for starting in fast mode until the next count would result in overflow in Py_ssize_t. The first patch started in slow mode as soon as any of 'start', 'stop', or 'step' was outside of the range. With this patch, we start in fast

[issue17552] socket.sendfile()

2014-04-21 Thread akira
akira added the comment: Should socket.sendfile() always return number of bytes sent because file.tell() may be changed by something else that uses the same file descriptor? What happens if the file grows? Instead of returning `(was_os_sendfile_used, os_sendfile_error)`, you could specify

[issue18617] TLS and Intermediate Certificates

2014-04-21 Thread Sam Vilain
Sam Vilain added the comment: Perhaps the simplest thing here is to add a standard verify callback that catches verification errors, and returns the parsed server certificate as an attribute of the raised exception object. From python, the exception can be caught and then the certificate

[issue18967] Find a less conflict prone approach to Misc/NEWS

2014-04-21 Thread Nick Coghlan
Nick Coghlan added the comment: Folks, this is *really, really, simple*: one file per NEWS entry. How we arrange them is just a detail. Don't go off trying to invent wild exotic alternatives that spread state across multiple sources of truth - significant historical info belongs in the version

[issue21325] Missing Generic EXIF library for images in the standard library

2014-04-21 Thread karl
New submission from karl: There is a room for a consistent and good EXIF library for the Python Standard Library. -- components: Library (Lib) messages: 216978 nosy: karlcow priority: normal severity: normal status: open title: Missing Generic EXIF library for images in the standard

[issue17552] socket.sendfile()

2014-04-21 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Instead of returning [...] you could specify `no_fallback=False` that could be set to `True` to assert that the fallback is not used [...] and return the number of bytes sent. Good idea, thanks, that is much better indeed. Updated patch is in attachment.

[issue17552] socket.sendfile()

2014-04-21 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' g.rod...@gmail.com: -- nosy: +josiah.carlson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17552 ___ ___

[issue20901] test_sqlite fails with SQLite 3.8.4

2014-04-21 Thread koobs
koobs added the comment: Updating versions to match branches fix was committed in -- nosy: +koobs versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20901 ___

[issue21256] Sort keyword arguments in mock _format_call_signature

2014-04-21 Thread Kushal Das
Kushal Das added the comment: New patch with test and news entry. -- Added file: http://bugs.python.org/file34998/issue21256_v2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21256 ___

[issue21228] Missing enumeration of HTTPResponse Objects methods of urllib.request.urlopen's http.client.HTTPResponse?

2014-04-21 Thread Martin Panter
Martin Panter added the comment: I interpreted it more along the lines of “. . . returns a http.client.HTTPResponse object [with] the following [additional] methods.” Indeed, a HTTP urlopen() response I just tried does have info(), geturl() and getcode() methods, and I know the info() method

[issue18967] Find a less conflict prone approach to Misc/NEWS

2014-04-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: My concern with a file for each entry is a possible slowdown of some operations, like TortoiseHg resyncing the diff between repository and working directory (it is not instantaneous even now). However, if there are multiple directories and if they are emptied

[issue21044] tarfile does not handle file .name being an int

2014-04-21 Thread Martin Panter
Martin Panter added the comment: I ran into a related issue with the gettarinfo() method. Would that fall under the scope of this bug, or should I raise a separate one? with tarfile.open(/dev/null, w) as tar: ... with open(b/bin/sh, rb) as file: ... tar.gettarinfo(fileobj=file)

[issue21284] IDLE reformat tests fail in presence of non-default FormatParagraph setting

2014-04-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4ff2c0a637cf by Terry Jan Reedy in branch '2.7': Issue 21284: Idle: make test_formatparagraph pass even when a user changes the http://hg.python.org/cpython/rev/4ff2c0a637cf New changeset fe067339af80 by Terry Jan Reedy in branch '3.4': Issue

[issue21284] IDLE reformat tests fail in presence of non-default FormatParagraph setting

2014-04-21 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21284 ___

[issue21139] Idle: change default reformat width from 70 to 72

2014-04-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: I applied my patch as part of #21284. When I did so, I added 'limit=70' so that the tests pass otherwise unchanged. The only thing left here is to change config-main.def. -- ___ Python tracker

[issue21138] mimetypes.MimeType UnicodeDecodeError

2014-04-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset 374746c5dedc by Terry Jan Reedy in branch '2.7': Issue #21138: Change default reformat paragraph width to PEP 8's 72. http://hg.python.org/cpython/rev/374746c5dedc New changeset dd24099c0cf6 by Terry Jan Reedy in branch '3.4': Issue #21138: Change

[issue21138] mimetypes.MimeType UnicodeDecodeError

2014-04-21 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: -- Removed message: http://bugs.python.org/msg216987 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21138 ___

[issue21138] mimetypes.MimeType UnicodeDecodeError

2014-04-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: The unlinked push message was for #21139. -- nosy: +terry.reedy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21138 ___

[issue21139] Idle: change default reformat width from 70 to 72

2014-04-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: I put 21138 in the commit message. The push messages are these. New changeset 374746c5dedc by Terry Jan Reedy in branch '2.7': Issue #21138: Change default reformat paragraph width to PEP 8's 72. http://hg.python.org/cpython/rev/374746c5dedc New changeset