[issue4256] optparse/argparse: provide a simple way to get a programmatically useful list of options

2010-05-09 Thread Steven Bethard
Steven Bethard added the comment: 2010/5/9 Filip Gruszczyński : > So, is there any decision here, so that I could get down to providing better > patch? I guess I'd like to hear from someone about how these things work in zsh. If we're going to add a hidden flag to *all* parsers, we should real

[issue3704] cookielib doesn't handle URLs with / in parameters

2010-05-09 Thread Tres Seaver
Tres Seaver added the comment: As long as we don't care about preserving backward compatibility, we could indeed just change the behavior of 'request_path'. It isn't documented as an API of the cookielib module, but it does have a docstring which promises certain semantics. -- ___

[issue8666] Allow ConfigParser.get*() to take a default value

2010-05-09 Thread Tim Chase
Tim Chase added the comment: Yes, the use-case is the same as a dict.get(key, default) which I frequently use -- so it can be used in things like result = some_function( cp.get('MySection', 'MyValue', default='hello'), cp.getint('MySection', 'MyInt', default=42) ) To write so

[issue8256] TypeError: bad argument type for built-in operation

2010-05-09 Thread Filip Gruszczyński
Filip Gruszczyński added the comment: Bump! Is there anything happening about this bug? Is my patch any good or should I try to work on something different? -- ___ Python tracker __

[issue4256] optparse/argparse: provide a simple way to get a programmatically useful list of options

2010-05-09 Thread Filip Gruszczyński
Filip Gruszczyński added the comment: So, is there any decision here, so that I could get down to providing better patch? -- ___ Python tracker ___ _

[issue8672] Error decompressing valid zlib data

2010-05-09 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- components: +Library (Lib) -IO stage: -> needs patch versions: +Python 2.7, Python 3.2 ___ Python tracker ___ _

[issue8672] Error decompressing valid zlib data

2010-05-09 Thread Matthew Brett
New submission from Matthew Brett : I have a valid zlib compressed string, attached here as 'mat.bin' (1.7M), that cause and error on zlib.decompress decompression: >>> import zlib >>> data = open('mat.bin', 'rb').read() >>> out = zlib.decompress(data) Traceback (most recent call last): File

[issue8654] Improve ABI compatibility between UCS2 and UCS4 builds

2010-05-09 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Here is a new patch. Usage, short version: By default, modules compile in Unicode-agnostic mode, where Py_UNICODE is an incomplete type. Unicode-agnostic modules will load in both UCS2 and UCS4 interpreters. If a module defines PY_REAL_PY_UNICODE before

[issue4908] Implement PEP 376

2010-05-09 Thread Tarek Ziadé
Changes by Tarek Ziadé : -- stage: -> committed/rejected status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue4908] Implement PEP 376

2010-05-09 Thread Tarek Ziadé
Changes by Tarek Ziadé : -- resolution: accepted -> duplicate superseder: -> Implement pkgutil APIs as described in PEP 376 ___ Python tracker ___ ___

[issue8324] add a distutils test command

2010-05-09 Thread Tarek Ziadé
Tarek Ziadé added the comment: @Eric: I asked for the gsoc keyword to make my work easier in bug triage. And as a matter of fact, it means that the issue part of the GSoC. -- keywords: +gsoc ___ Python tracker ___

[issue8654] Improve ABI compatibility between UCS2 and UCS4 builds

2010-05-09 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : Removed file: http://bugs.python.org/file17248/unicode.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue8653] urlparse.urlparse/urlsplit doc missing

2010-05-09 Thread Dave Abrahams
Dave Abrahams added the comment: At Sat, 08 May 2010 22:18:13 +, Éric Araujo wrote: > > > Éric Araujo added the comment: > > I think you mean > http://docs.python.org/library/urlparse.html#urlparse.urlparse > > Dave, perhaps you were looking at an older version? Doc fixes for > maintai

[issue5537] LWPCookieJar cannot handle cookies with expirations of 2038 or greater on 32-bit platforms

2010-05-09 Thread John J Lee
John J Lee added the comment: Shouldn't module time be changed to use a cross-platform implementation that uses a 64 bit time_t-like type? Apparently Perl 6 has made the equivalent change. Admittedly there seems to be no sign of that actually happening. -- nosy: +jjlee

[issue4972] let's equip ftplib.FTP with __enter__ and __exit__

2010-05-09 Thread Éric Araujo
Éric Araujo added the comment: Ah, I’m glad I had one interesting comment out of three in my first message :) This change, although nice, seems a bit trivial for warranting taking so much place in the what’s new. Or perhaps it’s a good thing; I don’t know if people are aware of the goodness of

[issue4972] let's equip ftplib.FTP with __enter__ and __exit__

2010-05-09 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' : Removed file: http://bugs.python.org/file17276/ftplib.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue4972] let's equip ftplib.FTP with __enter__ and __exit__

2010-05-09 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: > Is the string returned by a real FTP server “331 username ok”? (My > point is that I think it would be better to have different strings for > cmd_noop and cmd_user.) Whoops! No that should have been "200 noop ok". I copied cmd_user code and forgot to mo

[issue6588] insert cookies into cookie jar - cookielib.py

2010-05-09 Thread Éric Araujo
Éric Araujo added the comment: Minor remarks: - generate your patch from the top-level directory, so that people can just apply the patch from there (see http://www.python.org/dev/patches/); - don’t put two statements on one line (“if thing: dostuff()”), as per PEP 8. -- nosy: +merwok

[issue6588] insert cookies into cookie jar - cookielib.py

2010-05-09 Thread John J Lee
John J Lee added the comment: Jon, If you want to get these changes applied you need to: 1. Split up these three separate issues 2. Most important: explain in full detail exactly how you used cookielib, what you expected it to do, and what it actually did, and then justify why your expecta

[issue4972] let's equip ftplib.FTP with __enter__ and __exit__

2010-05-09 Thread Éric Araujo
Éric Araujo added the comment: Re-reading the patch, I notice it’s in the test module, not on the FTP class, so I guess it’s perfectly fine. Is the string returned by a real FTP server “331 username ok”? (My point is that I think it would be better to have different strings for cmd_noop and cmd_

[issue4972] let's equip ftplib.FTP with __enter__ and __exit__

2010-05-09 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: > Magic methods usually don’t have docstrings, since they implement one > operation that is described in one place (think __len__ vs. len). Agreed, I only left it since it was there in the first place. > What did you add a cmd_noop method that does the sam

[issue8425] a -= b should be fast if a is a small set and b is a large set

2010-05-09 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- nosy: +belopolsky ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue4972] let's equip ftplib.FTP with __enter__ and __exit__

2010-05-09 Thread Éric Araujo
Éric Araujo added the comment: Magic methods usually don’t have docstrings, since they implement one operation that is described in one place (think __len__ vs. len). You could remove the doc of __enter__ and turn the doc of __exit__ into a comment or move it to the reST file when you say tha

[issue4972] let's equip ftplib.FTP with __enter__ and __exit__

2010-05-09 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: A patch including tests and doc changes is in attachment. -- versions: +Python 3.2 -Python 2.7, Python 3.1 Added file: http://bugs.python.org/file17276/ftplib.patch ___ Python tracker

[issue3704] cookielib doesn't handle URLs with / in parameters

2010-05-09 Thread John J Lee
John J Lee added the comment: It looks to me that it's just request_path that's wrong, so no need to add extra arguments to that function. It should discard the query and fragment (still keeping the "parameters" -- using urlparse.urlsplit instead of urlparse.urlparse would make that simpler)

[issue6878] changed return type from tkinter.Canvas.coords

2010-05-09 Thread Guilherme Polo
Guilherme Polo added the comment: Weird.. I was almost sure that was fixed at some point. The patch is fine, but I would suggest adding some simple testcase(s). This will probably require a new file (test_canvas.py) at Lib/tkinter/test/test_tkinter. --

[issue7584] datetime.rfcformat() for Date and Time on the Internet

2010-05-09 Thread Daniel Urban
Daniel Urban added the comment: Here is a new patch. The name of the optional argument is "default_utcoffset" which is obviously too long, but I can't think a better name. Any suggestions? (I think simply "utcoffset" would be misleading, because the value of the argument is only used for nai

[issue1474680] pickling files works with protocol=2.

2010-05-09 Thread Éric Araujo
Éric Araujo added the comment: Antoine, I think the goal here is to disable pickling, not making it work. Alexandre, is it ok for a class to define pickle magic methods just to raise an exception? Doesn’t it break expectations? One question hasn’t been answered: When did the protocol change?

[issue4972] let's equip ftplib.FTP with __enter__ and __exit__

2010-05-09 Thread Stuart Axon
Stuart Axon added the comment: It would be good for consistency, yes. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue8654] Improve ABI compatibility between UCS2 and UCS4 builds

2010-05-09 Thread Martin v . Löwis
Martin v. Löwis added the comment: > I just thought of another risk inherit in this approach. If the extension > module is composed of more than one C file, the extension author may > inadvertently compile the file defining the PyModuleDef in Unicode-agnostic > mode but compile another file in

[issue8312] Add post/pre hooks for distutils commands

2010-05-09 Thread Konrad Delong
Changes by Konrad Delong : -- nosy: +konryd ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue8654] Improve ABI compatibility between UCS2 and UCS4 builds

2010-05-09 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : Removed file: http://bugs.python.org/file17274/unnamed ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue8654] Improve ABI compatibility between UCS2 and UCS4 builds

2010-05-09 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : Removed file: http://bugs.python.org/file17273/unnamed ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue8654] Improve ABI compatibility between UCS2 and UCS4 builds

2010-05-09 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: On Sun, May 9, 2010 at 10:12 AM, Marc-Andre Lemburg wrote: > I'm just not sure how you could check for optimization > compiler bugs/features using the buildbots. > Once I have a patch that I'm modestly confident in, I'll write automated tests to go with it.

[issue8654] Improve ABI compatibility between UCS2 and UCS4 builds

2010-05-09 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: On Sat, May 8, 2010 at 8:07 AM, Martin v. Löwis wrote: > 1. add a flag to PyModuleDef, indicating whether the module was built in > UCS-2 or UCS-4 mode. Then let the interpreter refuse the load the module, > instead of having the dynamic linker do so. I jus

[issue7584] datetime.rfcformat() for Date and Time on the Internet

2010-05-09 Thread R. David Murray
R. David Murray added the comment: I think Daniel's suggestion of having an option to control this is the best way to handle the different use cases. And I think the default should be -00:00, as he suggested. Removing 2.7 and 3.1 since 3.2 is the only branch open to new features at this poi

[issue8654] Improve ABI compatibility between UCS2 and UCS4 builds

2010-05-09 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Daniel Stutzbach wrote: > > Daniel Stutzbach added the comment: > > On Sat, May 8, 2010 at 11:35 AM, Marc-Andre Lemburg > wrote: >> One of the more important cases you are missing is the >> argument parser in Python: > > Thanks. I've had my head buried

[issue6320] Standard string encodings should include GSM0.38

2010-05-09 Thread Éric Araujo
Éric Araujo added the comment: Are there many GSM libraries or applications out there? If not, maybe the codec is best left in your lib, since it wouldn’t be useful for a wide range of uses. Note also that 2.7 is frozen, so substitute “py3k branch” for “trunk” in Antoine’s previous comment.

[issue6878] changed return type from tkinter.Canvas.coords

2010-05-09 Thread Éric Araujo
Éric Araujo added the comment: Attaching patch based on py3k, please review. (Mercurial diff, use patch -p1) -- keywords: +patch nosy: +gpolo, merwok stage: needs patch -> patch review title: outdated docstring in tkinter.Canvas.coords -> changed return type from tkinter.Canvas.coords

[issue8671] A small erorr on http://docs.python.org/library/re.html

2010-05-09 Thread Eric Smith
Eric Smith added the comment: Fixed in: trunk: r81026 release26-maint: r81027 It was already correct in py3k and release31-maint. Thanks! -- nosy: +eric.smith resolution: -> accepted stage: -> committed/rejected status: open -> closed versions: +Python 2.7 _

[issue7584] datetime.rfcformat() for Date and Time on the Internet

2010-05-09 Thread anatoly techtonik
anatoly techtonik added the comment: Let's quote RFC 3339: """ 4.3. Unknown Local Offset Convention If the time in UTC is known, but the offset to local time is unknown, this can be represented with an offset of "-00:00". This differs semantically from an offset of "Z" or "+00:00", wh

[issue8324] add a distutils test command

2010-05-09 Thread Dan Buch
Dan Buch added the comment: @mfoord thank you for the clarification! :) -- ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue8613] Decimal module flags undetermined when a signal is trapped.

2010-05-09 Thread Éric Araujo
Éric Araujo added the comment: Foehn, bugs.python.org is used for discussing and solving bugs in Python, not general discussion about programming. There are Web forums and IRC rooms where your question could get answered. I will answer you, but please do not post other unrelated messages. Try

[issue8613] Decimal module flags undetermined when a signal is trapped.

2010-05-09 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/op

[issue8671] A small erorr on http://docs.python.org/library/re.html

2010-05-09 Thread bones7456
New submission from bones7456 : In section \b , original text is: Matches the empty string, but only at the beginning or end of a word. A word is defined as a sequence of alphanumeric or underscore characters, so the end of a word is indicated by whitespace or a non-alphanumeric, non-underscor

[issue8324] add a distutils test command

2010-05-09 Thread Michael Foord
Michael Foord added the comment: Documentation for unittest.TestLoader.discover(...) is at: http://docs.python.org/dev/library/unittest.html#unittest.TestLoader.discover -- ___ Python tracker _

[issue8324] add a distutils test command

2010-05-09 Thread Michael Foord
Michael Foord added the comment: unittest2 is used for distutils2 development, but *not* a required dependency for *using* distutils2 (if I understand correctly(. Well, if there is no test runner and no test suite specified but the test command is invoked then the steps should probably be som

[issue8613] Decimal module flags undetermined when a signal is trapped.

2010-05-09 Thread Foehn of blue
Foehn of blue added the comment: Can you teach me how to Writing programs? Please!!! I'm from Taiwan That's my e-mail:foehnofb...@kimo.com -- nosy: +foehn blue ___ Python tracker ___

[issue8665] "make pycremoval" fails

2010-05-09 Thread Éric Araujo
Éric Araujo added the comment: Suggestion: rm -rf __pycache__ dirs before using find for stray pycs. -- nosy: +merwok ___ Python tracker ___ _

[issue8324] add a distutils test command

2010-05-09 Thread Éric Araujo
Changes by Éric Araujo : -- keywords: -gsoc ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue8324] add a distutils test command

2010-05-09 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +konryd ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org

[issue8324] add a distutils test command

2010-05-09 Thread Éric Araujo
Éric Araujo added the comment: Not a unittest expert, but I suspect that usual test for features will work: try: from unittest.something.discovery import Loader except ImportError: from unittest2.something.discovery import Loader Adding Konrad to nosy, since adding new commands will be

[issue8588] test_urllib2.py test failures on Py3K Mac OS X

2010-05-09 Thread Mark Dickinson
Mark Dickinson added the comment: Fixed in r81024 (py3k), r81025 (release31-maint). -- components: +Library (Lib) nosy: +mark.dickinson resolution: -> fixed stage: -> committed/rejected status: open -> closed type: -> behavior ___ Python tracker

[issue8324] add a distutils test command

2010-05-09 Thread Dan Buch
Dan Buch added the comment: @merwok I know ;-) ... should I assume that it's an installation requirement a la `install_requires=['unittest2']`, or do:: try: load_tests_with_unittest2() except ImportError: load_tests_with_custom_test_loader() ? -- ___

[issue8324] add a distutils test command

2010-05-09 Thread Éric Araujo
Éric Araujo added the comment: unittest2 is the name of the independent release of the improved unittest package in 2.7’s and 3.2’s stdlib. -- ___ Python tracker ___ ___

[issue8324] add a distutils test command

2010-05-09 Thread Dan Buch
Dan Buch added the comment: Should I assume that unittest2 is an installation requirement of distutils2, or is it preferable to try using unittest2 and falling back to a custom TestLoader? Sorry if I'm reading too much into this :-/ -- ___ Python

[issue4768] email.generator.Generator object bytes/str crash - b64encode() bug?

2010-05-09 Thread garazi111
garazi111 added the comment: Hi, I think the bug is also present in the function encode_quopri which should look like this : def encode_quopri(msg): """Encode the message's payload in quoted-printable. Also, add an appropriate Content-Transfer-Encoding header. """ orig = msg.

[issue8613] Decimal module flags undetermined when a signal is trapped.

2010-05-09 Thread Mark Dickinson
Mark Dickinson added the comment: Umm. Please pretend I didn't write this: > One simple change that might help would be to have all Decimal > exceptions derive from a common `DecimalException` superclass, making > it easier to catch just decimal exceptions in a try-except block. DecimalExcep

[issue8613] Decimal module flags undetermined when a signal is trapped.

2010-05-09 Thread Mark Dickinson
Mark Dickinson added the comment: Hmm. The 'delay_traps' context manager idea doesn't quite work here. A problem occurs if (for example) an Overflow occurs during the with block; in that case, Overflow should be raised at the end of the with block. That's fine, except that we no longer kn

[issue8644] timedelta.total_seconds needlessly inaccurate, especially for negative timedeltas

2010-05-09 Thread Mark Dickinson
Mark Dickinson added the comment: Perfect! Applied in r81020. You're correct that n/10**6 and n/1e6 aren't the same thing, at least for n large enough: Python 2.7b2+ (trunk:81019:81020, May 9 2010, 10:33:17) [GCC 4.2.1 (Apple Inc. build 5659)] on darwin Type "help", "copyright", "credits"

[issue8635] enumerate() docstring doesn't cover optional start argument

2010-05-09 Thread Daniel Urban
Daniel Urban added the comment: Attached a patch. It changes the docstring to: "enumerate(iterable[, start]) -> iterator for index, value of iterable Return an enumerate object. iterable must be another object that supports iteration, start must be an integer (defaults to 0). The enumerate ob

[issue8324] add a distutils test command

2010-05-09 Thread Michael Foord
Michael Foord added the comment: Adapting the setuptools command is a great way to start of course. Please see my note about using unittest/unittest2 test discovery as a default command if unitest2 is available and no test_suite is specified. I'm very happy to help with this. -- ___

[issue8510] update to autoconf2.65

2010-05-09 Thread Mark Dickinson
Mark Dickinson added the comment: r81004: Remove extra closing bracket and comma introduced in r80969. (This was causing misdetection of the OS X 10.5 SDK on Linux and OS X, and a test_platform failure on OS X.) -- nosy: +mark.dickinson ___ Python