From report at bugs.python.org Thu Jan 1 00:00:50 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 31 Dec 2008 23:00:50 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230325778.98.0.752974375077.issue4753@psf.upfronthosting.co.za> Message-ID: <1230764450.92.0.76420619951.issue4753@psf.upfronthosting.co.za> Changes by Antoine Pitrou : Removed file: http://bugs.python.org/file12511/threadedceval3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 00:01:37 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 31 Dec 2008 23:01:37 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230325778.98.0.752974375077.issue4753@psf.upfronthosting.co.za> Message-ID: <1230764497.66.0.269057274626.issue4753@psf.upfronthosting.co.za> Changes by Antoine Pitrou : Removed file: http://bugs.python.org/file12474/threadedceval2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 00:06:05 2009 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 31 Dec 2008 23:06:05 +0000 Subject: [issue4796] Decimal to receive from_float method In-Reply-To: <1230764359.55.0.955763939043.issue4796@psf.upfronthosting.co.za> Message-ID: <1230764765.43.0.404012747606.issue4796@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- assignee: -> rhettinger nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 00:18:16 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 31 Dec 2008 23:18:16 +0000 Subject: [issue4751] Patch for better thread support in hashlib In-Reply-To: <1230298756.92.0.632482701363.issue4751@psf.upfronthosting.co.za> Message-ID: <1230765496.74.0.0137101190191.issue4751@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +gps _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 00:29:45 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 31 Dec 2008 23:29:45 +0000 Subject: [issue4751] Patch for better thread support in hashlib In-Reply-To: <1230298756.92.0.632482701363.issue4751@psf.upfronthosting.co.za> Message-ID: <1230766185.84.0.100591040069.issue4751@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Based on quick testing on my computer, we could probably put the limit as low as 1KB. But it may be that locks are cheap under Linux. In any case, the patch looks good, but I'm no OpenSSL expert. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 00:43:16 2009 From: report at bugs.python.org (David Moss) Date: Wed, 31 Dec 2008 23:43:16 +0000 Subject: [issue3959] Add Google's ipaddr.py to the stdlib In-Reply-To: <1222298050.73.0.172554962966.issue3959@psf.upfronthosting.co.za> Message-ID: <1230766995.94.0.793340858766.issue3959@psf.upfronthosting.co.za> David Moss added the comment: I think this might be worth a look before any hard and fast decisions are made :- http://code.google.com/p/netaddr/ ---------- nosy: +drkjam _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 00:48:48 2009 From: report at bugs.python.org (Gabriel Genellina) Date: Wed, 31 Dec 2008 23:48:48 +0000 Subject: [issue3023] Problem with invalidly-encoded command-line arguments (Unix) In-Reply-To: <1212358937.18.0.778474192325.issue3023@psf.upfronthosting.co.za> Message-ID: <1230767328.7.0.616070356075.issue3023@psf.upfronthosting.co.za> Changes by Gabriel Genellina : ---------- nosy: +gagenellina _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 00:48:51 2009 From: report at bugs.python.org (Benjamin Peterson) Date: Wed, 31 Dec 2008 23:48:51 +0000 Subject: [issue4795] inspect.isgeneratorfunction inconsistent with other inspect functions In-Reply-To: <1230763627.06.0.589317806347.issue4795@psf.upfronthosting.co.za> Message-ID: <1230767331.21.0.794211211405.issue4795@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Fixed in r68112. ---------- nosy: +benjamin.peterson resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 01:04:30 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 01 Jan 2009 00:04:30 +0000 Subject: [issue4751] Patch for better thread support in hashlib In-Reply-To: <1230298756.92.0.632482701363.issue4751@psf.upfronthosting.co.za> Message-ID: <1230768270.34.0.483951676866.issue4751@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Actually, your code can deadlock since ENTER_HASHLIB doesn't release the GIL. Think about it: // Thread A is here, holding the GIL and waiting for self->lock to be // released by thread B ENTER_HASHLIB(self) Py_BEGIN_ALLOW_THREADS // Thread B is here, holding self->lock and waiting for the GIL to be // released by thread A Py_END_ALLOW_THREADS LEAVE_HASHLIB(self) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 01:07:08 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 01 Jan 2009 00:07:08 +0000 Subject: [issue4738] Patch to make zlib-objects better support threads In-Reply-To: <1230136171.32.0.121363130694.issue4738@psf.upfronthosting.co.za> Message-ID: <1230768428.92.0.0885819613421.issue4738@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Same comment about potential deadlocks as in #4751. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 01:38:24 2009 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 01 Jan 2009 00:38:24 +0000 Subject: [issue4796] Decimal to receive from_float method In-Reply-To: <1230764359.55.0.955763939043.issue4796@psf.upfronthosting.co.za> Message-ID: <1230770304.9.0.829539552545.issue4796@psf.upfronthosting.co.za> Raymond Hettinger added the comment: The decimal constructor should be lossless. The underlying spec was designed with the notion that all numbers in decimal are exact; operations can be lossy but the numbers themselves are exact. Accordingly, I recommend Decimal.from_float(f) with no qualifiers or optional arguments. To support the use case of wanting to round the input, I suggest a separate method modeled on Context.create_decimal(). It can either be an extension of the existing method or a new method like Context.create_decimal_from_float(). I recommend the former since rounding is already implied by the context qualifier. Either way, the effect would be the same as Decimal.from_float(f) + 0 in a given context. Per the docs: "Creates a new Decimal instance from num but using self as context. Unlike the Decimal constructor, the context precision, rounding method, flags, and traps are applied to the conversion." _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 01:43:09 2009 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 01 Jan 2009 00:43:09 +0000 Subject: [issue4796] Decimal to receive from_float method In-Reply-To: <1230764359.55.0.955763939043.issue4796@psf.upfronthosting.co.za> Message-ID: <1230770589.56.0.572003566636.issue4796@psf.upfronthosting.co.za> Raymond Hettinger added the comment: FYI, there is already a lossless implementation in the docs: def float_to_decimal(f): "Convert a floating point number to a Decimal with no loss of information" n, d = f.as_integer_ratio() with localcontext() as ctx: ctx.traps[Inexact] = True while True: try: return Decimal(n) / Decimal(d) except Inexact: ctx.prec += 1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 01:54:40 2009 From: report at bugs.python.org (Gabriel Genellina) Date: Thu, 01 Jan 2009 00:54:40 +0000 Subject: [issue4781] The function, Threading.Timer.run(), may be Inappropriate In-Reply-To: <1230651841.99.0.415726342941.issue4781@psf.upfronthosting.co.za> Message-ID: <1230771280.8.0.276734985232.issue4781@psf.upfronthosting.co.za> Gabriel Genellina added the comment: Note that doing this would change the class semantics. Timer "[...] represents an action that should be run only after a certain amount of time has passed ? a timer." and the example clearly shows that the action is run *once*. Timer is basically an example of how to write custom Thread subclasses; if you want a "repetitive action", you may easily write a subclass based on the code you posted. Not every useful class must be in the standard library... ---------- nosy: +gagenellina _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 02:08:19 2009 From: report at bugs.python.org (pmoody) Date: Thu, 01 Jan 2009 01:08:19 +0000 Subject: [issue3959] Add Google's ipaddr.py to the stdlib In-Reply-To: <1222298050.73.0.172554962966.issue3959@psf.upfronthosting.co.za> Message-ID: <1230772099.62.0.283432939327.issue3959@psf.upfronthosting.co.za> pmoody added the comment: I'm biased ;) but I don't see what netaddr provides over ipaddr. it also seems to be in the neighborhood of 50% slower (at least on my mac mini). pmoody at mini - 04:52 PM - ~/Downloads/ipaddr-1.0.1 -> python -m timeit 'import ipaddr;\ ipaddr.IP("1.1.1.1")' 10000 loops, best of 3: 46.2 usec per loop pmoody at mini - 04:52 PM - ~/Downloads/netaddr-0.5.2 -> python -m timeit 'import netaddr;\ netaddr.IP("1.1.1.1")' 10000 loops, best of 3: 71.9 usec per loop dealing with netmasks, the difference is even greater. pmoody at mini - 04:52 PM - ~/Downloads/ipaddr-1.0.1 -> python -m timeit 'import ipaddr;\ ipaddr.IP("1.1.1.1/255.255.255.0")' 10000 loops, best of 3: 78.4 usec per loop pmoody at mini - 04:49 PM - ~/Downloads/netaddr-0.5.2 -> python -m timeit 'import netaddr;\ > netaddr.IP("1.1.1.1/255.255.255.0")' 1000 loops, best of 3: 247 usec per loop (and it doesn't seem to deal with hostsmasked addresses). it also seems to be layed out in an unintuitive way, treating address ranges a something very different than network addresses. hopefully someone who isn't intimately familiar with both libraries can comment, but ipaddr feels a lot cleaner to me. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 02:31:56 2009 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 01 Jan 2009 01:31:56 +0000 Subject: [issue4795] inspect.isgeneratorfunction inconsistent with other inspect functions In-Reply-To: <1230763627.06.0.589317806347.issue4795@psf.upfronthosting.co.za> Message-ID: <1230773516.92.0.617860643085.issue4795@psf.upfronthosting.co.za> Raymond Hettinger added the comment: This can be simplified to just: return (isfunction(object) or ismethod(object)) and \ object.func_code.co_flags & CO_GENERATOR No need for patterns like: if cond: return True return False ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 02:36:36 2009 From: report at bugs.python.org (Jean-Paul Calderone) Date: Thu, 01 Jan 2009 01:36:36 +0000 Subject: [issue3959] Add Google's ipaddr.py to the stdlib In-Reply-To: <1222298050.73.0.172554962966.issue3959@psf.upfronthosting.co.za> Message-ID: <1230773796.95.0.383947217645.issue3959@psf.upfronthosting.co.za> Jean-Paul Calderone added the comment: Performance shouldn't be a major concern here. Utility is more important and the implementation can be optimized later. My initial impression of netaddr is pretty good. One thing it has going for it is documentation. The netaddr google page gives a really great overview of the functionality provided. In comparison, the ipaddr-py page is extremely sparse; the documentation in the repository is no better (as there isn't really any). There are a lot of minor things about ipaddr-py which are off-putting. It uses a naming convention that's not like any real Python software I'm familiar with. In particular, CamelCase method names really draw the eye (in a bad way) and distract from the actual functionality being provided. I assume that if ipaddr-py is selected for inclusion, the API will be adapted to fit PEP 8. In comparison, netaddr appears to largely comply with PEP 8 already. Regarding the treatment of addresses versus address ranges, I prefer netaddr's solution. An address is not the same as an address range. It seems odd to try to represent them both with the same type as ipaddr-py does. This feels somewhat APLesque (where everything is a vector), which isn't bad in itself, but generally if I want to manipulate an IP address, I'm not thinking about it as a list of one address. If I wanted to do that, then I'd make a list and put the address in it. By comparison, the separate CIDR type in netaddr makes a lot of sense. It preserves a memory-efficient representation of the address range, but does it with a different type than the fundamental address type. This is far from a complete review of either library, obviously. I've done little more than glance over the documentation of each and do a small amount of interactive playing around. A lot more effort seems to have gone into making netaddr accessible and appealing, and I think it has succeeded. Perhaps if some documentation for ipaddr-py is written it will be easier to see where that library excels. Of course, I assume this is a prerequisite for inclusion in the standard library as well. ---------- nosy: +exarkun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 02:59:00 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 01 Jan 2009 01:59:00 +0000 Subject: [issue1664] nntplib is not IPv6-capable In-Reply-To: <1198094830.43.0.175472713308.issue1664@psf.upfronthosting.co.za> Message-ID: <1230775140.6.0.446713914613.issue1664@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I was going to suggest writing a test but I see that nntplib hasn't got a single unit test :-O ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 03:00:17 2009 From: report at bugs.python.org (pmoody) Date: Thu, 01 Jan 2009 02:00:17 +0000 Subject: [issue3959] Add Google's ipaddr.py to the stdlib In-Reply-To: <1222298050.73.0.172554962966.issue3959@psf.upfronthosting.co.za> Message-ID: <1230775217.52.0.280972089133.issue3959@psf.upfronthosting.co.za> pmoody added the comment: hm, all addresses have a subnet, even if its an implied /32, so specifying a network as ("1.1.1.0", "1.1.1.255") seems a lot more off-putting than "1.1.1.0/24". You're also much more likely to see the latter in network devices. I guess I don't see the utility in an address range of .1 - .22 (or something arbitrary, something which doesn't fall on a power-of-2 boundary); when dealing with ranges of addresses, i've always only wanted to/needed to manipulate sub-networks of addresses. and my expectation was always that method names, etc. would have to be converted to more closely match other python code; ipaddr was written to google's python style guide, which I understand can be different than the python.org style guide ;) also, ipaddr does make extensive use of pydoc, but you're right, the webpage is spartan. happy (PST) new year. Cheers, /peter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 03:05:13 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 01 Jan 2009 02:05:13 +0000 Subject: [issue4572] add SEEK_* values to io and/or io.IOBase In-Reply-To: <1228625063.64.0.370686457231.issue4572@psf.upfronthosting.co.za> Message-ID: <1230775513.78.0.541328516706.issue4572@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Sounds like a nice improvement. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 03:12:57 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 01 Jan 2009 02:12:57 +0000 Subject: [issue4272] set timestamp in gzip stream In-Reply-To: <1226004430.06.0.832608065072.issue4272@psf.upfronthosting.co.za> Message-ID: <1230775977.23.0.190256258791.issue4272@psf.upfronthosting.co.za> Antoine Pitrou added the comment: test_literal_output looks really too strict to me. At most, you could check that the header and trailer are unchanged, but it would probably make it equivalent to test_metadata. Other than that, I think it's an useful addition. ---------- nosy: +pitrou priority: -> normal stage: -> patch review versions: +Python 2.7, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 03:14:26 2009 From: report at bugs.python.org (Jean-Paul Calderone) Date: Thu, 01 Jan 2009 02:14:26 +0000 Subject: [issue3959] Add Google's ipaddr.py to the stdlib In-Reply-To: <1222298050.73.0.172554962966.issue3959@psf.upfronthosting.co.za> Message-ID: <1230776066.74.0.888962584654.issue3959@psf.upfronthosting.co.za> Jean-Paul Calderone added the comment: > hm, all addresses have a subnet, even if its an implied /32, so specifying a network as ("1.1.1.0", "1.1.1.255") seems a lot more off-putting than "1.1.1.0/24". You're also much more likely to see the latter in network devices. I'm not sure which API in netaddr you're referring to. If you want to construct that /24 with netaddr, then I would use netaddr.address.CIDR("1.1.1.0/24"). Offhand, I can't find an API which accepts two endpoints of a range to construct a network in netaddr. When I wrote about having separate types for individual addresses vs ranges of addresses in my previous comment, I had IP and CIDR respectively in mind, as opposed to ipaddr-py's single IPv4 class which can represent either. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 03:19:38 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 01 Jan 2009 02:19:38 +0000 Subject: [issue4035] Support bytes for os.exec*() In-Reply-To: <1223077104.22.0.62328245443.issue4035@psf.upfronthosting.co.za> Message-ID: <1230776378.31.0.192933963147.issue4035@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Hmm, I think the supported types should be the same for all platforms, otherwise it creates unnecessary headaches. Perhaps, in addition to the proposed behaviour on Posix (convert everything to bytes if the program name is a bytes object), the reverse could be done under Windows (convert the program name to str if it is a bytes object). ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 03:25:31 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 01 Jan 2009 02:25:31 +0000 Subject: [issue3976] pprint._safe_repr is not general enough in one instance In-Reply-To: <1222445700.05.0.107288672735.issue3976@psf.upfronthosting.co.za> Message-ID: <1230776731.5.0.748386262804.issue3976@psf.upfronthosting.co.za> Antoine Pitrou added the comment: For this to be integrated, it should also add an unit test. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 03:28:07 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 01 Jan 2009 02:28:07 +0000 Subject: =?utf-8?q?[issue3680]_Cycles_with_some_iterator_are=09leaking.?= In-Reply-To: <1219697025.92.0.458237292903.issue3680@psf.upfronthosting.co.za> Message-ID: <1230776887.85.0.817297994889.issue3680@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 03:33:13 2009 From: report at bugs.python.org (pmoody) Date: Thu, 01 Jan 2009 02:33:13 +0000 Subject: [issue3959] Add Google's ipaddr.py to the stdlib In-Reply-To: <1230776066.74.0.888962584654.issue3959@psf.upfronthosting.co.za> Message-ID: <8517e9350812311833q191a1c90k2757a7b87e673946@mail.gmail.com> pmoody added the comment: > I'm not sure which API in netaddr you're referring to. If you want to > construct that /24 with netaddr, then I would use > netaddr.address.CIDR("1.1.1.0/24"). Offhand, I can't find an API which netaddr.AddrRange class AddrRange(__builtin__.object) | A block of contiguous network addresses bounded by an arbitrary start and | stop address. There is no requirement that they fall on strict bit mask | boundaries, unlike L{CIDR} addresses. | | __init__(self, first, last, klass=) | Constructor. | | @param first: start address for this network address range. | | @param last: stop address for this network address range. | | @param klass: (optional) class used to create each object returned. | Default: L{Addr()} objects. See L{nrange()} documentations for | additional details on options. when looking through the code.google.com wiki, I couldn't find any examples of creating addresses with netmasks and AddrRange was the first thing I found when looking through pydoc. > accepts two endpoints of a range to construct a network in netaddr. > When I wrote about having separate types for individual addresses vs > ranges of addresses in my previous comment, I had IP and CIDR > respectively in mind, as opposed to ipaddr-py's single IPv4 class which > can represent either. and still having two separate classes represent the same thing seems odd to me. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 03:35:51 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 01 Jan 2009 02:35:51 +0000 Subject: [issue3266] Python-2.5.2/Modules/mmapmodule.c:915: error: `O_RDWR' undeclared In-Reply-To: <1215044054.48.0.722645405249.issue3266@psf.upfronthosting.co.za> Message-ID: <1230777351.76.0.794140416359.issue3266@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 03:38:34 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 01 Jan 2009 02:38:34 +0000 Subject: [issue4522] Module wsgiref is not python3000 ready (unicode issues) In-Reply-To: <1228389502.32.0.635218386971.issue4522@psf.upfronthosting.co.za> Message-ID: <1230777514.47.0.893341949321.issue4522@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Resolution is more advanced in #4718. ---------- nosy: +pitrou resolution: -> duplicate status: open -> closed superseder: -> wsgiref package totally broken _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 04:19:15 2009 From: report at bugs.python.org (Mitchell Model) Date: Thu, 01 Jan 2009 03:19:15 +0000 Subject: [issue3433] libtk In-Reply-To: <1216867410.47.0.735334999055.issue3433@psf.upfronthosting.co.za> Message-ID: <1230779955.1.0.54285889113.issue3433@psf.upfronthosting.co.za> Changes by Mitchell Model : ---------- title: Mac, 3.0 framework install error with fink cp -> libtk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 04:42:49 2009 From: report at bugs.python.org (Paolo 'Blaisorblade' Giarrusso) Date: Thu, 01 Jan 2009 03:42:49 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230325778.98.0.752974375077.issue4753@psf.upfronthosting.co.za> Message-ID: <1230781369.93.0.0813994569898.issue4753@psf.upfronthosting.co.za> Changes by Paolo 'Blaisorblade' Giarrusso : ---------- nosy: +blaisorblade _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 04:44:48 2009 From: report at bugs.python.org (Paolo 'Blaisorblade' Giarrusso) Date: Thu, 01 Jan 2009 03:44:48 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230325778.98.0.752974375077.issue4753@psf.upfronthosting.co.za> Message-ID: <1230781488.44.0.463651518108.issue4753@psf.upfronthosting.co.za> Paolo 'Blaisorblade' Giarrusso added the comment: Mentioning other versions as well. The patch is so easy that it can be backported to all supported versions, so I'm adding all of them (2.5 is in bugfix-only mode, and as far as I can see this patch cannot be accepted there, sadly). ---------- versions: +Python 2.6, Python 2.7, Python 3.0 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 05:06:19 2009 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 01 Jan 2009 04:06:19 +0000 Subject: [issue4572] add SEEK_* values to io and/or io.IOBase In-Reply-To: <1228625063.64.0.370686457231.issue4572@psf.upfronthosting.co.za> Message-ID: <1230782779.96.0.15103183997.issue4572@psf.upfronthosting.co.za> Changes by Benjamin Peterson : ---------- versions: -Python 3.0 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 05:10:22 2009 From: report at bugs.python.org (Skip Montanaro) Date: Thu, 01 Jan 2009 04:10:22 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230781488.44.0.463651518108.issue4753@psf.upfronthosting.co.za> Message-ID: <18780.16937.610896.883082@montanaro-dyndns-org.local> Skip Montanaro added the comment: Paolo> (2.5 is in bugfix-only mode, and as far as I can see this patch Paolo> cannot be accepted there, sadly). You could backport it to 2.4 & 2.5 and just put it up on PyPI... _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 05:28:10 2009 From: report at bugs.python.org (Paolo 'Blaisorblade' Giarrusso) Date: Thu, 01 Jan 2009 04:28:10 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230325778.98.0.752974375077.issue4753@psf.upfronthosting.co.za> Message-ID: <1230784090.43.0.883116133177.issue4753@psf.upfronthosting.co.za> Paolo 'Blaisorblade' Giarrusso added the comment: Some other comments. The time saving of indirect threading are also associated with the removal of the range check, but better branch prediction is the main advantage. > Also, the macro USE_THREADED_CODE should be renamed to something else; > the word "thread" is too tightly associated with multi-threading. That's true. > Furthermore, threaded code simply refers to code consisting only of > function calls. Maybe, USE_COMPUTED_GOTO or USE_DIRECT_DISPATCH would be > better. I'd prefer USE_DIRECT_DISPATCH (or better, USE_THREADED_DISPATCH) rather than USE_COMPUTED_GOTO, since the latter is just the used language construct. "indirect threading" is the standard name in CS literature to define this technique. "Direct threading" is a variation where in the bytecode array, opcode is replaced by the pointer opcode_handler[opcode], so that dispatch is slightly faster. Most interpreters use indirect threading to save memory, and because it enables to switch the opcode handlers table to activate for instance debugging. The best paper about this is: "The Structure and Performance of Efficient Interpreters, M. Anton Ertl and David Gregg, 2003". The original paper about (direct) threaded code is this: "Threaded Code, James R. Bell, Comm. of ACM, 1973", but I don't feel it relevant at all today. Indirect threading was introduced in "Indirect Threaded Code, Robert B. K. Dewar, Communications of the ACM, 1975" (that's just a bit more relevant, but still). _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 05:36:57 2009 From: report at bugs.python.org (Paolo 'Blaisorblade' Giarrusso) Date: Thu, 01 Jan 2009 04:36:57 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230325778.98.0.752974375077.issue4753@psf.upfronthosting.co.za> Message-ID: <1230784617.49.0.50655991643.issue4753@psf.upfronthosting.co.za> Paolo 'Blaisorblade' Giarrusso added the comment: > You may want to check out issue1408710 in which a similar patch was > provided, but failed to deliver the desired results. It's not really similar, because you don't duplicate the dispatch code. It took me some time to understand why you didn't change the "goto fast_next_opcode", but that's where you miss the speedup. The only difference with your change is that you save the range check for the switch, so the slowdown probably comes from some minor output change from GCC I guess. Anyway, this suggests that the speedup really comes from better branch prediction and not from saving the range check. The 1st paper I mentioned simply states that saving the range check might make a small differences. The point is that sometimes, when you are going to flush the pipeline, it's like adding a few instructions, even conditional jumps, does not make a difference. I've observed this behaviour quite a few times while building from scratch a small Python interpreter. I guess (but this might be wrong) that's because the execution units were not used at their fullest, and adding conditional jumps doesn't make a differeence because flushing a pipeline once or twice is almost the same (the second flush removes just few instructions). Or something like that, I'm not expert enough of CPU architecture to be sure of such guesses. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 06:03:05 2009 From: report at bugs.python.org (Paolo 'Blaisorblade' Giarrusso) Date: Thu, 01 Jan 2009 05:03:05 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230325778.98.0.752974375077.issue4753@psf.upfronthosting.co.za> Message-ID: <1230786185.08.0.151834797629.issue4753@psf.upfronthosting.co.za> Paolo 'Blaisorblade' Giarrusso added the comment: Topics 1) About different speedups on 32bits vs 64 bits 2) About PPC slowdown 3) PyPI ======= About different speedups on 32bits vs 64 bits ======= An interpreter is very register-hungry, so on x86_64 it spends much less time on register spill (i.e. moving locals from/to memory), so instruction dispatch takes a bigger share of execution time. If the rest of the interpreter is too slow, indirect threading gives no advantage. Look at the amount of register variables in PyEval_EvalFrameEx() (btw, do you support any compiler where nowadays 'register' still makes a difference? That's quite weird). Lots of them are simply cached copies of fields of the current frame and of the current function; without copying them to locals, the compiler should assume they could change at any function call. In fact, adding locals this way gave huge speedups on tight loops on the Python interpreter I built with a colleague for our student project, to experiment with speeding up Python. And adding a write to memory in the dispatch code (to f->last_i) gave a 20% slowdown. Since my interpreter uses a copying garbage collector and CPython uses reference counting, which is much slower (if you don't know this, show me a fast JVM with reference counting), I'm even surprised you can get such a big speedup from threading. ======= About PPC slowdown ======= Somebody should try the patch on Pentium4 as well. During our VM course, threading slowed down a toy interpreter with 4 toy opcodes. Our teachers suggested that with such a small interpreter, since threaded code takes more space (in that case, ~64 vs ~100 bytes), this could give problems with code caches, but suggested checking that idea using performance counters. I'm not sure about why. I don't have right now neither a Pentium4 nor a PowerPC available, so I can't check myself. But this is the best way to analyze the performance unexpected behaviour. ======= PyPI ======= Paolo> (2.5 is in bugfix-only mode, and as far as I can see this patch Paolo> cannot be accepted there, sadly). Skip> You could backport it to 2.4 & 2.5 and just put it up on PyPI... I was thinking to a private backport as well. I didn't know about PyPI, it looks like PyPI is more for contributed modules than for this, would that work? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 06:06:10 2009 From: report at bugs.python.org (Hirokazu Yamamoto) Date: Thu, 01 Jan 2009 05:06:10 +0000 Subject: [issue4797] test_fileio error (windows) In-Reply-To: <1230786370.88.0.170386258104.issue4797@psf.upfronthosting.co.za> Message-ID: <1230786370.88.0.170386258104.issue4797@psf.upfronthosting.co.za> New submission from Hirokazu Yamamoto : This patch fixes this error. http://www.python.org/dev/buildbot/trunk.stable/x86%20XP-4% 20trunk/builds/1727/step-test/0 ====================================================================== FAIL: testOpendir (test.test_fileio.AutoFileTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\trunk.bolen- windows\build\lib\test\test_fileio.py", line 112, in testOpendir self.assertEqual(e.filename, ".") AssertionError: None != '.' This error doesn't occur on py3k (because wide string is passed) but I think It's better to merge the patch into py3k too. ---------- components: Windows files: fix_test_fileio_error.patch keywords: patch messages: 78690 nosy: ocean-city severity: normal status: open title: test_fileio error (windows) type: behavior versions: Python 2.6, Python 2.7 Added file: http://bugs.python.org/file12515/fix_test_fileio_error.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 06:15:12 2009 From: report at bugs.python.org (Paolo 'Blaisorblade' Giarrusso) Date: Thu, 01 Jan 2009 05:15:12 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230325778.98.0.752974375077.issue4753@psf.upfronthosting.co.za> Message-ID: <1230786912.6.0.31251595307.issue4753@psf.upfronthosting.co.za> Paolo 'Blaisorblade' Giarrusso added the comment: == On the patch itself == Why don't you use the C preprocessor instead of that Python code? Sample code: #define OPCODE_LIST(DEFINE_OPCODE) \ DEFINE_OPCODE(STOP_CODE, 0) \ DEFINE_OPCODE(POP_TOP, 1) \ DEFINE_OPCODE(ROT_TWO, 2) \ DEFINE_OPCODE(ROT_THREE, 3) \ DEFINE_OPCODE(DUP_TOP, 4) \ DEFINE_OPCODE(ROT_FOUR, 5) \ DEFINE_OPCODE(NOP, 9) \ ... # define DECL_OPCODE(opcode) \ [opcode] = && label_ ## opcode, void *opcodes[] = { OPCODE_LIST(DECL_OPCODE) }; # undef DECL_OPCODE There are also other ways to do it, but using higher-order functions within the preprocessor in this way is something that I learned from the V8 source code. It has the advantage that OPCODE_LIST can be used in a lot of other places (maybe when implementing the 'opcode' module, if it's written in C). _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 08:47:41 2009 From: report at bugs.python.org (Vikram U Shenoy) Date: Thu, 01 Jan 2009 07:47:41 +0000 Subject: [issue4798] Update deprecation of 'new' module in PEP 4. In-Reply-To: <1230796061.0.0.856185746745.issue4798@psf.upfronthosting.co.za> Message-ID: <1230796061.0.0.856185746745.issue4798@psf.upfronthosting.co.za> New submission from Vikram U Shenoy : Attached are two patches: * Update PEP 4 about 'new' module which is deprecated since python 2.6 in favour of using types module. * Update documentation for 'new' module. Not sure about the exact date of proposal for deprecating 'new' module, but closest that I was able to find was this python-dev mail thread after it had been removed from py3k branch: http://mail.python.org/pipermail/python-dev/2007-November/075386.html ---------- assignee: georg.brandl components: Documentation files: doc_update_for_new_module_dec_31_2008.patch keywords: patch messages: 78692 nosy: georg.brandl, loewis, vshenoy severity: normal status: open title: Update deprecation of 'new' module in PEP 4. versions: Python 2.6 Added file: http://bugs.python.org/file12516/doc_update_for_new_module_dec_31_2008.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 08:48:21 2009 From: report at bugs.python.org (Vikram U Shenoy) Date: Thu, 01 Jan 2009 07:48:21 +0000 Subject: [issue4798] Update deprecation of 'new' module in PEP 4. In-Reply-To: <1230796061.0.0.856185746745.issue4798@psf.upfronthosting.co.za> Message-ID: <1230796101.05.0.378019093966.issue4798@psf.upfronthosting.co.za> Changes by Vikram U Shenoy : Added file: http://bugs.python.org/file12517/pep_update_for_new_module_dec_31_2008.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 08:52:47 2009 From: report at bugs.python.org (Cournapeau David) Date: Thu, 01 Jan 2009 07:52:47 +0000 Subject: [issue4799] handling inf/nan in '%f' In-Reply-To: <1230796367.25.0.681154044554.issue4799@psf.upfronthosting.co.za> Message-ID: <1230796367.25.0.681154044554.issue4799@psf.upfronthosting.co.za> New submission from Cournapeau David : On windows, with python 2.6, s = '%s' % float('inf') is 'inf', but s = '%f' % float('inf') is equal to '1.#INF'. This patch fixes the inconsistency, by using the code from floatobject.f format_float into stringobject.c formatfloat. I think it would be better to use the same underlying implementations for both functions, but it is not so easy, because format_float cannot fail (return void), whereas formatfloat can (return error code). ---------- components: Interpreter Core files: nan.patch keywords: patch messages: 78693 nosy: cdavid severity: normal status: open title: handling inf/nan in '%f' versions: Python 2.6 Added file: http://bugs.python.org/file12518/nan.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 09:32:14 2009 From: report at bugs.python.org (James Brotchie) Date: Thu, 01 Jan 2009 08:32:14 +0000 Subject: [issue4769] b64decode should accept strings or bytes In-Reply-To: <1230572153.22.0.954048343235.issue4769@psf.upfronthosting.co.za> Message-ID: <1230798734.97.0.628466905416.issue4769@psf.upfronthosting.co.za> Changes by James Brotchie : ---------- nosy: +brotchie _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 09:38:25 2009 From: report at bugs.python.org (James Brotchie) Date: Thu, 01 Jan 2009 08:38:25 +0000 Subject: [issue4768] email.generator.Generator object bytes/str crash - b64encode() bug? In-Reply-To: <1230571301.08.0.30132908931.issue4768@psf.upfronthosting.co.za> Message-ID: <1230799105.81.0.404705812843.issue4768@psf.upfronthosting.co.za> Changes by James Brotchie : ---------- nosy: +brotchie _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 10:40:29 2009 From: report at bugs.python.org (Matthias Sommer) Date: Thu, 01 Jan 2009 09:40:29 +0000 Subject: [issue2995] Idle, some Linuxes, cannot position Cursor by mouseclick In-Reply-To: <1211995180.72.0.174580651078.issue2995@psf.upfronthosting.co.za> Message-ID: <1230802829.57.0.753182453865.issue2995@psf.upfronthosting.co.za> Matthias Sommer added the comment: Retry is a bit difficult now, sinc I reverted back to Windows after getting quite some answers in some places, but none of them really helpful. It happend under Madriva Linux (and some other tested Linuxes). Now I'm using Gentoo (this is, IF I'm using Linux). And there it works all fine. The problem was: Usually one can set the cursorposition in any given (gui) text editor by mouse click in the text. Using Madriva, I can click, but the cursor is not affected. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 11:09:43 2009 From: report at bugs.python.org (Armin Rigo) Date: Thu, 01 Jan 2009 10:09:43 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230325778.98.0.752974375077.issue4753@psf.upfronthosting.co.za> Message-ID: <1230804583.45.0.739182933404.issue4753@psf.upfronthosting.co.za> Changes by Armin Rigo : ---------- nosy: -arigo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 11:32:35 2009 From: report at bugs.python.org (Kandalintsev Alexandre) Date: Thu, 01 Jan 2009 10:32:35 +0000 Subject: [issue4800] little inaccuracy in Py_ssize_t explanation In-Reply-To: <1230805955.17.0.970467276629.issue4800@psf.upfronthosting.co.za> Message-ID: <1230805955.17.0.970467276629.issue4800@psf.upfronthosting.co.za> New submission from Kandalintsev Alexandre : Documentation says that ======== There?s no chance that the reference count can overflow; at least as many bits are used to hold the reference count as there are distinct memory locations in virtual memory (assuming sizeof(Py_ssize_t) >= sizeof(void*)). Thus, the reference count increment is a simple operation. ======== But Py_ssize_t is a signed type so in case of sizeof(Py_ssize_t) == sizeof (void*)) it can only reference a half of memmory :). But because any python object consumes much more than 2bytes this is not a problem. ---------- assignee: georg.brandl components: Documentation messages: 78695 nosy: exe, georg.brandl severity: normal status: open title: little inaccuracy in Py_ssize_t explanation versions: Python 3.0, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 12:47:00 2009 From: report at bugs.python.org (Georg Brandl) Date: Thu, 01 Jan 2009 11:47:00 +0000 Subject: [issue4100] xml.etree.ElementTree does not read xml-text over page bonderies In-Reply-To: <1223650418.42.0.473297107812.issue4100@psf.upfronthosting.co.za> Message-ID: <1230810420.47.0.891275677639.issue4100@psf.upfronthosting.co.za> Georg Brandl added the comment: Thanks, applied in r68116. ---------- assignee: effbot -> georg.brandl nosy: +georg.brandl resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 12:48:47 2009 From: report at bugs.python.org (Georg Brandl) Date: Thu, 01 Jan 2009 11:48:47 +0000 Subject: [issue4136] merge json library with simplejson 2.0.4 In-Reply-To: <1224194929.7.0.263636117378.issue4136@psf.upfronthosting.co.za> Message-ID: <1230810527.87.0.494459284957.issue4136@psf.upfronthosting.co.za> Georg Brandl added the comment: Bumping priority a bit. ---------- nosy: +georg.brandl priority: -> critical _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 12:54:04 2009 From: report at bugs.python.org (Georg Brandl) Date: Thu, 01 Jan 2009 11:54:04 +0000 Subject: [issue4156] Docs for BaseHandler.protocol_xxx methods are unclear In-Reply-To: <1224587370.27.0.33419504535.issue4156@psf.upfronthosting.co.za> Message-ID: <1230810844.14.0.610621292248.issue4156@psf.upfronthosting.co.za> Georg Brandl added the comment: Fixed in r68117. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 13:00:37 2009 From: report at bugs.python.org (Georg Brandl) Date: Thu, 01 Jan 2009 12:00:37 +0000 Subject: [issue4185] re module treats raw strings as normal strings In-Reply-To: <1224734129.35.0.170011642262.issue4185@psf.upfronthosting.co.za> Message-ID: <1230811237.47.0.854153877864.issue4185@psf.upfronthosting.co.za> Georg Brandl added the comment: Added a bit to the re.sub(n) docstrings in r68118. ---------- nosy: +georg.brandl resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 13:01:45 2009 From: report at bugs.python.org (David Moss) Date: Thu, 01 Jan 2009 12:01:45 +0000 Subject: [issue3959] Add Google's ipaddr.py to the stdlib In-Reply-To: <1222298050.73.0.172554962966.issue3959@psf.upfronthosting.co.za> Message-ID: <1230811305.7.0.402640242385.issue3959@psf.upfronthosting.co.za> David Moss added the comment: ipaddr appears to be on a fast track for "batteries included" status without much consultation in the wider Python community. As BDFL it's ultimately Guido's call, but it would be disappointing to see one solution being chosen wholesale without much additional discussion. There is no point in wrangling over the individual features of one library at revision x versus another at revision y. Software is a moving target. Omissions and bugs are easily dispatched. Ultimately we all want the same thing, better software that makes our lives easier. As for netaddr it is intended to cover more ground that all the other solutions out there. Here is a handy list of them :- http://code.google.com/p/netaddr/wiki/YetAnotherPythonIPModule This may preclude its suitability for the standard library in any event being intended to support any and all network address types, not just IPv4 and IPv6. It is also currently, very much in beta, being about 75% feature complete with 6-9 months work of (part-time) work left on it before it can reach version 1.0 ready. A Python 3.0 version is also planned for release soon. In answer to various specific issues raised about netaddr. The need for separate IP and CIDR classes is set out in the FAQ page :- http://code.google.com/p/netaddr/wiki/NetAddrFAQ FYI, AddrRange is a (not yet abstract) base class with a start and end address covering the shared functionality of 3 subclasses (IPRange, CIDR, Wildcard) which should all interchangeable (within reason). It is also supports generic address (Addr objects) rather than just IP specific ones. Base 2 slices is not always the best way of expressing groups of network hosts, they are *one* way. With netaddr, I wanted to avoid the 'super object' syndrome that seems to dog virtuall all other existing efforts out there, and not only those in Python. In any event confusion will hopefully be dealt with as the docs improve. As for performance, netaddr's current speed for certain operations areas may be slower than other implementations but the optimisation phase of development hasn't even begun. There are loads more features to add and get working before that starts. One point I will make is on licensing. netaddr is BSD, so you can do whatever you want with it and contribute as you see fit. At the present time, contributing to ipaddr for anyone outside Google seems like the software equivalent of climbing Mount Everest! Even if I personally wanted to contribute to this particular project's efforts, having to sign the individual CLA would automatically preclude me from doing so. This is a *major* sticking point. Regardless of whatever decision is taken, netaddr will always be available as long as it has a user base, either as built in, optional extra or as a part of some wider standardisation effort. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 13:10:10 2009 From: report at bugs.python.org (Georg Brandl) Date: Thu, 01 Jan 2009 12:10:10 +0000 Subject: [issue4222] dis.findlinestarts is missing from dis.__all__ and from the online documentation In-Reply-To: <1225214206.66.0.527749553778.issue4222@psf.upfronthosting.co.za> Message-ID: <1230811810.21.0.874713501957.issue4222@psf.upfronthosting.co.za> Georg Brandl added the comment: Documented dis.findlinestarts() and put it into dis.__all__ in r68119. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 13:15:39 2009 From: report at bugs.python.org (Georg Brandl) Date: Thu, 01 Jan 2009 12:15:39 +0000 Subject: [issue4228] struct.pack('L', -1) In-Reply-To: <1225294862.2.0.0798680271584.issue4228@psf.upfronthosting.co.za> Message-ID: <1230812139.98.0.109625120131.issue4228@psf.upfronthosting.co.za> Georg Brandl added the comment: Committed to trunk in r68120. ---------- nosy: +georg.brandl status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 13:32:40 2009 From: report at bugs.python.org (Georg Brandl) Date: Thu, 01 Jan 2009 12:32:40 +0000 Subject: [issue4742] 3.0 distutils byte-compiling -> Syntax error: unknown encoding: cp1252 In-Reply-To: <1230158367.11.0.521550154703.issue4742@psf.upfronthosting.co.za> Message-ID: <1230813160.67.0.712968547794.issue4742@psf.upfronthosting.co.za> Changes by Georg Brandl : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 13:37:28 2009 From: report at bugs.python.org (Georg Brandl) Date: Thu, 01 Jan 2009 12:37:28 +0000 Subject: [issue4772] undesired switch fall-through in socketmodule.c In-Reply-To: <1230582973.84.0.698923049603.issue4772@psf.upfronthosting.co.za> Message-ID: <1230813448.26.0.87751252923.issue4772@psf.upfronthosting.co.za> Georg Brandl added the comment: TypeError or ValueError? ---------- nosy: +georg.brandl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 13:50:05 2009 From: report at bugs.python.org (Georg Brandl) Date: Thu, 01 Jan 2009 12:50:05 +0000 Subject: [issue4798] Update deprecation of 'new' module in PEP 4. In-Reply-To: <1230796061.0.0.856185746745.issue4798@psf.upfronthosting.co.za> Message-ID: <1230814205.37.0.00388253999661.issue4798@psf.upfronthosting.co.za> Georg Brandl added the comment: Applied the doc patch in r68121. Updated PEP 4 to point to PEP 3108 (which contains a list of all modules removed in 3k and deprecated in 2.6, not just "new") in r68122. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 13:52:37 2009 From: report at bugs.python.org (Georg Brandl) Date: Thu, 01 Jan 2009 12:52:37 +0000 Subject: [issue4784] Mismatch in documentation for module "webbrowser" In-Reply-To: <1230658906.5.0.498985661284.issue4784@psf.upfronthosting.co.za> Message-ID: <1230814357.84.0.727802068614.issue4784@psf.upfronthosting.co.za> Georg Brandl added the comment: Fixed in r68123. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 13:53:32 2009 From: report at bugs.python.org (Georg Brandl) Date: Thu, 01 Jan 2009 12:53:32 +0000 Subject: [issue4782] json documentation missing load(), loads() In-Reply-To: <1230652909.54.0.874688686508.issue4782@psf.upfronthosting.co.za> Message-ID: <1230814412.83.0.534556098443.issue4782@psf.upfronthosting.co.za> Georg Brandl added the comment: Fixed in r68124. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 14:02:20 2009 From: report at bugs.python.org (Georg Brandl) Date: Thu, 01 Jan 2009 13:02:20 +0000 Subject: [issue4776] distutils documentation In-Reply-To: <1230610779.11.0.0228162085624.issue4776@psf.upfronthosting.co.za> Message-ID: <1230814940.58.0.0670293443013.issue4776@psf.upfronthosting.co.za> Georg Brandl added the comment: Thanks, documented in r68125. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 14:06:21 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 01 Jan 2009 13:06:21 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230786912.6.0.31251595307.issue4753@psf.upfronthosting.co.za> Message-ID: <1230815186.7917.11.camel@localhost> Antoine Pitrou added the comment: Hi, > Why don't you use the C preprocessor instead of that Python code? > Sample code: We would have to change opcode.h for this to be truely useful (in order to re-use OPCODE_LIST()). I think that should be the subject of a separate bug entry for code reorganization. Thanks for all the explanation and pointers! About register allocation, I wonder if the "temporary variables" u,v,w could be declared separately in each opcode rather than at the top of the eval function, so that the compiler doesn't try to store their values between two opcodes. As for the "register" declarations, I think they're just remains of the past. Antoine. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 14:15:02 2009 From: report at bugs.python.org (Georg Brandl) Date: Thu, 01 Jan 2009 13:15:02 +0000 Subject: [issue4767] email.mime incorrectly documented (or implemented) In-Reply-To: <1230566108.89.0.124705904062.issue4767@psf.upfronthosting.co.za> Message-ID: <1230815702.18.0.18382899748.issue4767@psf.upfronthosting.co.za> Georg Brandl added the comment: Thanks, fixed in r68127. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 14:26:57 2009 From: report at bugs.python.org (Georg Brandl) Date: Thu, 01 Jan 2009 13:26:57 +0000 Subject: [issue4789] Documentation changes break existing URIs In-Reply-To: <1230683867.44.0.219209732128.issue4789@psf.upfronthosting.co.za> Message-ID: <1230816417.03.0.949531521828.issue4789@psf.upfronthosting.co.za> Georg Brandl added the comment: I've added the redirects. I hope that mailman updates its links in the next release though :) ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 15:00:40 2009 From: report at bugs.python.org (Skip Montanaro) Date: Thu, 01 Jan 2009 14:00:40 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230786185.08.0.151834797629.issue4753@psf.upfronthosting.co.za> Message-ID: <18780.52355.640703.581301@montanaro-dyndns-org.local> Skip Montanaro added the comment: Skip> You could backport it to 2.4 & 2.5 and just put it up on PyPI... Paolo> I was thinking to a private backport as well. I didn't know Paolo> about PyPI, it looks like PyPI is more for contributed modules Paolo> than for this, would that work? I don't see why it wouldn't. Skip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 16:02:00 2009 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 01 Jan 2009 15:02:00 +0000 Subject: [issue4797] test_fileio error (windows) In-Reply-To: <1230786370.88.0.170386258104.issue4797@psf.upfronthosting.co.za> Message-ID: <1230822120.29.0.0860160699969.issue4797@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Please go ahead. ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 16:39:58 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 01 Jan 2009 15:39:58 +0000 Subject: =?utf-8?q?[issue3680]_Cycles_with_some_iterator_are=09leaking.?= In-Reply-To: <1219697025.92.0.458237292903.issue3680@psf.upfronthosting.co.za> Message-ID: <1230824398.66.0.273249524263.issue3680@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Committed to trunk and py3k, thanks! ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 17:04:37 2009 From: report at bugs.python.org (Hirokazu Yamamoto) Date: Thu, 01 Jan 2009 16:04:37 +0000 Subject: [issue4797] test_fileio error (windows) In-Reply-To: <1230786370.88.0.170386258104.issue4797@psf.upfronthosting.co.za> Message-ID: <1230825877.08.0.450209118065.issue4797@psf.upfronthosting.co.za> Hirokazu Yamamoto added the comment: Done. Fixed in r68134(trunk) and r68139(py3k). ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 19:30:55 2009 From: report at bugs.python.org (Roumen Petrov) Date: Thu, 01 Jan 2009 18:30:55 +0000 Subject: [issue2233] Makefile.pre.in contains extra slash before $(DESTDIR) which can cause Cygwin build to fail In-Reply-To: <1204652870.95.0.330326965123.issue2233@psf.upfronthosting.co.za> Message-ID: <1230834655.18.0.6908338838.issue2233@psf.upfronthosting.co.za> Roumen Petrov added the comment: I would like to confirm issue for trunk. ---------- nosy: +rpetrov versions: +Python 2.6, Python 2.7, Python 3.0, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 19:49:05 2009 From: report at bugs.python.org (Derek Morr) Date: Thu, 01 Jan 2009 18:49:05 +0000 Subject: [issue1675455] Use getaddrinfo() in urllib2.py for IPv6 support Message-ID: <1230835745.38.0.984602760083.issue1675455@psf.upfronthosting.co.za> Derek Morr added the comment: Senthil, I don't think your gethost_addrinfo() function will work. On a v6- enabled machine, it will only return v6 or v4 names. Shouldn't it return both (since a machine could have both v4 and v6 addresses)? For example, on my machine, I have the following addresses for "localhost": ::1, fe80::1%lo0, 127.0.0.1. Also, why is the AI_CANONNAME flag set? The canonname field isn't used. And you only appear to take the last IP address returned (sa[0]). Shouldn't you return all the addresses? ---------- nosy: +dmorr _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 19:52:53 2009 From: report at bugs.python.org (Derek Morr) Date: Thu, 01 Jan 2009 18:52:53 +0000 Subject: [issue1675455] Use getaddrinfo() in urllib2.py for IPv6 support Message-ID: <1230835973.19.0.654530955783.issue1675455@psf.upfronthosting.co.za> Derek Morr added the comment: Question: Why does FTPHandler.ftp_open() try to resolve the hostname()? The hostname will be passed into connect_ftp(), then into urllib.ftpwrapper(), and eventually into ftplib.FTP.connect(), which is IPv6-aware. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 19:56:03 2009 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Jan 2009 18:56:03 +0000 Subject: [issue4035] Support bytes for os.exec*() In-Reply-To: <1223077104.22.0.62328245443.issue4035@psf.upfronthosting.co.za> Message-ID: <1230836163.27.0.859065495642.issue4035@psf.upfronthosting.co.za> STINNER Victor added the comment: > Hmm, I think the supported types should be the same for all > platforms, otherwise it creates unnecessary headaches. I'm don't know Windows very well, but I read many times that Windows uses unicode everywhere. I'm unable to decide if it's a good thing or not to support also bytes on Windows, and anyway I'm unable to write such patch. See also issue #4036 (bytes for subprocess.Popen), especially Martin's message msg74305 (Martin is our Windows expert ;-)). _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 19:59:21 2009 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Jan 2009 18:59:21 +0000 Subject: [issue4751] Patch for better thread support in hashlib In-Reply-To: <1230298756.92.0.632482701363.issue4751@psf.upfronthosting.co.za> Message-ID: <1230836361.27.0.91383165779.issue4751@psf.upfronthosting.co.za> Changes by STINNER Victor : _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 20:02:12 2009 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Jan 2009 19:02:12 +0000 Subject: [issue4751] Patch for better thread support in hashlib In-Reply-To: <1230298756.92.0.632482701363.issue4751@psf.upfronthosting.co.za> Message-ID: <1230836532.64.0.190969738455.issue4751@psf.upfronthosting.co.za> STINNER Victor added the comment: Ooooh, I suggested to ebfe to remove the GIL unlock/lock, but I was wrong :-( I hate locks! What is the right fix? Replace ENTER_HASHLIB(self) Py_BEGIN_ALLOW_THREADS ... Py_END_ALLOW_THREADS LEAVE_HASHLIB(self) by Py_BEGIN_ALLOW_THREADS ENTER_HASHLIB(self) ... LEAVE_HASHLIB(self) Py_END_ALLOW_THREADS ? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 20:09:12 2009 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Jan 2009 19:09:12 +0000 Subject: [issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0) In-Reply-To: <1230728461.13.0.270652897235.issue4791@psf.upfronthosting.co.za> Message-ID: <1230836952.07.0.0306018577522.issue4791@psf.upfronthosting.co.za> STINNER Victor added the comment: I'm unable to reproduce the issue. I tried to create files on my FTP server with non-ASCII characters or spaces in the filenames, but everything is fine. Can you reproduce the problem outside IDLE? Or is the issue specific to IDLE? I mean: write a script and execute "python script.py" in a terminal. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 20:22:36 2009 From: report at bugs.python.org (Roumen Petrov) Date: Thu, 01 Jan 2009 19:22:36 +0000 Subject: [issue4780] Makefile.pre.in patch to run regen on OSX (framework build) In-Reply-To: <1230642378.46.0.486113805886.issue4780@psf.upfronthosting.co.za> Message-ID: <1230837756.81.0.232673992033.issue4780@psf.upfronthosting.co.za> Roumen Petrov added the comment: The issue is same for trunk. Step to reproduce(as example on linux): - remove existing python installation (optional) - rename Lib/plat-linux2 ... python$EXE ../../Tools/scripts/h2py.py -i '(u_long)' /usr/include/netinet/in.h python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory ---------- nosy: +rpetrov versions: +Python 2.6, Python 2.7, Python 3.0 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 20:43:17 2009 From: report at bugs.python.org (Paolo 'Blaisorblade' Giarrusso) Date: Thu, 01 Jan 2009 19:43:17 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230325778.98.0.752974375077.issue4753@psf.upfronthosting.co.za> Message-ID: <1230838997.91.0.909395185673.issue4753@psf.upfronthosting.co.za> Paolo 'Blaisorblade' Giarrusso added the comment: > We would have to change opcode.h for this to be truely useful (in order to re-use OPCODE_LIST()). Yep. > I think that should be the subject of a separate bug entry for code reorganization. Agreed, I'll maybe try to find time for it. > Thanks for all the explanation and pointers! You're welcome, thanks to you for writing the patch! And > About register allocation, I wonder if the "temporary variables" u,v,w could be declared separately in each opcode rather than at the top of the eval function, so that the compiler doesn't try to store their values between two opcodes. I didn't look at the output, but that shouldn't be needed with decent optimizers, since they are local variables, so the compiler has a full picture of their usage (this does not happen with the content of the heap, where the frame object may lie). I think that change would just save some compilation time for dataflow analysis, maybe :-). Or could make clearer which variables is used where, but that is a matter of taste (what's there is fine for me). I just studied liveness analysis in compilers, and it computes whether a variable is live before and after each statement; if the value of a variable is not used in some piece of code until the next write to the variable, it is considered dead in that piece of code, and that variable does not take space; since u, v, w are either unused or are written to before usage in all opcodes, they're dead at the beginning of each opcode, so they're also dead just before dispatch. The only important thing is that the content of the jump table are known to the compiler and that the compiler makes use of that. Simply passing a non-const jump table to some function defined elsewhere (which could in theory modify it) would make the output much worse. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 21:03:39 2009 From: report at bugs.python.org (Roumen Petrov) Date: Thu, 01 Jan 2009 20:03:39 +0000 Subject: [issue4801] _collections module fail to build on cygwin In-Reply-To: <1230840219.24.0.00127311298202.issue4801@psf.upfronthosting.co.za> Message-ID: <1230840219.24.0.00127311298202.issue4801@psf.upfronthosting.co.za> New submission from Roumen Petrov : make log: gcc -shared -Wl,--enable-auto-image-base .../Modules/_collectionsmodule.o -L/usr/local/lib -L. -lpython2.7 -o build/lib.cygwin-1.5.25-i686-2.7/_collections.dll .../Modules/_collectionsmodule.o: In function `deque_iter': .../Modules/_collectionsmodule.c:970: undefined reference to `__PyGC_generation0' .... ---------- components: Build files: py-trunk-incl-objimpl.h-patch messages: 78723 nosy: rpetrov severity: normal status: open title: _collections module fail to build on cygwin versions: Python 2.7 Added file: http://bugs.python.org/file12519/py-trunk-incl-objimpl.h-patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 21:08:30 2009 From: report at bugs.python.org (Roumen Petrov) Date: Thu, 01 Jan 2009 20:08:30 +0000 Subject: [issue4802] detect_tkinter for cygwin In-Reply-To: <1230840510.49.0.878061128691.issue4802@psf.upfronthosting.co.za> Message-ID: <1230840510.49.0.878061128691.issue4802@psf.upfronthosting.co.za> New submission from Roumen Petrov : Check for installed X on cygwin can't find X11/Xlib.h in detect_tkinter from setup.py ---------- files: py-trunk-detect_tkinter-cygwin.patch keywords: patch messages: 78724 nosy: rpetrov severity: normal status: open title: detect_tkinter for cygwin Added file: http://bugs.python.org/file12520/py-trunk-detect_tkinter-cygwin.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 21:11:55 2009 From: report at bugs.python.org (Roumen Petrov) Date: Thu, 01 Jan 2009 20:11:55 +0000 Subject: [issue2233] Makefile.pre.in contains extra slash before $(DESTDIR) which can cause Cygwin build to fail In-Reply-To: <1204652870.95.0.330326965123.issue2233@psf.upfronthosting.co.za> Message-ID: <1230840715.01.0.857439850258.issue2233@psf.upfronthosting.co.za> Roumen Petrov added the comment: I'm not sure that installation work if slash is removed and DESTDIR is not specified. What about to replace "slash before $(DESTDIR)" with "/./" ? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 21:31:28 2009 From: report at bugs.python.org (Daniel Diniz) Date: Thu, 01 Jan 2009 20:31:28 +0000 Subject: [issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0) In-Reply-To: <1230728461.13.0.270652897235.issue4791@psf.upfronthosting.co.za> Message-ID: <1230841888.24.0.941077305817.issue4791@psf.upfronthosting.co.za> Daniel Diniz added the comment: Hi Chris Since dir calls retrlines and retrlines has a 'while 1:' loop, the bug probably comes from there. Either it hangs in the fp.readline call or the break condition is never met. Can you put some print diagnostics inside Lib/ftplib.py->FTP.retrlines (around line 405) to help pinpointing the issue? HTH, Daniel ---------- nosy: +ajaksu2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 21:41:44 2009 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Jan 2009 20:41:44 +0000 Subject: [issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0) In-Reply-To: <1230728461.13.0.270652897235.issue4791@psf.upfronthosting.co.za> Message-ID: <1230842504.59.0.53085681076.issue4791@psf.upfronthosting.co.za> STINNER Victor added the comment: > Can you put some print diagnostics inside Lib/ftplib.py (...) .set_debuglevel(2) already prints a lot of informations. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 21:45:27 2009 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Jan 2009 20:45:27 +0000 Subject: [issue4772] undesired switch fall-through in socketmodule.c In-Reply-To: <1230582973.84.0.698923049603.issue4772@psf.upfronthosting.co.za> Message-ID: <1230842727.52.0.288938250361.issue4772@psf.upfronthosting.co.za> STINNER Victor added the comment: makesockaddr() raise a TypeError("Invalid address type") for an invalid AF_TIPC address, but I would prefer a ValueError. ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 22:39:52 2009 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Thu, 01 Jan 2009 21:39:52 +0000 Subject: [issue4775] Incorrect documentation - UTC time In-Reply-To: <1230706101.54.0.711688688948.issue4775@psf.upfronthosting.co.za> Message-ID: <495D3825.7090100@egenix.com> Marc-Andre Lemburg added the comment: FWIW: POSIX defines Unix time_t *not* to include leap seconds. You can easily check whether your platform or C lib behaves POSIX-ly correct or not: POSIX: 1986-12-31 23:59:59 UTC == 536457599 ticks With leap seconds: == 536457612 ticks (since there were 13 leap seconds in the years 1972-1985) For most practical purposes the difference doesn't really matter, since date differences are usually counted in days, not seconds. In cases where it does matter, you're better off with a custom solution, since applications or other libraries tend not to handle leap seconds well. ---------- nosy: +lemburg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 22:58:28 2009 From: report at bugs.python.org (Alexandre Vassalotti) Date: Thu, 01 Jan 2009 21:58:28 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230325778.98.0.752974375077.issue4753@psf.upfronthosting.co.za> Message-ID: <1230847108.63.0.351801014097.issue4753@psf.upfronthosting.co.za> Alexandre Vassalotti added the comment: Antoine Pitrou wrote: > [...] count the number of indirect jump instructions in ceval.c: > > grep -E "jmp[[:space:]]\*%" ceval.s > > There should be 85 to 90 of them, roughly. If there are many less, then > the compiler has tried to optimize them by "sharing" them. I get 86 with GCC 4.x and SUNCC. However, with GCC 3.4 I only get a single computed goto. Is there some hidden option to make GCC avoid sharing jumps? > Because otherwise the measurements these options are meant to do would > be meaningless. Ah, I see now. Maybe you should add a quick comment that mentions this. > I don't have a Sun machine to test, so I'll leave to someone else to > check and enable if they want to. I tested it and it worked, no test failures to report. Just change the macro test: #ifdef __GNUC__ && \ ... to #ifdef (__GNUC__ || __SUNPRO_C) && \ ... I attached some additional benchmarks on SunOS. So far, it seems the benefits of the proposed optimization are highly compiler-dependent. Added file: http://bugs.python.org/file12521/amd-athlon64-x2-suncc-pybench.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 22:58:40 2009 From: report at bugs.python.org (Alexandre Vassalotti) Date: Thu, 01 Jan 2009 21:58:40 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230325778.98.0.752974375077.issue4753@psf.upfronthosting.co.za> Message-ID: <1230847120.71.0.532260709295.issue4753@psf.upfronthosting.co.za> Changes by Alexandre Vassalotti : Added file: http://bugs.python.org/file12522/amd-athlon64-x2-gcc-sunos-pybench.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 23:00:26 2009 From: report at bugs.python.org (Alexandre Vassalotti) Date: Thu, 01 Jan 2009 22:00:26 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230325778.98.0.752974375077.issue4753@psf.upfronthosting.co.za> Message-ID: <1230847226.06.0.711637972536.issue4753@psf.upfronthosting.co.za> Alexandre Vassalotti added the comment: > Attached new patch for fixes suggested by Alexandre (rename > opcode_targets.c to opcode_targets.h, replace USE_THREADED_CODE with > USE_COMPUTED_GOTOS). You forgot to update your script to use the new name. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 23:05:46 2009 From: report at bugs.python.org (Craig Holmquist) Date: Thu, 01 Jan 2009 22:05:46 +0000 Subject: [issue4566] 2.6.1 breaks many applications that embed Python on Windows In-Reply-To: <1228577334.37.0.676469955994.issue4566@psf.upfronthosting.co.za> Message-ID: <1230847546.8.0.602549249733.issue4566@psf.upfronthosting.co.za> Craig Holmquist added the comment: Here's an option, though unfortunately not a trivial one: use a private build of the C runtime. The Windows version of Firefox does this (mozcrt19.dll). The private CRT build doesn't use SxS in any way, so it gets around this issue, as well as other issues like not allowing "for me" installs on Vista (#4018). For me to build the CRT from the source included with Visual Studio 2008 took some tweaking - apparently having the CRT source build properly out of the box wasn't a priority for MS (the Mozilla CRT seems to be built from the VS2005 source; perhaps that version is more cooperative). It does yield a CRT that links like an ordinary DLL, but the fact that it can't be built without modifications is a major drawback to this solution. Also, I'd assume that the CRT source isn't included in the Express version (and possibly other ones), so that's a downside, too. As far as Python itself, the project configurations would have to be changed to define _CRT_NOFORCE_MANIFEST, suppress the default linking to the stock CRT (/NODEFAULTLIB:msvcrt.lib), and link to the import library for the private CRT. I might try to create an experimental solution config for this. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 23:36:18 2009 From: report at bugs.python.org (Roumen Petrov) Date: Thu, 01 Jan 2009 22:36:18 +0000 Subject: [issue4472] Is shared lib building broken on trunk for Mac OS X? In-Reply-To: <18738.49496.996446.483821@montanaro-dyndns-org.local> Message-ID: <1230849378.3.0.702418740402.issue4472@psf.upfronthosting.co.za> Roumen Petrov added the comment: I just finish test for altbininstall make target on linux and cygwin. Ronald, About the SO issue - in makefile we may use $(LDLIBRARY) instead of libpython$(VERSION)$(SO) (see py-issue-4472-makefile.patch). For cygwin libpython$(VERSION)$(SO) is equal to $(DLLLIBRARY) and DLLLIBRARY is set only on cygwin. Added file: http://bugs.python.org/file12523/py-issue-4472-makefile.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 23:46:15 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 01 Jan 2009 22:46:15 +0000 Subject: [issue4751] Patch for better thread support in hashlib In-Reply-To: <1230836532.64.0.190969738455.issue4751@psf.upfronthosting.co.za> Message-ID: <1230849981.16684.3.camel@localhost> Antoine Pitrou added the comment: The right fix would probably be to define ENTER_HASHLIB(self) as Py_BEGIN_ALLOW_THREADS PyThread_acquire_lock(self->lock) Py_END_ALLOW_THREADS _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 23:48:37 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 01 Jan 2009 22:48:37 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230847108.63.0.351801014097.issue4753@psf.upfronthosting.co.za> Message-ID: <1230850123.16684.6.camel@localhost> Antoine Pitrou added the comment: > I get 86 with GCC 4.x and SUNCC. However, with GCC 3.4 I only get a > single computed goto. Is there some hidden option to make GCC avoid > sharing jumps? Try -fno-crossjumping. > I tested it and it worked, no test failures to report. Just change the > macro test: > > #ifdef __GNUC__ && \ > ... > > to > > #ifdef (__GNUC__ || __SUNPRO_C) && \ > ... Thanks. > You forgot to update your script to use the new name. Ah, that's rather dumb :) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 1 23:59:51 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 01 Jan 2009 22:59:51 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230325778.98.0.752974375077.issue4753@psf.upfronthosting.co.za> Message-ID: <1230850791.65.0.79634207218.issue4753@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I've updated the comments as per Alexandre's request, added support for SUN CC, and fixed the generation script to use the new filename. Added file: http://bugs.python.org/file12524/threadedceval5.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 00:02:19 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 01 Jan 2009 23:02:19 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230325778.98.0.752974375077.issue4753@psf.upfronthosting.co.za> Message-ID: <1230850939.52.0.4531649253.issue4753@psf.upfronthosting.co.za> Changes by Antoine Pitrou : Removed file: http://bugs.python.org/file12514/threadedceval4.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 00:07:49 2009 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Thu, 01 Jan 2009 23:07:49 +0000 Subject: [issue4747] SyntaxError executing a script containing non-ASCII characters in its name or path In-Reply-To: <1230252107.45.0.57470787699.issue4747@psf.upfronthosting.co.za> Message-ID: <1230851269.02.0.98478897644.issue4747@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: Fixed in r68143 (py3k) and r68144 (3.0). Thanks for the report! ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 00:20:36 2009 From: report at bugs.python.org (Graham Dumpleton) Date: Thu, 01 Jan 2009 23:20:36 +0000 Subject: [issue4718] wsgiref package totally broken In-Reply-To: <1229945457.69.0.495711258596.issue4718@psf.upfronthosting.co.za> Message-ID: <1230852036.91.0.153383854132.issue4718@psf.upfronthosting.co.za> Graham Dumpleton added the comment: One interesting thing of note that has occurred to me looking at the patch is that although with Python <3.0 you technically could return a str as iterable from application, ie., because iteration over str returns str for each character, the same doesn't really apply to bytes in Python 3.0. This is because iterating over bytes yields an int fdor each item. Thus have odd situation where with Python 3.0, one could technically return str as iterable, with rule that would apply would be that each str returned would then be converted to bytes by way of latin-1 conversion, but for bytes returned as iterable, should fail. Not sure how this plays out in wsgiref server yet as haven't looked. Anyway, make the validator code: @@ -426,6 +436,6 @@ # Technically a string is legal, which is why it's a really bad # idea, because it may cause the response to be returned # character-by-character - assert_(not isinstance(iterator, str), + assert_(not isinstance(iterator, (str, bytes)), "You should not return a string as your application iterator, " "instead return a single-item list containing that string.") quite a good thing to have. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 00:44:20 2009 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Thu, 01 Jan 2009 23:44:20 +0000 Subject: [issue4035] Support bytes for os.exec*() In-Reply-To: <1223077104.22.0.62328245443.issue4035@psf.upfronthosting.co.za> Message-ID: <1230853460.54.0.669176028081.issue4035@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: Every function of the Windows API comes in pair: an Ansi function (which accepts char* names) and a Wide function (which accepts wchar_t* names; Py_UNICODE* can be passed as-is) Don't perform conversion on Windows, just call the proper function. ---------- nosy: +amaury.forgeotdarc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 00:44:46 2009 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 01 Jan 2009 23:44:46 +0000 Subject: [issue3299] invalid object destruction in re.finditer() In-Reply-To: <1215354044.0.0.987178228996.issue3299@psf.upfronthosting.co.za> Message-ID: <1230853486.77.0.922088099182.issue3299@psf.upfronthosting.co.za> Nick Coghlan added the comment: It certainly looks like all direct calls to PyObject_DEL/PyObject_Del from outside tp_dealloc implementations are going to be broken in pydebug builds. Replacing those calls with either Py_DECREF operations (as Victor's patch does) or direct calls to _Py_Dealloc should get them to do the right thing. I'm a little wary of adding calls to _Py_ForgetReference into PyObject_Del though, since most of the time the reference will already have been forgotten by the time that PyObject_Del is called. My suggestion would be: 1. Update the docs on PyObject_Del to specifically warn against using it for error cleanup after a successful PyObject_New invocation, instead pointing users of the C API to Py_DECREF. Basically, code that calls PyObject_Del outside a tp_dealloc method is probably doing something wrong. Note also that tp_dealloc implementations in such cases will need to cope with instances that are only partially initialised (e.g. by using Py_XDECREF instead of Py_DECREF). 2. Fix the instances in the standard library where _Py_Dealloc may be bypassed by direct calls to PyObject_Del. The alternative would be to change the pydebug version of PyObject_Del to check if the reference count on the object is 1 rather than 0. That should be a pretty good indication that we're dealing with a case of cleaning up after a failure to fully initialise an object, and we can call _Py_ForgetReference directly from PyObject_Del, retroactively making all those direct invocations of PyObject_Del "correct". Hmm, now that I write that idea down, it doesn't sound nearly as scary as I thought it would... ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 00:47:18 2009 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 01 Jan 2009 23:47:18 +0000 Subject: [issue3299] Direct calls to PyObject_Del/PyObject_DEL are broken for --with-pydebug In-Reply-To: <1215354044.0.0.987178228996.issue3299@psf.upfronthosting.co.za> Message-ID: <1230853638.63.0.659773500977.issue3299@psf.upfronthosting.co.za> Nick Coghlan added the comment: (changing title and unassigning from Fredrik since this isn't an RE specific problem, flagged as also affecting interpreter core, flagged as affecting all currently maintained versions) ---------- assignee: effbot -> components: +Interpreter Core title: invalid object destruction in re.finditer() -> Direct calls to PyObject_Del/PyObject_DEL are broken for --with-pydebug versions: +Python 2.6, Python 3.0, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 01:05:07 2009 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Fri, 02 Jan 2009 00:05:07 +0000 Subject: [issue4801] _collections module fail to build on cygwin In-Reply-To: <1230840219.24.0.00127311298202.issue4801@psf.upfronthosting.co.za> Message-ID: <1230854707.44.0.666338430006.issue4801@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: Committed a different correction in r68145: according to documention, _PyObject_GC_TRACK should not be used in extension modules. Thanks for the report. ---------- nosy: +amaury.forgeotdarc resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 01:08:59 2009 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 02 Jan 2009 00:08:59 +0000 Subject: [issue3299] Direct calls to PyObject_Del/PyObject_DEL are broken for --with-pydebug In-Reply-To: <1215354044.0.0.987178228996.issue3299@psf.upfronthosting.co.za> Message-ID: <1230854939.23.0.581472186321.issue3299@psf.upfronthosting.co.za> Nick Coghlan added the comment: Ah, now that I go to implement it, I remember why I didn't like the idea of doing anything directly in PyObject_Del. While the Python memory allocator is primarily designed for allocation of Python objects, it isn't actually *limited* to that. So there is no guarantee that the void pointer passed in to PyObject_Del can be safely cast to a PyObject pointer. The idea could still be implemented by scanning the list of active objects to see if the passed in pointer refers to one of them, but that would make object deallocation in pydebug builds extraordinarily slow. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 01:43:34 2009 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 02 Jan 2009 00:43:34 +0000 Subject: [issue4614] Document PyModule_Create() In-Reply-To: <1228856807.3.0.093975807386.issue4614@psf.upfronthosting.co.za> Message-ID: <1230857014.1.0.462620101645.issue4614@psf.upfronthosting.co.za> Changes by Benjamin Peterson : ---------- priority: -> critical _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 01:45:02 2009 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 02 Jan 2009 00:45:02 +0000 Subject: [issue4614] Document PyModule_Create() In-Reply-To: <1228856807.3.0.093975807386.issue4614@psf.upfronthosting.co.za> Message-ID: <1230857102.72.0.771973960722.issue4614@psf.upfronthosting.co.za> Changes by Benjamin Peterson : _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 02:22:00 2009 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Jan 2009 01:22:00 +0000 Subject: [issue4768] email.generator.Generator object bytes/str crash - b64encode() bug? In-Reply-To: <1230571301.08.0.30132908931.issue4768@psf.upfronthosting.co.za> Message-ID: <1230859320.42.0.0950895992934.issue4768@psf.upfronthosting.co.za> STINNER Victor added the comment: > I think the library function base64.b64encode() should return > a string, not bytes. Yes, in the email module, the payload is an unicode string, not a bytes string. We have to be able to concatenate headers (eg. "Content-Type: image/fish\nMIME-Version: 1.0\nContent-Transfer-Encoding: base64\n") and encoded data (eg. "R0lGO"). Attached patch implements this fix: encode_base64() returns str (and not bytes). The patchs fixes the unit tests and adds a new regression test for MIMEImage.as_string(). ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 02:22:12 2009 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Jan 2009 01:22:12 +0000 Subject: [issue4768] email.generator.Generator object bytes/str crash - b64encode() bug? In-Reply-To: <1230571301.08.0.30132908931.issue4768@psf.upfronthosting.co.za> Message-ID: <1230859332.43.0.595186568835.issue4768@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- keywords: +patch Added file: http://bugs.python.org/file12525/email_base64_bytes.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 02:30:29 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 02 Jan 2009 01:30:29 +0000 Subject: [issue3999] Real segmentation fault handler In-Reply-To: <1222737012.4.0.203589723568.issue3999@psf.upfronthosting.co.za> Message-ID: <1230859829.11.0.0808557231401.issue3999@psf.upfronthosting.co.za> Antoine Pitrou added the comment: As mentioned in python-dev, the patch would be more suitable for inclusion if it was changed to simply print a stack trace and bail out, rather than try to resume execution of the Python program. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 02:31:58 2009 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Jan 2009 01:31:58 +0000 Subject: [issue4769] b64decode should accept strings or bytes In-Reply-To: <1230572153.22.0.954048343235.issue4769@psf.upfronthosting.co.za> Message-ID: <1230859918.89.0.470142978449.issue4769@psf.upfronthosting.co.za> STINNER Victor added the comment: About quoted printable, there are two implementations: - binascii.a2b_qp() (Modules/binascii.c): C implementation, use PyArg_ParseTupleAndKeywords(args, kwargs, "s*|i", ...) to parse the data - quopri.decode() (Lib/quopri.py): Python implementation => quopri.decodestring() uses io.BytesIO() to parse the data But quopri.decodestring() reuses binascii.a2b_qp() if the binascii module is present. So quopri.decodestring behaviour depends of the presence of binascii module... - binascii present: accept bytes or unicode - missing binascii: accept only bytes! binascii.a2b_qp() encodes unicode string to UTF-8 bytes string. ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 03:10:06 2009 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Jan 2009 02:10:06 +0000 Subject: [issue4769] b64decode should accept strings or bytes In-Reply-To: <1230572153.22.0.954048343235.issue4769@psf.upfronthosting.co.za> Message-ID: <1230862206.18.0.318761620064.issue4769@psf.upfronthosting.co.za> STINNER Victor added the comment: > If the input to b64decode is a str, just do a encode('ascii') > operation on it and proceed. If that fails, it wasn't valid > Base64 to begin with. On unicode encode error, should we raise an UnicodeEncodeError or a binascii.Error? And there is also the problem of base64.b64decode() alternate "characters". Should we accept non-ASCII alternate characters? base64.b64decode('01a\xfeb\xffcd', altchars=b'\xfe\xff') For the example, the result depends on the choosen charset: - ASCII (strict): encode input text raise an UnicodeDecodeError - ISO-8859-1 (ignore): works as expected - UTF-8 (strict): unexpected result The only valid choice is ASCII because ISO-8859-1 or UTF-8 will reintroduce bytes/character mixture. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 03:53:58 2009 From: report at bugs.python.org (Paolo 'Blaisorblade' Giarrusso) Date: Fri, 02 Jan 2009 02:53:58 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230325778.98.0.752974375077.issue4753@psf.upfronthosting.co.za> Message-ID: <1230864838.74.0.0710473304441.issue4753@psf.upfronthosting.co.za> Paolo 'Blaisorblade' Giarrusso added the comment: > I attached some additional benchmarks on SunOS. So far, it seems the benefits of the proposed optimization are highly compiler-dependent. Well, it would be more correct to say that as you verified for GCC 3.4, "miscompilation" of the code happens easily. Any literature research shows that threading in a fast interpreter does help. My experience shows two exceptions to this rule: a) bad compiler output b) interpreters which are not efficient enough - when other operations are even slower than instruction dispatch (which is really slow due to costly mispredictions), threading can't help. This is shown by the number of interpreters using threading. Wikipedia has more pointers on this: http://en.wikipedia.org/wiki/Threaded_code Note that what I called "indirect threading" is called there instead "token threading". Another example of the importance of threading is also shown in this article: http://webkit.org/blog/189/announcing-squirrelfish/ Some clues about why Python does not use threading: http://mail.python.org/pipermail/python-list/1999-May/002003.html It is important to note that people in that mail are not aware of why threading gives a speedup. == For SunCC, I can't say anything without looking at: a) the generated code; if jump targets were aligned only for switch but not for computed gotos, for instance, that could maybe explain such a slowdown. Lots of other details might be relevant. b) performance counters results, especially regarding mispredictions of indirect branches. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 03:57:06 2009 From: report at bugs.python.org (Manas) Date: Fri, 02 Jan 2009 02:57:06 +0000 Subject: [issue4803] Manas Thapliyal sent you a Friend Request on Yaari In-Reply-To: <94e386e8cd976bbe7d6eb5b217870508@localhost.localdomain> Message-ID: <94e386e8cd976bbe7d6eb5b217870508@localhost.localdomain> New submission from Manas : Manas Thapliyal wants you to join Yaari! Is Manas your friend? Yes, Manas is my friend! No, Manas isn't my friend. Please respond or Manas may think you said no :( Thanks, The Yaari Team ____ If you prefer not to receive this email tell us here. If you have any concerns regarding the content of this message, please email abuse at yaari.com. Yaari LLC, 358 Angier Ave, Atlanta, GA 30312 YaariNSF231MZA868MBK206SAQ399 ---------- files: unnamed messages: 78749 nosy: gravitywarrior1 severity: normal status: open title: Manas Thapliyal sent you a Friend Request on Yaari Added file: http://bugs.python.org/file12526/unnamed _______________________________________ Python tracker _______________________________________ -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: unnamed URL: From report at bugs.python.org Fri Jan 2 04:04:25 2009 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 02 Jan 2009 03:04:25 +0000 Subject: [issue4803] Manas Thapliyal sent you a Friend Request on Yaari In-Reply-To: <94e386e8cd976bbe7d6eb5b217870508@localhost.localdomain> Message-ID: <1230865465.33.0.249176608379.issue4803@psf.upfronthosting.co.za> Changes by Benjamin Peterson : ---------- resolution: -> invalid status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 04:49:48 2009 From: report at bugs.python.org (Senthil) Date: Fri, 02 Jan 2009 03:49:48 +0000 Subject: [issue1675455] Use getaddrinfo() in urllib2.py for IPv6 support Message-ID: <1230868188.52.0.491593071134.issue1675455@psf.upfronthosting.co.za> Senthil added the comment: Derek, This patch was along the lines that when IPv6 address is present, return the first address,which I assumed to be active address and would make the urllib2 work. I am not sure, if returning all the addresses would help and how would we define which address to use? AI_CANONNAME flag, I don't accurately remember it now. But I had encountered issues when testing on IPv-4 systems without it. I am having different opinion on this issue now. First is, taking from Facundo's comment on having this functionality in gethostbyname() and implementing it in C. Second is, the wrapper function and suitable way needs to be defined. I am sorry, I fail to understand the question on why ftp_open does hostname resolution. You mean to say without it, if we pass it to ftplib.FTP.connect() it would work for IPv6 address? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 04:58:16 2009 From: report at bugs.python.org (Mark Hammond) Date: Fri, 02 Jan 2009 03:58:16 +0000 Subject: [issue4566] 2.6.1 breaks many applications that embed Python on Windows In-Reply-To: <1228577334.37.0.676469955994.issue4566@psf.upfronthosting.co.za> Message-ID: <1230868696.0.0.344618949929.issue4566@psf.upfronthosting.co.za> Mark Hammond added the comment: I've no time to dig deeper now as I suspect testing will require removal of the vc9 assembly from the GAC and testing with a local one, but some comments: test.c's error is "can't find the DLL" - this will be as we attempt to load Python's DLL - but this isn't the same as the original error, which is "DLL init routine failed". To repro the initial error, I suspect you will want to put the full assembly next to test.exe - that will allow python.dll to load - then test.c should call PyExec_EvalString("import socket\n") - it is at *that* point the error we care about is likely to be thrown. That specific error code means the DLL init routine in the CRT started executing, but explicitly threw an error. Its possible to use the debugger to see exactly when this is thrown, and it relates to the assembly configuration (the details escape me). I suspect it will be necessary to locate this CRT init code to determine exactly why it is throwing the error, and possibly determine how to satisfy it (the DLL *is* loaded, so it should be capable of working) ---------- nosy: +mhammond _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 05:00:56 2009 From: report at bugs.python.org (Mark Hammond) Date: Fri, 02 Jan 2009 04:00:56 +0000 Subject: [issue4566] 2.6.1 breaks many applications that embed Python on Windows In-Reply-To: <1228577334.37.0.676469955994.issue4566@psf.upfronthosting.co.za> Message-ID: <1230868856.45.0.560728694899.issue4566@psf.upfronthosting.co.za> Mark Hammond added the comment: I meant to mention: FWIW, *some* py2exe apps work fine with the old scheme - specifically, IIUC, any app will work fine so long as the .pyd files were next to the executable, which is next to the assembly. I understand this is a significant restriction, but its worth mentioning for completeness. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 05:09:40 2009 From: report at bugs.python.org (Mark Hammond) Date: Fri, 02 Jan 2009 04:09:40 +0000 Subject: [issue4804] Python on Windows disables all C runtime library assertions In-Reply-To: <1230869380.06.0.720418986656.issue4804@psf.upfronthosting.co.za> Message-ID: <1230869380.06.0.720418986656.issue4804@psf.upfronthosting.co.za> New submission from Mark Hammond : This block in exceptions.c: #if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__) ... /* turn off assertions in debug mode */ prevCrtReportMode = _CrtSetReportMode(_CRT_ASSERT, 0); #endif Does exactly what the comment says it does - disables all assertions. It disables *all* CRT assertions in the process, which includes some very useful ones related to memory corruption, and all 'assert' and 'ASSERT' statements in all Python extension modules. The change was introduced in: """ r46894 | kristjan.jonsson | 2006-06-13 01:45:12 +1000 (Tue, 13 Jun 2006) | 2 lines Fix the CRT argument error handling for VisualStudio .NET 2005. Install a CRT error handler and disable the assertion for debug builds. This causes CRT to set errno to EINVAL. This update fixes crash cases in the test suite where the default CRT error handler would cause process exit. """ which seems like a very large hammer to be using (ie, the problem causing the assertions to blow should probably have been fixed). I'd like to remove these 2 lines. Any objections, or should I upload the trivial patch? ---------- components: Windows messages: 78753 nosy: krisvale, mhammond severity: normal status: open title: Python on Windows disables all C runtime library assertions type: behavior versions: Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 05:13:49 2009 From: report at bugs.python.org (Derek Morr) Date: Fri, 02 Jan 2009 04:13:49 +0000 Subject: [issue1675455] Use getaddrinfo() in urllib2.py for IPv6 support Message-ID: <1230869629.1.0.9760193206.issue1675455@psf.upfronthosting.co.za> Derek Morr added the comment: My understanding is that the FileHandler checks if the file:// URL contains the hostname or localhost IP of the local machine (isn't that what FileHandler.names is for?). So, shouldn't the following URLs all open the same file: file:///foo.txt file://localhost/foo.txt file://127.0.0.1/foo.txt file://[::1]/foo.txt If that is the case, then doesn't FileHandler.names need to have all of those values in it? I am a little confused by this though. It looks like FileHandler.file_open() checks if there is a hostname in the URL, and if so, uses FTPHandler instead. So why does FileHandler.open_local_file check the hostname value? For your other points, gethostbyname() in libc can only handle IPv4 addresses. The IETF defined the getaddrinfo() interface as an IP version neutral replacement. I would recommend using getaddrinfo(). Yes, FTPHandler creates an urllib.FTPWrapper object. That object calls into ftplib, which is already IPv6-capable. So, I don't think we need to do hostname resolution in FTPHandler. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 05:51:27 2009 From: report at bugs.python.org (Craig Holmquist) Date: Fri, 02 Jan 2009 04:51:27 +0000 Subject: [issue4566] 2.6.1 breaks many applications that embed Python on Windows In-Reply-To: <1228577334.37.0.676469955994.issue4566@psf.upfronthosting.co.za> Message-ID: <1230871887.45.0.34426692633.issue4566@psf.upfronthosting.co.za> Craig Holmquist added the comment: > test.c's error is "can't find the DLL" - this will be as we attempt to > load Python's DLL - but this isn't the same as the original error, which > is "DLL init routine failed". To repro the initial error, I suspect you > will want to put the full assembly next to test.exe - that will allow > python.dll to load - then test.c should call PyExec_EvalString("import > socket\n") - it is at *that* point the error we care about is likely to > be thrown. The test program isn't having a problem loading python26.dll - it gets to an interpreter prompt and it can execute simple Python statements. It doesn't throw ImportError until the user types in "import socket". Further, I can see in Process Explorer that python26.dll is loaded in the running testpy.exe process. I apologize if my initial description wasn't clear on that point. I do see the error codes are different (between testpy.c and mod_python), but both are triggered by trying to load _socket.pyd. Nonetheless: if I copy the CRT assembly into the same folder as testpy.exe, I get a popup dialog when I try to import socket, saying "Runtime Error!" and "R6034; An application has made an attempt to load the C library incorrectly.". When I click OK in that dialog, I get this error in the console running testpy.exe: ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed. (If the assembly is not in the folder, there is no popup dialog at all.) So it does indeed change the error code received. Also, I see now that I made a mistake in reporting the error code from the Apache log. The actual behavior is this: * Ordinary, the ImportError is: ImportError: DLL load failed: The specified module could not be found. * However, if I put the CRT assembly in the same folder as _socket.pyd: ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed. and I received the same popup dialog as above. Putting the CRT assembly in the Apache bin folder or Apache modules folder still gives the first error (module could not be found). I apologize for the confusion; when I first experienced this problem I tried to fix it by experimenting with putting the manifest in various folders and I wasn't paying close enough attention to what error was given when. To summarize: testpy.exe with CRT assembly in testpy.exe folder: init routine failed and popup. testpy.exe with CRT assembly in _socket.pyd folder: init routine failed and popup. testpy.exe otherwise: module could not be found Apache with CRT assembly in _socket.pyd folder: init routine failed and popup. Apache otherwise: module could not be found _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 05:56:47 2009 From: report at bugs.python.org (Alexander Belopolsky) Date: Fri, 02 Jan 2009 04:56:47 +0000 Subject: [issue4805] Make python code compilable with a C++ compiler In-Reply-To: <1230872206.73.0.47638283248.issue4805@psf.upfronthosting.co.za> Message-ID: <1230872206.73.0.47638283248.issue4805@psf.upfronthosting.co.za> New submission from Alexander Belopolsky : I am posting this patch mainly to support python-dev discussion on this topic. In the past (see r45330) it was possible to compile python core and standard library modules using a C++ compiler. According to Martin v. L?wis (issue4665), "It's not a requirement that the Python source code is compilable as C++. Only the header files should be thus compilable." However, I can see certain benefits from such requirement: 1. It is hard to verify that header files are compilable if source code is not. With compilable source code, CC=g++ ./configure; make will supply an adequate test that does not require anything beyond a standard distribution. 2. Arguably, C++ compliant code is more consistent and less error prone. For example, "new" is a really bad choice for a variable name regardless of being a C++ keyword, especially when used instead of prevailing "res" for a result of a function producing a PyObject. Even clearly redundant explicit casts of malloc return values arguably improve readability by reminding the type of the object that is being allocated. 3. Compiling with C++ may reveal actual coding errors that otherwise go unnoticed. For example, use of undefined PyLong_BASE_TWODIGITS_TYPE in Objects/longobject.c. 4. Stricter type checking may promote use of specific types instead of void* which in turn may help optimizing compilers. 5. Once achieved, C++ compilability is not that hard to maintain, but restoring it with patches like this one is hard because it requires review of changes to many unrelated files. ---------- files: c++-patch.diff keywords: patch messages: 78756 nosy: belopolsky severity: normal status: open title: Make python code compilable with a C++ compiler type: feature request versions: Python 2.6 Added file: http://bugs.python.org/file12527/c++-patch.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 06:05:39 2009 From: report at bugs.python.org (Christian Heimes) Date: Fri, 02 Jan 2009 05:05:39 +0000 Subject: [issue4566] 2.6.1 breaks many applications that embed Python on Windows In-Reply-To: <1230868696.0.0.344618949929.issue4566@psf.upfronthosting.co.za> Message-ID: <495DA09F.6020707@cheimes.de> Christian Heimes added the comment: > Mark Hammond added the comment: > > I've no time to dig deeper now as I suspect testing will require removal > of the vc9 assembly from the GAC and testing with a local one, but some > comments: Isn't the GAC just for .NET assemblies while the SxS cache is for non .NET assemblies? Microsoft's naming schema is confusing as usually. ;) Christian _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 06:12:51 2009 From: report at bugs.python.org (Jacques Frechet) Date: Fri, 02 Jan 2009 05:12:51 +0000 Subject: [issue4272] set timestamp in gzip stream In-Reply-To: <1226004430.06.0.832608065072.issue4272@psf.upfronthosting.co.za> Message-ID: <1230873171.32.0.210853875486.issue4272@psf.upfronthosting.co.za> Jacques Frechet added the comment: I am uploading a new patch, identical to the previous patch except that it does not contain the ill-advised third test case (test_literal_output). The patch still applies cleanly and the tests still pass. Added file: http://bugs.python.org/file12528/gzip-mtime-revised-py3k.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 06:13:52 2009 From: report at bugs.python.org (Jacques Frechet) Date: Fri, 02 Jan 2009 05:13:52 +0000 Subject: [issue4272] set timestamp in gzip stream In-Reply-To: <1226004430.06.0.832608065072.issue4272@psf.upfronthosting.co.za> Message-ID: <1230873232.39.0.0242507125414.issue4272@psf.upfronthosting.co.za> Changes by Jacques Frechet : Added file: http://bugs.python.org/file12529/gzip-mtime-revised-2.x.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 06:29:48 2009 From: report at bugs.python.org (Senthil) Date: Fri, 02 Jan 2009 05:29:48 +0000 Subject: [issue1675455] Use getaddrinfo() in urllib2.py for IPv6 support In-Reply-To: <1230869629.1.0.9760193206.issue1675455@psf.upfronthosting.co.za> Message-ID: <7c42eba10901012129qebc28dcsefa0cba09cec34c2@mail.gmail.com> Senthil added the comment: > I am a little confused by this though. It looks like > FileHandler.file_open() checks if there is a hostname in the URL, and > if so, uses FTPHandler instead. So why does FileHandler.open_local_file > check the hostname value? You are right. Even I had observed this, but did not dispute it. Let me try to look into the history to see why it so. Perhaps it needs to change. > For your other points, gethostbyname() in libc can only handle IPv4 > addresses. The IETF defined the getaddrinfo() interface as an IP > version neutral replacement. I would recommend using getaddrinfo(). > Yes, FTPHandler creates an urllib.FTPWrapper object. That object calls > into ftplib, which is already IPv6-capable. So, I don't think we need > to do hostname resolution in FTPHandler. Thanks for the info. I shall look into both in revision of the path. 1) using getaddrinfo() for IP version neutral call. 2) passing the hostname directly to ftplib. ( I am not sure of consequences, need to investigate). _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 07:15:45 2009 From: report at bugs.python.org (Christopher Mahan) Date: Fri, 02 Jan 2009 06:15:45 +0000 Subject: [issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0) In-Reply-To: <1230728461.13.0.270652897235.issue4791@psf.upfronthosting.co.za> Message-ID: <1230876945.06.0.00128078698057.issue4791@psf.upfronthosting.co.za> Christopher Mahan added the comment: I modified the program by adding line: ftp.set_debuglevel(2) START LISTING---------------- import ftplib ftp = ftplib.FTP('ftp.edgecastcdn.net', user='myuserid', passwd='mypassword') ftp.set_debuglevel(2) ftp.cwd('chrismahan-675') ftp.dir() #ftp.retrlines('LIST') ftp.close() END LISTING --------------- Running from idle 1.2.4 with python 2.5.4 gives this output: *cmd* 'CWD chrismahan-675' *put* 'CWD chrismahan-675\r\n' *get* '250 CWD command successful\r\n' *resp* '250 CWD command successful' *cmd* 'TYPE A' *put* 'TYPE A\r\n' *get* '200 Type set to A\r\n' *resp* '200 Type set to A' *cmd* 'PASV' *put* 'PASV\r\n' *get* '227 Entering Passive Mode (72,21,82,190,234,6).\r\n' *resp* '227 Entering Passive Mode (72,21,82,190,234,6).' *cmd* 'LIST' *put* 'LIST\r\n' *get* '150 Opening ASCII mode data connection for file list\r\n' *resp* '150 Opening ASCII mode data connection for file list' -rwxrwxrwx 1 nobody nogroup 3905538 Dec 29 09:51 Bronski Beat - Why.mp3 -rwxrwxrwx 1 nobody nogroup 873966 Dec 28 13:53 test9.avi -rwxrwxrwx 1 nobody nogroup 2512653 Dec 29 08:28 test9_lg.wmv -rwxrwxrwx 1 nobody nogroup 6549 Dec 29 08:28 test9_lg.wmv.jpg -rwxrwxrwx 1 nobody nogroup 1788466 Dec 29 03:04 test9_med.flv -rwxrwxrwx 1 nobody nogroup 6394 Dec 29 03:04 test9_med.flv.jpg -rwxrwxrwx 1 nobody nogroup 1263041 Dec 28 13:53 test9_sm.flv -rwxrwxrwx 1 nobody nogroup 6465 Dec 28 13:53 test9_sm.flv.jpg *get* '226 Transfer complete\r\n' *resp* '226 Transfer complete' Then running with idle 3.0 with python 3.0 gives the following result. *cmd* 'CWD chrismahan-675' *put* 'CWD chrismahan-675\r\n' *get* '250 CWD command successful\n' *resp* '250 CWD command successful' *cmd* 'TYPE A' *put* 'TYPE A\r\n' *get* '200 Type set to A\n' *resp* '200 Type set to A' *cmd* 'PASV' *put* 'PASV\r\n' *get* '227 Entering Passive Mode (72,21,82,190,148,178).\n' *resp* '227 Entering Passive Mode (72,21,82,190,148,178).' *cmd* 'LIST' *put* 'LIST\r\n' *get* '150 Opening ASCII mode data connection for file list\n' *resp* '150 Opening ASCII mode data connection for file list' -rwxrwxrwx 1 nobody nogroup 3905538 Dec 29 09:51 Bronski Beat - Why.mp3 -rwxrwxrwx 1 nobody nogroup 873966 Dec 28 13:53 test9.avi -rwxrwxrwx 1 nobody nogroup 2512653 Dec 29 08:28 test9_lg.wmv -rwxrwxrwx 1 nobody nogroup 6549 Dec 29 08:28 test9_lg.wmv.jpg -rwxrwxrwx 1 nobody nogroup 1788466 Dec 29 03:04 test9_med.flv -rwxrwxrwx 1 nobody nogroup 6394 Dec 29 03:04 test9_med.flv.jpg -rwxrwxrwx 1 nobody nogroup 1263041 Dec 28 13:53 test9_sm.flv -rwxrwxrwx 1 nobody nogroup 6465 Dec 28 13:53 test9_sm.flv.jpg Note that the last two lines are missing. >From a command prompt: C:\>c:\python30\python.exe c:\python_scripts\python3\candee_processor.py *cmd* 'CWD chrismahan-675' *put* 'CWD chrismahan-675\r\n' *get* '250 CWD command successful\n' *resp* '250 CWD command successful' *cmd* 'TYPE A' *put* 'TYPE A\r\n' *get* '200 Type set to A\n' *resp* '200 Type set to A' *cmd* 'PASV' *put* 'PASV\r\n' *get* '227 Entering Passive Mode (72,21,82,190,219,8).\n' *resp* '227 Entering Passive Mode (72,21,82,190,219,8).' *cmd* 'LIST' *put* 'LIST\r\n' *get* '150 Opening ASCII mode data connection for file list\n' *resp* '150 Opening ASCII mode data connection for file list' -rwxrwxrwx 1 nobody nogroup 3905538 Dec 29 09:51 Bronski Beat - Why.mp3 -rwxrwxrwx 1 nobody nogroup 873966 Dec 28 13:53 test9.avi -rwxrwxrwx 1 nobody nogroup 2512653 Dec 29 08:28 test9_lg.wmv -rwxrwxrwx 1 nobody nogroup 6549 Dec 29 08:28 test9_lg.wmv.jpg -rwxrwxrwx 1 nobody nogroup 1788466 Dec 29 03:04 test9_med.flv -rwxrwxrwx 1 nobody nogroup 6394 Dec 29 03:04 test9_med.flv.jpg -rwxrwxrwx 1 nobody nogroup 1263041 Dec 28 13:53 test9_sm.flv -rwxrwxrwx 1 nobody nogroup 6465 Dec 28 13:53 test9_sm.flv.jpg same command prompt but with python 2.5: C:\>c:\python25\python.exe c:\python_scripts\python3\candee_processor.py *cmd* 'CWD chrismahan-675' *put* 'CWD chrismahan-675\r\n' *get* '250 CWD command successful\r\n' *resp* '250 CWD command successful' *cmd* 'TYPE A' *put* 'TYPE A\r\n' *get* '200 Type set to A\r\n' *resp* '200 Type set to A' *cmd* 'PASV' *put* 'PASV\r\n' *get* '227 Entering Passive Mode (72,21,82,190,147,65).\r\n' *resp* '227 Entering Passive Mode (72,21,82,190,147,65).' *cmd* 'LIST' *put* 'LIST\r\n' *get* '150 Opening ASCII mode data connection for file list\r\n' *resp* '150 Opening ASCII mode data connection for file list' -rwxrwxrwx 1 nobody nogroup 3905538 Dec 29 09:51 Bronski Beat - Why.mp3 -rwxrwxrwx 1 nobody nogroup 873966 Dec 28 13:53 test9.avi -rwxrwxrwx 1 nobody nogroup 2512653 Dec 29 08:28 test9_lg.wmv -rwxrwxrwx 1 nobody nogroup 6549 Dec 29 08:28 test9_lg.wmv.jpg -rwxrwxrwx 1 nobody nogroup 1788466 Dec 29 03:04 test9_med.flv -rwxrwxrwx 1 nobody nogroup 6394 Dec 29 03:04 test9_med.flv.jpg -rwxrwxrwx 1 nobody nogroup 1263041 Dec 28 13:53 test9_sm.flv -rwxrwxrwx 1 nobody nogroup 6465 Dec 28 13:53 test9_sm.flv.jpg *get* '226 Transfer complete\r\n' *resp* '226 Transfer complete' C:\> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 07:35:14 2009 From: report at bugs.python.org (Christopher Mahan) Date: Fri, 02 Jan 2009 06:35:14 +0000 Subject: [issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0) In-Reply-To: <1230728461.13.0.270652897235.issue4791@psf.upfronthosting.co.za> Message-ID: <1230878114.9.0.0123296844222.issue4791@psf.upfronthosting.co.za> Christopher Mahan added the comment: I went into the source for Libs/ftplib.py and I noted that line 423 is: if self.debugging > 2: print('*retr*', repr(line)) so I changed the debuglevel to 3, as such: ftp.set_debuglevel(3) and I got these last 4 lines: -rwxrwxrwx 1 nobody nogroup 6465 Dec 28 13:53 test9_sm.flv.jpg *retr* '' *get* '226 Transfer complete\r\n' *resp* '226 Transfer complete' First line, the last line of the listing. second line, the debug, showing the last line read third and fourth lines: the program actually completed and didn't hang! still digging _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 07:37:33 2009 From: report at bugs.python.org (Craig Holmquist) Date: Fri, 02 Jan 2009 06:37:33 +0000 Subject: [issue4566] 2.6.1 breaks many applications that embed Python on Windows In-Reply-To: <1228577334.37.0.676469955994.issue4566@psf.upfronthosting.co.za> Message-ID: <1230878253.66.0.0124780593753.issue4566@psf.upfronthosting.co.za> Craig Holmquist added the comment: I took a look at this with the debugger, as Mark recommended. The CRT's DLLMain is called _CRTDLL_INIT, that in turn calls __CRTDLL_INIT. __CRTDLL_INIT calls another function, _check_manifest. _check_manifest calls an SxS function called FindActCtxSectionString. It's looking for a string called "msvcr90.dll" in the ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION section of the process's activation context (activation contexts are data structures used by SxS). That call fails (_check_manifest doesn't call GetLastError or anything, it just returns FALSE right there). There's a comment there that says: /* no activation context used to load CRT DLL, means no manifest present in the process */ What's bizarre is that python26.dll successfully loaded msvcr90.dll (the global one from WinSxS), so it must have passed _check_manifest. It seems like the activation context consists of the DLL's manifest (_socket.pyd's in this case) and the exe's manifest, but no other ones, regardless of what other libraries have been loaded. The documentation doesn't seem to explain the interaction between manifests in different modules. It's also annoying that this restriction (the _check_manifest call) is completely artificial. I don't know if any of this information is useful (I'm only superficially familiar with activation contexts and the functions to manipulate them). The code is all in crtlib.c (in the CRT source) if someone else wants to take a look. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 07:50:18 2009 From: report at bugs.python.org (Christopher Mahan) Date: Fri, 02 Jan 2009 06:50:18 +0000 Subject: [issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0) In-Reply-To: <1230728461.13.0.270652897235.issue4791@psf.upfronthosting.co.za> Message-ID: <1230879018.47.0.43911067427.issue4791@psf.upfronthosting.co.za> Christopher Mahan added the comment: I added the following two lines and I was able to run the code. Before: line = fp.readline() if self.debugging > 2: print('*retr*', repr(line)) if not line: break if line[-2:] == CRLF: line = line[:-2] elif line[-1:] == '\n': line = line[:-1] callback(line) After: line = fp.readline() if self.debugging > 2: print('*retr*', repr(line)) if not line: break if line == '': break if line[-2:] == CRLF: line = line[:-2] elif line[-1:] == '\n': line = line[:-1] callback(line) As a patch: 426,427d425 < if line == '': < break What else do I need to do? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 08:30:46 2009 From: report at bugs.python.org (Alexander Belopolsky) Date: Fri, 02 Jan 2009 07:30:46 +0000 Subject: [issue4805] Make python code compilable with a C++ compiler In-Reply-To: <1230872206.73.0.47638283248.issue4805@psf.upfronthosting.co.za> Message-ID: <1230881446.85.0.664120268563.issue4805@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: A related question discussed on python-dev is whether extern "C" {} wrappers should ever be used in .c files. I argue that the answer is "no" even if C++ compilability is desired. The new patch eliminates several uses of extern "C" {} in .c files while preserving C++ compilability. This is achieved by including proper header files instead of declaring external functions in .c files and in some cases adding declarations of functions that are used outside of the files they are defined in in the appropriate header files. Added file: http://bugs.python.org/file12530/c++-patch-1.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 10:15:32 2009 From: report at bugs.python.org (Mark Hammond) Date: Fri, 02 Jan 2009 09:15:32 +0000 Subject: [issue4566] 2.6.1 breaks many applications that embed Python on Windows In-Reply-To: <1228577334.37.0.676469955994.issue4566@psf.upfronthosting.co.za> Message-ID: <1230887732.44.0.476933589746.issue4566@psf.upfronthosting.co.za> Mark Hammond added the comment: I've hacked together something that fixes the problem. I'm working on making it a real patch, but the basis is: * In DllMain (dl_nt.c), we call: case DLL_PROCESS_ATTACH: GetCurrentActCtx(&PyWin_DLLhActivationContext); AddRefActCtx(PyWin_DLLhActivationContext); case DLL_PROCESS_DETACH: ReleaseActCtx(PyWin_DLLhActivationContext); (where PyWin_DLLhActivationContext is a module level HANDLE global) * The LoadLibraryEx (in dynload_win.c) changes to: ActivateActCtx(PyWin_DLLhActivationContext, &cookie); /* XXX This call doesn't exist in Windows CE */ hDLL = LoadLibraryEx(... as currently ...); DeactivateActCtx(0, cookie); This makes the "import socket" test case work for me. I'm not sure what the impact will be should the .pyd file reference other assemblies. Also, the calls above all need to move to function pointer calls as the functions only exist on Vista and later (hence the slight delay in making a real patch) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 10:17:10 2009 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Fri, 02 Jan 2009 09:17:10 +0000 Subject: [issue4804] Python on Windows disables all C runtime library assertions In-Reply-To: <1230869380.06.0.720418986656.issue4804@psf.upfronthosting.co.za> Message-ID: <1230887830.55.0.601904720526.issue4804@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: But then you get a nasty pop-up window on code like this: >>> fd = os.open("foo", 0) >>> os.close(fd) >>> os.close(fd) Instead of a gentle "OSError: [Errno 9] Bad file descriptor" ---------- nosy: +amaury.forgeotdarc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 10:45:18 2009 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Fri, 02 Jan 2009 09:45:18 +0000 Subject: [issue4804] Python on Windows disables all C runtime library assertions In-Reply-To: <1230887830.55.0.601904720526.issue4804@psf.upfronthosting.co.za> Message-ID: <930F189C8A437347B80DF2C156F7EC7F04D1702FD6@exchis.ccp.ad.local> Kristj?n Valur J?nsson added the comment: Yes, this is the biggest reason why this is required. This, and and os.closerange(). I have browsed the CRT source and I find no way to determine if a fd is actually valid, before calling any of the functions that check for it. Reintroducing the assertion will prevent a debug build python from passing the testsuite. Much as I think this is useful (turning on the crt tests helped me find a couple of python bugs recently) it unfortunately needs to be off because of os.close(). All other troublesome cases (strftime(), open()) have workarounds. Kristj?n _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 10:56:19 2009 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Fri, 02 Jan 2009 09:56:19 +0000 Subject: [issue4804] Python on Windows disables all C runtime library assertions In-Reply-To: <1230887830.55.0.601904720526.issue4804@psf.upfronthosting.co.za> Message-ID: <930F189C8A437347B80DF2C156F7EC7F04D1702FD7@exchis.ccp.ad.local> Kristj?n Valur J?nsson added the comment: Btw, It occurred to me that a more gentle way to do this is to disable the functionality only around close(). This is far less intrusive, for example, in an embedded environment. I must confess that I had completely forgototten about the disabling of the assertion and only stumbled on this recently when I was trying to find out why none of my _ASSERTS in eve worked! Making wholesale CRT settings certainly should be avoided. So, as I said, we could very well avoid this by just wrapping a few instances of close() with a CrtSetErrorHandler calls and friends. With the caveat that these are not threadsafe, that is, it is a process global setting for the CRT. But toggling it during a limited scope surely is less intrusive than modifying it for the entire process permanently. Kristj?n _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 11:24:36 2009 From: report at bugs.python.org (Mark Hammond) Date: Fri, 02 Jan 2009 10:24:36 +0000 Subject: [issue4804] Python on Windows disables all C runtime library assertions In-Reply-To: <1230869380.06.0.720418986656.issue4804@psf.upfronthosting.co.za> Message-ID: <1230891876.78.0.451486550762.issue4804@psf.upfronthosting.co.za> Mark Hammond added the comment: It would be interesting to know which tests actually fail. If the tests are explicitly checking a bad fd, then IMO it makes more sense for that test to simply be avoided in debug builds and nothing of value would be left untested. OTOH, I'd also be happy with just disabling them around the 2 functions known to cause issues - anything other than leaving assertions globally disabled for the process! _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 11:30:17 2009 From: report at bugs.python.org (Mark Hammond) Date: Fri, 02 Jan 2009 10:30:17 +0000 Subject: [issue4804] Python on Windows disables all C runtime library assertions In-Reply-To: <1230869380.06.0.720418986656.issue4804@psf.upfronthosting.co.za> Message-ID: <1230892217.97.0.646619281001.issue4804@psf.upfronthosting.co.za> Mark Hammond added the comment: I guess another option is to expose it via msvcrt and let the test themselves disable it? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 11:33:46 2009 From: report at bugs.python.org (ebfe) Date: Fri, 02 Jan 2009 10:33:46 +0000 Subject: [issue4738] Patch to make zlib-objects better support threads In-Reply-To: <1230136171.32.0.121363130694.issue4738@psf.upfronthosting.co.za> Message-ID: <1230892426.77.0.787032202647.issue4738@psf.upfronthosting.co.za> Changes by ebfe : Removed file: http://bugs.python.org/file12466/zlib_threads-2.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 11:38:18 2009 From: report at bugs.python.org (ebfe) Date: Fri, 02 Jan 2009 10:38:18 +0000 Subject: [issue4738] Patch to make zlib-objects better support threads In-Reply-To: <1230136171.32.0.121363130694.issue4738@psf.upfronthosting.co.za> Message-ID: <1230892698.23.0.334663129664.issue4738@psf.upfronthosting.co.za> ebfe added the comment: Here is a small test-script with concurrent access to a single compressosbj. The original patch will immediately deadlock. The patch attached releases the GIL before trying to get the zlib-lock. This allows the other thread to release the zlib-lock but comes at the cost of one additional GIL lock/unlock. Added file: http://bugs.python.org/file12531/zlib_threads-3.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 11:39:36 2009 From: report at bugs.python.org (ebfe) Date: Fri, 02 Jan 2009 10:39:36 +0000 Subject: [issue4738] Patch to make zlib-objects better support threads In-Reply-To: <1230136171.32.0.121363130694.issue4738@psf.upfronthosting.co.za> Message-ID: <1230892776.86.0.395321460996.issue4738@psf.upfronthosting.co.za> ebfe added the comment: test-script Added file: http://bugs.python.org/file12532/zlibtest2.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 11:45:01 2009 From: report at bugs.python.org (ebfe) Date: Fri, 02 Jan 2009 10:45:01 +0000 Subject: [issue4751] Patch for better thread support in hashlib In-Reply-To: <1230298756.92.0.632482701363.issue4751@psf.upfronthosting.co.za> Message-ID: <1230893101.08.0.0996947539189.issue4751@psf.upfronthosting.co.za> ebfe added the comment: Releasing the GIL is somewhat expensive and should be avoided if possible. I've moved LEAVE_HASHLIB in EVP_update so the object gets unlocked before we call Py_END_ALLOW_THREADS. This is *only* possible because EVP_update does not use the object beyond those lines. Here is a new patch and a small test-script. Added file: http://bugs.python.org/file12533/hashopenssl_threads-4.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 11:45:18 2009 From: report at bugs.python.org (ebfe) Date: Fri, 02 Jan 2009 10:45:18 +0000 Subject: [issue4751] Patch for better thread support in hashlib In-Reply-To: <1230298756.92.0.632482701363.issue4751@psf.upfronthosting.co.za> Message-ID: <1230893118.37.0.467253221012.issue4751@psf.upfronthosting.co.za> ebfe added the comment: test-script Added file: http://bugs.python.org/file12534/hashlibtest2.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 11:45:22 2009 From: report at bugs.python.org (ebfe) Date: Fri, 02 Jan 2009 10:45:22 +0000 Subject: [issue4751] Patch for better thread support in hashlib In-Reply-To: <1230298756.92.0.632482701363.issue4751@psf.upfronthosting.co.za> Message-ID: <1230893122.49.0.27863521203.issue4751@psf.upfronthosting.co.za> Changes by ebfe : Removed file: http://bugs.python.org/file12461/hashopenssl_threads-3.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 11:46:35 2009 From: report at bugs.python.org (ebfe) Date: Fri, 02 Jan 2009 10:46:35 +0000 Subject: [issue4751] Patch for better thread support in hashlib In-Reply-To: <1230298756.92.0.632482701363.issue4751@psf.upfronthosting.co.za> Message-ID: <1230893195.93.0.287757721788.issue4751@psf.upfronthosting.co.za> ebfe added the comment: gnarf, actually it should be 'threads.append(Hasher(md))' in the script :-\ _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 11:48:13 2009 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 02 Jan 2009 10:48:13 +0000 Subject: [issue4472] Is shared lib building broken on trunk for Mac OS X? In-Reply-To: <18738.49496.996446.483821@montanaro-dyndns-org.local> Message-ID: <1230893293.23.0.466289178047.issue4472@psf.upfronthosting.co.za> Ronald Oussoren added the comment: LDLIBRARY is indeed a good variable to use. I've applied issue447-v2.patch in r68146. Backported to 2.6.x in r68147. Added file: http://bugs.python.org/file12535/issue4472-v2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 11:48:46 2009 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 02 Jan 2009 10:48:46 +0000 Subject: [issue4472] Is shared lib building broken on trunk for Mac OS X? In-Reply-To: <18738.49496.996446.483821@montanaro-dyndns-org.local> Message-ID: <1230893326.12.0.365438824453.issue4472@psf.upfronthosting.co.za> Changes by Ronald Oussoren : ---------- resolution: accepted -> fixed status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 11:51:15 2009 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 02 Jan 2009 10:51:15 +0000 Subject: [issue4780] Makefile.pre.in patch to run regen on OSX (framework build) In-Reply-To: <1230642378.46.0.486113805886.issue4780@psf.upfronthosting.co.za> Message-ID: <1230893475.9.0.996487051216.issue4780@psf.upfronthosting.co.za> Ronald Oussoren added the comment: I've ported the fix to the trunk in r68149 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 11:56:57 2009 From: report at bugs.python.org (Mark Hammond) Date: Fri, 02 Jan 2009 10:56:57 +0000 Subject: [issue4566] 2.6.1 breaks many applications that embed Python on Windows In-Reply-To: <1228577334.37.0.676469955994.issue4566@psf.upfronthosting.co.za> Message-ID: <1230893817.75.0.734219589539.issue4566@psf.upfronthosting.co.za> Mark Hammond added the comment: Attaching a patch which works for me against python 2.6. Only ever tested on Vista (ie, where the function pointers etc all load) ---------- keywords: +needs review, patch Added file: http://bugs.python.org/file12536/bug4566.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 12:06:03 2009 From: report at bugs.python.org (Mark Hammond) Date: Fri, 02 Jan 2009 11:06:03 +0000 Subject: [issue4566] 2.6.1 breaks many applications that embed Python on Windows In-Reply-To: <1228577334.37.0.676469955994.issue4566@psf.upfronthosting.co.za> Message-ID: <1230894363.28.0.614091438953.issue4566@psf.upfronthosting.co.za> Changes by Mark Hammond : Removed file: http://bugs.python.org/file12536/bug4566.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 12:10:53 2009 From: report at bugs.python.org (Mark Hammond) Date: Fri, 02 Jan 2009 11:10:53 +0000 Subject: [issue4566] 2.6.1 breaks many applications that embed Python on Windows In-Reply-To: <1228577334.37.0.676469955994.issue4566@psf.upfronthosting.co.za> Message-ID: <1230894653.46.0.461657848617.issue4566@psf.upfronthosting.co.za> Mark Hammond added the comment: Attaching a new patch with some typos in the comments corrected. While I'm here, I also meant to mention (again!): * No need to remove the the assembly from the sxs cache - the test "fails correctly" with VS2009 installed. FWIW, I compiled test.c from the command line with: % cl /I {pypath}\include /I {pypath}\PC /DDEBUG /D_DEBUG /MTd test.c /LINK {pypath}\pcbuild\python26_d.lib * It appears the sxscache and the "gac" are indeed different things, although at least one MS page refers to the sxscache as the "native assembly cache" Added file: http://bugs.python.org/file12537/bug4566.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 12:24:55 2009 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Fri, 02 Jan 2009 11:24:55 +0000 Subject: [issue4804] Python on Windows disables all C runtime library assertions In-Reply-To: <1230891876.78.0.451486550762.issue4804@psf.upfronthosting.co.za> Message-ID: <930F189C8A437347B80DF2C156F7EC7F04D1702FEE@exchis.ccp.ad.local> Kristj?n Valur J?nsson added the comment: Ok, I'll prepare a patch to the trunk. I've had some experience with this and should have the code lying around somewhere. I'll let you know once I?ve created an issue. K _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 12:31:38 2009 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 02 Jan 2009 11:31:38 +0000 Subject: [issue4796] Decimal to receive from_float method In-Reply-To: <1230764359.55.0.955763939043.issue4796@psf.upfronthosting.co.za> Message-ID: <1230895898.96.0.199448932616.issue4796@psf.upfronthosting.co.za> Mark Dickinson added the comment: > Accordingly, I recommend Decimal.from_float(f) with no qualifiers or > optional arguments. I agree with this. Since lossless conversion is feasible, this seems the obvious way to go. It's lucky that the exponent range for (binary) floats is relatively small, though: for IEEE 754 floats the worst case conversions (e.g., (2**53-1)/2**1074) produce Decimals with something like 767 significant digits, which is still plenty small enough not to cause difficulties. The recipe in the docs is not industrial strength: it doesn't handle infinities, nans and negative zero. I think there's a place for a from_float method that handles these special cases correctly---or at least as correctly as reasonable: +-infinity should convert to +- infinity, nans to (quiet) nans. I don't think it's worth worrying about preserving the sign or payload of a binary nan: just convert all float nans to Decimal('NaN'). I do however think it's worth trying to preserve the sign of negative zero. Note: I'm not suggesting changing the *documentation* at all---the recipe there is fine as it is, IMO, but I think an official version should include these corner cases. ---------- nosy: +marketdickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 12:40:02 2009 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 02 Jan 2009 11:40:02 +0000 Subject: [issue3055] test_list on 64-bit platforms In-Reply-To: <1212788254.95.0.00817873629987.issue3055@psf.upfronthosting.co.za> Message-ID: <1230896402.7.0.879844477247.issue3055@psf.upfronthosting.co.za> Ronald Oussoren added the comment: I can confirm that this issue is fixed. ---------- resolution: works for me -> fixed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 12:43:18 2009 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 02 Jan 2009 11:43:18 +0000 Subject: [issue4165] Failure building 64-bit Python on Leopard In-Reply-To: <1224621107.94.0.119625965208.issue4165@psf.upfronthosting.co.za> Message-ID: <1230896598.66.0.692387848081.issue4165@psf.upfronthosting.co.za> Ronald Oussoren added the comment: I located the problem, it's in the configure line: ./configure --with-framework-name=Python64 -- with-universal-archs=all --enable-framework --enable- universalsdk=MACOSX_DEPLOYMENT_TARGET=10.5 That's wrong because the argument for --enable-universalsdk should be a filesystem path for the SDK. In this case the following command-line will work: ./configure --with-framework-name=Python64 -- with-universal-archs=all --enable-framework --enable- universalsdk=/ ---------- resolution: -> works for me status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 12:48:37 2009 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 02 Jan 2009 11:48:37 +0000 Subject: [issue4796] Decimal to receive from_float method In-Reply-To: <1230764359.55.0.955763939043.issue4796@psf.upfronthosting.co.za> Message-ID: <1230896917.76.0.887409781686.issue4796@psf.upfronthosting.co.za> Mark Dickinson added the comment: One also has to worry about the exponent of the converted result: e.g., should Decimal.from_float(10.0) produce Decimal('1E1') or Decimal('10')? The latter looks nicer, to me. IEEE 754 isn't much help here: as far as I can tell it says nothing about binary <-> decimal conversions. I see two reasonable strategies: (1) always use the largest exponent possible (so we'd get Decimal('1E1') above), or (2) when the quantity converted is an exact integer, use an exponent of zero; otherwise fall back to (1). Option (2) is pretty much what the recipe in the docs does already, I think: it computes a quotient of two Decimals, each having exponent zero, so the preferred exponent of the result is also zero. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 12:49:58 2009 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 02 Jan 2009 11:49:58 +0000 Subject: [issue3433] Mac, 3.0 framework install error with fink cp In-Reply-To: <1216867410.47.0.735334999055.issue3433@psf.upfronthosting.co.za> Message-ID: <1230896998.86.0.646301445656.issue3433@psf.upfronthosting.co.za> Ronald Oussoren added the comment: Fixed in r68150 (python-trunk), r68151 (python 2.6.x), r68152 (python 3.x). Could someone that actually has Fink installed confirm that the issue is actually fixed? My patch consists of changing 'cp' to '/bin/cp' to ensure that the system copy of that command is used. ---------- resolution: -> fixed status: open -> pending title: libtk -> Mac, 3.0 framework install error with fink cp _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 12:51:35 2009 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 02 Jan 2009 11:51:35 +0000 Subject: [issue2754] Mac version of IDLE doesn't scroll as expected In-Reply-To: <1209903976.71.0.763172048838.issue2754@psf.upfronthosting.co.za> Message-ID: <1230897095.17.0.528457924007.issue2754@psf.upfronthosting.co.za> Ronald Oussoren added the comment: This is almost certainly a Tk issue and hence not something we can fix. I'm not closing the bug though because I no too little of Tk to be sure. ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 13:22:51 2009 From: report at bugs.python.org (Dmitry Vasiliev) Date: Fri, 02 Jan 2009 12:22:51 +0000 Subject: [issue4718] wsgiref package totally broken In-Reply-To: <1230852036.91.0.153383854132.issue4718@psf.upfronthosting.co.za> Message-ID: <495E0717.9070402@hlabs.spb.ru> Dmitry Vasiliev added the comment: Graham Dumpleton wrote: > Thus have odd situation where with Python 3.0, one could technically return > str as iterable, with rule that would apply would be that each str returned > would then be converted to bytes by way of latin-1 conversion, but for > bytes returned as iterable, should fail. > > Not sure how this plays out in wsgiref server yet as haven't looked. If application return bytes instead of an iterable AssertionError will be raised in handlers.BaseHandler.write(). _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 13:46:04 2009 From: report at bugs.python.org (=?utf-8?q?Hagen_F=C3=BCrstenau?=) Date: Fri, 02 Jan 2009 12:46:04 +0000 Subject: [issue4806] Function calls taking a generator as star argument can mask TypeErrors in the generator In-Reply-To: <1230900364.95.0.0532833034138.issue4806@psf.upfronthosting.co.za> Message-ID: <1230900364.95.0.0532833034138.issue4806@psf.upfronthosting.co.za> New submission from Hagen F?rstenau : If we call some function f with a generator as star argument and this generator raises a TypeError, we get the following exception: >>> def f(x): pass ... >>> def broken(): raise TypeError ... >>> f(*(broken() for x in (0,))) Traceback (most recent call last): File "", line 1, in TypeError: f() argument after * must be a sequence, not generator This is a misleading error message, as it's usually no problem to use a generator as a star argument. Even just replacing the TypeError by some other exception leads to the expected result, i.e. the exception gets correctly propagated. The problem seems to be around line 3710 of Python/ceval.c where the generator is converted to a tuple. If this conversion raises a TypeError, then the error message is replaced, which will mask any TypeError raised by the generator. I'm not sure how to solve this. We probably can't distinguish a "good" TypeError from a "bad" TypeError at this point, so we might have to make a special case for the conversion of generators. ---------- components: Interpreter Core messages: 78788 nosy: hagen severity: normal status: open title: Function calls taking a generator as star argument can mask TypeErrors in the generator type: behavior versions: Python 2.6, Python 3.0 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 14:05:36 2009 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 02 Jan 2009 13:05:36 +0000 Subject: [issue4796] Decimal to receive from_float method In-Reply-To: <1230764359.55.0.955763939043.issue4796@psf.upfronthosting.co.za> Message-ID: <1230901536.27.0.461506578557.issue4796@psf.upfronthosting.co.za> Steven D'Aprano added the comment: Mark suggested the following strategy for Decimal.from_float: "always use the largest exponent possible". Just for the avoidance of all doubt, do you mean the largest exponent with the number normalised to one digit to the right of the decimal place? Because 1e1 = 0.1e2 = 0.01e3 = ... and there is no "largest exponent possible" if you allow unnormalised numbers. Seems obvious to me, but maybe I'm missing something. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 14:08:03 2009 From: report at bugs.python.org (Ulrich Eckhardt) Date: Fri, 02 Jan 2009 13:08:03 +0000 Subject: [issue4807] wrong wsprintf usage In-Reply-To: <1230901683.42.0.873273528074.issue4807@psf.upfronthosting.co.za> Message-ID: <1230901683.42.0.873273528074.issue4807@psf.upfronthosting.co.za> New submission from Ulrich Eckhardt : Note up front: there is a win32 function wsprintf() and an ISO C function swprintf(), these are different things in case you wonder. In _winreg.c, there are two functions that use wsprintf on a char buffer, while the function takes a TCHAR buffer instead. This leads to compile warning and runtime errors when _UNICODE is defined, like e.g. under MS Windows CE. The attached patch replaces the two calls to that function with calls to fprintf() and PyString_FromFormat(). ---------- components: Windows files: python-2.7-no-wsprint.0.patch keywords: patch messages: 78790 nosy: eckhardt severity: normal status: open title: wrong wsprintf usage type: compile error versions: Python 2.7 Added file: http://bugs.python.org/file12538/python-2.7-no-wsprint.0.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 14:11:15 2009 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 02 Jan 2009 13:11:15 +0000 Subject: [issue3549] Missing IDLE Preferences on Mac In-Reply-To: <1218662954.17.0.753425221317.issue3549@psf.upfronthosting.co.za> Message-ID: <1230901875.22.0.67756354283.issue3549@psf.upfronthosting.co.za> Ronald Oussoren added the comment: The lack of a preferences menu is a bug: the current revisions of python contain some code to detect a recent version of Tcl/Tk, used to create the Preferences... menu in different way. Sadly enough this code is buggy, the end result is that you will not have a IDLE->Preferences...' menu when using the system version of Tcl/Tk. Fixed in r68153 (python-trunk), r68154 (python-2.6), r68155 (python-3.1) ---------- nosy: +ronaldoussoren resolution: -> fixed status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 14:14:22 2009 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 02 Jan 2009 13:14:22 +0000 Subject: [issue789545] zappyfiles.py absent from MacPython binary Message-ID: <1230902062.35.0.859546851181.issue789545@psf.upfronthosting.co.za> Ronald Oussoren added the comment: Closing because zappyfiles.py is no longer part of the python distribution ---------- nosy: +ronaldoussoren resolution: -> wont fix status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 14:18:09 2009 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 02 Jan 2009 13:18:09 +0000 Subject: [issue4796] Decimal to receive from_float method In-Reply-To: <1230764359.55.0.955763939043.issue4796@psf.upfronthosting.co.za> Message-ID: <1230902289.3.0.400550805188.issue4796@psf.upfronthosting.co.za> Steven D'Aprano added the comment: Raymond: > Accordingly, I recommend Decimal.from_float(f) with no > qualifiers or optional arguments. -0 on this one. It's going to confuse an awful lot of newbies when they write Decimal.from_float(1.1) and get Decimal('110000000000000008881784197001252...e-51'). Also, why not just extend the Decimal() constructor to accept a float as the argument? Why have a separate from_float() method at all? > To support the use case of wanting to round the input, I > suggest a separate method modeled on Context.create_decimal(). +1 on this. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 14:21:23 2009 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 02 Jan 2009 13:21:23 +0000 Subject: [issue1602133] non-framework built python fails to define environ properly Message-ID: <1230902483.81.0.835191882101.issue1602133@psf.upfronthosting.co.za> Ronald Oussoren added the comment: I won't commit this patch because I cannot reproduce the problem. The python trunk works fine for my in these build configurations: unix- build (static library), unix-build (shared library), framework build. All of this on OSX 10.5. Can you please provide more information on how to reproduce the problem (os releases, which version of python, how to build, what should I do to get the segfault you mention)? ---------- resolution: -> works for me status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 14:37:08 2009 From: report at bugs.python.org (Ulrich Eckhardt) Date: Fri, 02 Jan 2009 13:37:08 +0000 Subject: [issue4681] mmap offset should be off_t instead of ssize_t, and size calculation needs corrected In-Reply-To: <1229503209.88.0.900633557014.issue4681@psf.upfronthosting.co.za> Message-ID: <1230903428.84.0.0869831309386.issue4681@psf.upfronthosting.co.za> Changes by Ulrich Eckhardt : ---------- nosy: +eckhardt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 15:03:38 2009 From: report at bugs.python.org (Ulrich Eckhardt) Date: Fri, 02 Jan 2009 14:03:38 +0000 Subject: [issue1699259] replacing char* with const char* in sysmodule.c/.h Message-ID: <1230905018.89.0.89434507226.issue1699259@psf.upfronthosting.co.za> Ulrich Eckhardt added the comment: Concerning the SetArgv( int, char**), that one will have to be changed to a SetArgv( int, char const* const*), i.e. applying the const on both levels. Otherwise, there is no implicit conversion between the two. The reason is a bit complicated: if the function stored a pointer-to-const in the array, it would become a pointer-to-nonconst outside. Only if modification of the array is forbidden, changing the element type to pointer-to-const is allowed. Otherwise, I'm +1 on this kind of changes, because it makes immediately obvious which functions modify a passed buffer and which don't. ---------- nosy: +eckhardt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 15:09:36 2009 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 02 Jan 2009 14:09:36 +0000 Subject: [issue4796] Decimal to receive from_float method In-Reply-To: <1230764359.55.0.955763939043.issue4796@psf.upfronthosting.co.za> Message-ID: <1230905376.02.0.82600617505.issue4796@psf.upfronthosting.co.za> Mark Dickinson added the comment: > Just for the avoidance of all doubt, do you mean the largest exponent > with the number normalised to one digit to the right of the decimal > place? No. I'm using 'exponent' in the sense described in the standard. See: http://speleotrove.com/decimal/dbover.html Equivalently, it's the value of the _exp attribute for a Decimal instance. (For the purposes of disambiguation, the alternative exponent that you describe above is often referred to as the 'adjusted exponent' in the documentation and code.) Briefly, every finite Decimal can be thought of as a triple (sign, coefficient, exponent), representing the value (-1)**sign * coefficient * 10**exponent, with the coefficient an integer. It's this exponent that should be maximized. > Because 1e1 = 0.1e2 = 0.01e3 = ... and there is no "largest > exponent possible" All these have exponent 1: >>> Decimal('1e1')._exp 1 >>> Decimal('0.1e2')._exp 1 >>> Decimal('0.01e3')._exp 1 IOW, leading zeros have no significance; only trailing zeros do. > Also, why not just extend the Decimal() constructor to accept a float > as the argument? Why have a separate from_float() method at all? This was discussed extensively when the decimal module was being proposed; see the Decimal PEP for arguments against this. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 15:11:27 2009 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 02 Jan 2009 14:11:27 +0000 Subject: [issue1594] MacOS.GetCreatorAndType() and SetCreatorAndType() broken on intel In-Reply-To: <1197404452.81.0.608484843399.issue1594@psf.upfronthosting.co.za> Message-ID: <1230905487.92.0.822588082772.issue1594@psf.upfronthosting.co.za> Ronald Oussoren added the comment: Fixed in r68156 (including testcase). Annoyingly enough only GetCreatorAndType needed fixing, SetCreatorAndType already did the right thing (makeing the two functions inconsistent with each other). Won't fix for earlier releases, this might break existing code. ---------- nosy: +ronaldoussoren resolution: -> fixed status: open -> closed versions: +Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 15:13:10 2009 From: report at bugs.python.org (Guilherme Polo) Date: Fri, 02 Jan 2009 14:13:10 +0000 Subject: [issue2754] Mac version of IDLE doesn't scroll as expected In-Reply-To: <1209903976.71.0.763172048838.issue2754@psf.upfronthosting.co.za> Message-ID: <1230905590.57.0.826748923427.issue2754@psf.upfronthosting.co.za> Guilherme Polo added the comment: I see some issues related to scrolling under macosx were fixed in tk 8.4.13, but I can't test them since I don't have a mac. If scrolling doesn't work with the example below then I can just say the problem is indeed with tk, but you could try upgrading it. import Tkinter root = Tkinter.Tk() text = Tkinter.Text() text.focus_set() vbar = Tkinter.Scrollbar(orient='vertical', command=text.yview) text.configure(yscrollcommand=vbar.set) vbar.pack(side='right', fill='y') text.pack(fill='both', expand=True) for l in range(int(text['height']) + 10): text.insert('end', "x\n") root.mainloop() ---------- nosy: +gpolo Added file: http://bugs.python.org/file12539/tktext_scroll.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 15:16:32 2009 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Jan 2009 14:16:32 +0000 Subject: [issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0) In-Reply-To: <1230728461.13.0.270652897235.issue4791@psf.upfronthosting.co.za> Message-ID: <1230905792.13.0.760045849768.issue4791@psf.upfronthosting.co.za> STINNER Victor added the comment: Can you paste the full output with debuglevel=3? "if not line:" should be equivalent to "if len(line) == 0:" and to "if line == '':". ftp.dir() is equivalent to ftp.retrlines('LIST'). By default, the socket created to get the result of LIST has no timeout (is blocking). So fp.readline() only returns an empty string when the socket is closed (by the server). fp is a io.BufferedReader(SocketIO(socket, "r"), io.DEFAULT_BUFFER_SIZE). _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 15:26:27 2009 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Fri, 02 Jan 2009 14:26:27 +0000 Subject: [issue4806] Function calls taking a generator as star argument can mask TypeErrors in the generator In-Reply-To: <1230900364.95.0.0532833034138.issue4806@psf.upfronthosting.co.za> Message-ID: <1230906387.85.0.505795668381.issue4806@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: The issue1615 has the same kind of problems: an AttributeError is masked by another one. ---------- nosy: +amaury.forgeotdarc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 15:44:22 2009 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Jan 2009 14:44:22 +0000 Subject: [issue4751] Patch for better thread support in hashlib In-Reply-To: <1230298756.92.0.632482701363.issue4751@psf.upfronthosting.co.za> Message-ID: <1230907462.32.0.345917072702.issue4751@psf.upfronthosting.co.za> STINNER Victor added the comment: > Releasing the GIL is somewhat expensive and should be avoided > if possible. Another possible solution is to create a lockless object by default, and create a lock if the data size is bigger than N (eg. 8 KB). When the lock is created, update will always use the lock (and so the GIL). In general, you have two classes of hashlib usages: - hash a big files by chunk of k KB (eg. 256 KB) - hash a very small string (eg. 8 bytes) When you have a small string, you don't need to release the GIL nor to use locks. Whereas for a file, you can always release the GIL (and so you need a lock to protect the context). _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 15:45:46 2009 From: report at bugs.python.org (Christopher Mahan) Date: Fri, 02 Jan 2009 14:45:46 +0000 Subject: [issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0) In-Reply-To: <1230728461.13.0.270652897235.issue4791@psf.upfronthosting.co.za> Message-ID: <1230907546.52.0.162757210556.issue4791@psf.upfronthosting.co.za> Christopher Mahan added the comment: Full output with debuglevel 3 *cmd* 'CWD chrismahan-675' *put* 'CWD chrismahan-675\r\n' *get* '250 CWD command successful\n' *resp* '250 CWD command successful' *cmd* 'TYPE A' *put* 'TYPE A\r\n' *get* '200 Type set to A\n' *resp* '200 Type set to A' *cmd* 'PASV' *put* 'PASV\r\n' *get* '227 Entering Passive Mode (72,21,82,190,217,227).\n' *resp* '227 Entering Passive Mode (72,21,82,190,217,227).' *cmd* 'LIST' *put* 'LIST\r\n' *get* '150 Opening ASCII mode data connection for file list\n' *resp* '150 Opening ASCII mode data connection for file list' *retr* '-rwxrwxrwx 1 nobody nogroup 3905538 Dec 29 09:51 Bronski Beat - Why.mp3\n' -rwxrwxrwx 1 nobody nogroup 3905538 Dec 29 09:51 Bronski Beat - Why.mp3 *retr* '-rwxrwxrwx 1 nobody nogroup 873966 Dec 28 13:53 test9.avi\n' -rwxrwxrwx 1 nobody nogroup 873966 Dec 28 13:53 test9.avi *retr* '-rwxrwxrwx 1 nobody nogroup 2512653 Dec 29 08:28 test9_lg.wmv\n' -rwxrwxrwx 1 nobody nogroup 2512653 Dec 29 08:28 test9_lg.wmv *retr* '-rwxrwxrwx 1 nobody nogroup 6549 Dec 29 08:28 test9_lg.wmv.jpg\n' -rwxrwxrwx 1 nobody nogroup 6549 Dec 29 08:28 test9_lg.wmv.jpg *retr* '-rwxrwxrwx 1 nobody nogroup 1788466 Dec 29 03:04 test9_med.flv\n' -rwxrwxrwx 1 nobody nogroup 1788466 Dec 29 03:04 test9_med.flv *retr* '-rwxrwxrwx 1 nobody nogroup 6394 Dec 29 03:04 test9_med.flv.jpg\n' -rwxrwxrwx 1 nobody nogroup 6394 Dec 29 03:04 test9_med.flv.jpg *retr* '-rwxrwxrwx 1 nobody nogroup 1263041 Dec 28 13:53 test9_sm.flv\n' -rwxrwxrwx 1 nobody nogroup 1263041 Dec 28 13:53 test9_sm.flv *retr* '-rwxrwxrwx 1 nobody nogroup 6465 Dec 28 13:53 test9_sm.flv.jpg\n' -rwxrwxrwx 1 nobody nogroup 6465 Dec 28 13:53 test9_sm.flv.jpg *retr* '' _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 15:46:40 2009 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 02 Jan 2009 14:46:40 +0000 Subject: [issue900949] plat-mac/videoreader.py not working on OS X Message-ID: <1230907600.43.0.118441791306.issue900949@psf.upfronthosting.co.za> Ronald Oussoren added the comment: Fixed in r68158. ---------- nosy: +ronaldoussoren resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 15:48:25 2009 From: report at bugs.python.org (Christopher Mahan) Date: Fri, 02 Jan 2009 14:48:25 +0000 Subject: [issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0) In-Reply-To: <1230728461.13.0.270652897235.issue4791@psf.upfronthosting.co.za> Message-ID: <1230907705.75.0.982977878042.issue4791@psf.upfronthosting.co.za> Christopher Mahan added the comment: haypo writes: >By default, the socket created to get the result of LIST has no >timeout (is blocking). So fp.readline() only returns an empty string >when the socket is closed (by the server). Even if the server closed the socket and fp.readline() returned an empty string, the prog should not hang, no? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 15:48:35 2009 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 02 Jan 2009 14:48:35 +0000 Subject: [issue1627952] plat-mac videoreader.py auido format info Message-ID: <1230907715.2.0.0355584861007.issue1627952@psf.upfronthosting.co.za> Ronald Oussoren added the comment: Fixd in r68159 ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 15:52:37 2009 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 02 Jan 2009 14:52:37 +0000 Subject: [issue1737832] EasyDialogs patch to remove aepack dependency Message-ID: <1230907957.5.0.274030615631.issue1737832@psf.upfronthosting.co.za> Ronald Oussoren added the comment: I've applied this patch in r68160. ---------- resolution: -> accepted status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 15:55:13 2009 From: report at bugs.python.org (Corey Goldberg) Date: Fri, 02 Jan 2009 14:55:13 +0000 Subject: [issue4808] doc issue for threading module (name/daemon properties) In-Reply-To: <1230908113.29.0.280160311198.issue4808@psf.upfronthosting.co.za> Message-ID: <1230908113.29.0.280160311198.issue4808@psf.upfronthosting.co.za> New submission from Corey Goldberg : In the current 3.0 doc for threading: http://docs.python.org/dev/py3k/library/threading.htm it says: Thread.getName() Thread.setName() Old API for name. and Thread.isDaemon() Thread.setDaemon() Old API for daemon. 'name' and 'daemon' properties should be listed as defaults and the old getter/setter methods should be noted as "Old API". ---------- assignee: georg.brandl components: Documentation messages: 78807 nosy: cgoldberg, georg.brandl severity: normal status: open title: doc issue for threading module (name/daemon properties) versions: Python 3.0 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 15:57:16 2009 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Fri, 02 Jan 2009 14:57:16 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230850791.65.0.79634207218.issue4753@psf.upfronthosting.co.za> Message-ID: <495E2B49.8020702@egenix.com> Marc-Andre Lemburg added the comment: On 2009-01-01 23:59, Antoine Pitrou wrote: > Antoine Pitrou added the comment: > > I've updated the comments as per Alexandre's request, added support for > SUN CC, and fixed the generation script to use the new filename. Since the patch heavily relies on the compiler doing the right thing (which esp. GCC often doesn't, unfortunately), I think that the opcode dispatch code should only be enabled via a configure option. This is safer than enabling the support unconditionally for GCC and the SUN Pro C compiler, since it is rather likely that some GCC versions have bugs which could render Python unusable if compiled with the dispatching support enabled. A configure option also has the additional benefit that you can enable the support for compilers which support the syntax, but are not included in the hard-coded list of compilers included in the patch. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 15:58:42 2009 From: report at bugs.python.org (Roumen Petrov) Date: Fri, 02 Jan 2009 14:58:42 +0000 Subject: [issue4472] Is shared lib building broken on trunk for Mac OS X? In-Reply-To: <18738.49496.996446.483821@montanaro-dyndns-org.local> Message-ID: <1230908322.86.0.25576388115.issue4472@psf.upfronthosting.co.za> Roumen Petrov added the comment: Ronald, cygwin is a special case too. LDLIBRARY is so called import library ! So the make target can be (as I propose in py-issue-4472-makefile.patch) + if test -n "$(DLLLIBRARY)"; then \ + $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \ or if new check is not ok then we has to restore old code . - if test "$(SO)" = .dll; then \ - $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(BINDIR); \ More info for cygwin: - SO = .dll - DLLLIBRARY is set only for cygwin - libpython$(VERSION)$(SO) = $(DLLLIBRARY) - but $(LDLIBRARY) = libpython$(VERSION).dll.a !!! _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 16:00:24 2009 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 02 Jan 2009 15:00:24 +0000 Subject: [issue1149804] macostools.mkdirs: not thread-safe Message-ID: <1230908424.67.0.439688466314.issue1149804@psf.upfronthosting.co.za> Ronald Oussoren added the comment: Fixed this issue in r68161 by porting the solution for this in os.mkdirs to macostools. ---------- nosy: +ronaldoussoren resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 16:06:21 2009 From: report at bugs.python.org (Craig Holmquist) Date: Fri, 02 Jan 2009 15:06:21 +0000 Subject: [issue4566] 2.6.1 breaks many applications that embed Python on Windows In-Reply-To: <1228577334.37.0.676469955994.issue4566@psf.upfronthosting.co.za> Message-ID: <1230908781.42.0.375234888778.issue4566@psf.upfronthosting.co.za> Craig Holmquist added the comment: I haven't been able to try this patch myself yet, but I see a potential problem: the "cookie" variable is declared as a DWORD, while ActivateActCtx expects a ULONG_PTR. DWORD and ULONG_PTR are only the same thing in 32-bit Windows. Also, where are you seeing that these SxS functions are "Vista or later"? My XP kernel32.dll has all of them. MSDN says they're XP or Vista. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 16:06:49 2009 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 02 Jan 2009 15:06:49 +0000 Subject: [issue4472] Is shared lib building broken on trunk for Mac OS X? In-Reply-To: <18738.49496.996446.483821@montanaro-dyndns-org.local> Message-ID: <1230908809.58.0.610754571515.issue4472@psf.upfronthosting.co.za> Ronald Oussoren added the comment: I've applied this patch. If I understand things correctly that should fix the cygwin issue. Index: Makefile.pre.in =================================================================== --- Makefile.pre.in (revision 68149) +++ Makefile.pre.in (working copy) @@ -773,8 +773,8 @@ done $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE) if test -f $(LDLIBRARY); then \ - if test "$(SO)" = .dll; then \ - $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(BINDIR); \ + if test -n "$(DLLLIBRARY)" ; then \ + $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \ else \ $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \ if test $(LDLIBRARY) != $(INSTSONAME); then \ _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 16:10:07 2009 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 02 Jan 2009 15:10:07 +0000 Subject: [issue1717] Get rid of more refercenes to __cmp__ In-Reply-To: <1199205565.64.0.0495465164968.issue1717@psf.upfronthosting.co.za> Message-ID: <1230909004.94.0.703329006939.issue1717@psf.upfronthosting.co.za> Mark Dickinson added the comment: Here's a patch (against py3k) generated from the current state of the py3k-issue1717 branch, for ease of review and testing. The patch needs serious review; it should be considered a first draft, and there are probably many more changes still to be made. I don't think I can do much more for now without getting input from others. Known places in the source tree where cmp/__cmp__ still lingers on: Demos/ Doc/extending/newtypes.rst Misc/cheatsheet Misc/python-mode.el Misc/Vim/python.vim Parser/spark.py # (I don't know what this does. Anyone?) Tools/ # (notably pynche and pybench) Apart from the newtypes.rst, all of the above files are somewhat out of date in other ways. In my opinion it's only the doc fixes that stop the patch from being complete enough. ---------- stage: needs patch -> patch review Added file: http://bugs.python.org/file12540/remove_cmp6.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 16:10:19 2009 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 02 Jan 2009 15:10:19 +0000 Subject: [issue900514] bundlebuilder: easily keep main routine in orig location Message-ID: <1230909019.94.0.793160872286.issue900514@psf.upfronthosting.co.za> Ronald Oussoren added the comment: I agree with Bob's last response. Futhermore bundlebuilder is deprecated, use py2app instead. ---------- nosy: +ronaldoussoren resolution: -> wont fix status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 16:11:24 2009 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 02 Jan 2009 15:11:24 +0000 Subject: [issue905737] BuildApplet needs to get more BuildApplication features Message-ID: <1230909084.21.0.466946111855.issue905737@psf.upfronthosting.co.za> Ronald Oussoren added the comment: Closing this issue as bundlebundler is deprecated. ---------- nosy: +ronaldoussoren resolution: -> wont fix status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 16:26:00 2009 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 02 Jan 2009 15:26:00 +0000 Subject: [issue841800] -O breaks bundlebuilder --standalone Message-ID: <1230909960.39.0.628698845873.issue841800@psf.upfronthosting.co.za> Ronald Oussoren added the comment: Fixed in r68163 ---------- nosy: +ronaldoussoren resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 16:26:26 2009 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 02 Jan 2009 15:26:26 +0000 Subject: [issue900506] bundlebuilder: an arg to disable zipping the code Message-ID: <1230909986.89.0.159977974878.issue900506@psf.upfronthosting.co.za> Ronald Oussoren added the comment: Fixed in r68163 ---------- nosy: +ronaldoussoren resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 16:32:34 2009 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 02 Jan 2009 15:32:34 +0000 Subject: [issue957652] Implement BundleBuilder GUI as plugin component Message-ID: <1230910354.76.0.0191640684014.issue957652@psf.upfronthosting.co.za> Ronald Oussoren added the comment: Closed as won't fix because bundlebuilder is deprecated and it is rather unlikely that anyone will spent time on this feature request. ---------- nosy: +ronaldoussoren resolution: -> wont fix status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 16:35:56 2009 From: report at bugs.python.org (Craig Holmquist) Date: Fri, 02 Jan 2009 15:35:56 +0000 Subject: [issue4566] 2.6.1 breaks many applications that embed Python on Windows In-Reply-To: <1228577334.37.0.676469955994.issue4566@psf.upfronthosting.co.za> Message-ID: <1230910556.1.0.589080165495.issue4566@psf.upfronthosting.co.za> Craig Holmquist added the comment: The patch works fine on my system (32-bit XP). Also I verified in Process Explorer that there's only one instance of msvcr90.dll loaded. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 16:43:40 2009 From: report at bugs.python.org (ebfe) Date: Fri, 02 Jan 2009 15:43:40 +0000 Subject: [issue4751] Patch for better thread support in hashlib In-Reply-To: <1230298756.92.0.632482701363.issue4751@psf.upfronthosting.co.za> Message-ID: <1230911020.98.0.73380882947.issue4751@psf.upfronthosting.co.za> ebfe added the comment: I don't think this is actually worth the trouble. You run into situation where one thread might decide that it needs a lock now with other threads being in the to-be-locked-area at that time. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 16:51:54 2009 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Fri, 02 Jan 2009 15:51:54 +0000 Subject: [issue4805] Make python code compilable with a C++ compiler In-Reply-To: <1230872206.73.0.47638283248.issue4805@psf.upfronthosting.co.za> Message-ID: <1230911514.91.0.0936643511762.issue4805@psf.upfronthosting.co.za> Marc-Andre Lemburg added the comment: Moving declarations into header files is not really in line with the way Python developers use header files: We usually only put code into header files that is meant for public use. Buy putting declarations into the header files without additional warning, you implicitly document them and make them usable in non-interpreter code. ---------- nosy: +lemburg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 16:54:42 2009 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Fri, 02 Jan 2009 15:54:42 +0000 Subject: [issue4805] Make python code compilable with a C++ compiler In-Reply-To: <1230872206.73.0.47638283248.issue4805@psf.upfronthosting.co.za> Message-ID: <1230911682.85.0.598113499033.issue4805@psf.upfronthosting.co.za> Marc-Andre Lemburg added the comment: Also note that by removing the extern "C" declarations, you not only change the exported symbol names of functions, but also those of exported globals. Those would also have to get declared in the header files, to prevent their names from being mangled (causing the exported C API to change). _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 16:55:35 2009 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Fri, 02 Jan 2009 15:55:35 +0000 Subject: [issue4805] Make python code compilable with a C++ compiler In-Reply-To: <1230872206.73.0.47638283248.issue4805@psf.upfronthosting.co.za> Message-ID: <1230911735.12.0.300123200363.issue4805@psf.upfronthosting.co.za> Marc-Andre Lemburg added the comment: The added type casts are useful to have - even outside the context of the idea behind the patch. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 16:57:21 2009 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 02 Jan 2009 15:57:21 +0000 Subject: [issue2121] complex constructor doesn't accept string with nan and inf In-Reply-To: <1203063317.15.0.466109223175.issue2121@psf.upfronthosting.co.za> Message-ID: <1230911841.32.0.50506089114.issue2121@psf.upfronthosting.co.za> Mark Dickinson added the comment: [Raymond] > I would > not like to see that extended to cmath or complex() unless compelling > real-world use cases arise. Hmm. Have you looked at the cmath module recently? You may be in for a nasty surprise... > Mark, does Inf have a standard interpretation for complex numbers? Do > all infinities meet or do they radiate, each with their own phase > angle? Shrug. Mathematically, by far the most common and useful model is the complex plane plus a single extra point at infinity. But when complexes are implemented as pairs of floats things look a little strange. Kahan, in his 'branch cuts' paper identifies 9 'different' complex infinities in this model, and C99 Annex G specifies exactly how functions should behave for various different infinities. It's never really been clear to me how useful it is to be able to distinguish these infinities. But the cmath module *does* make an effort to return the 'correct' (according to C99 Annex G) values for inputs with a special real or imaginary component. On balance, I'd support making complex('nan + nan*j') do the right thing. (Though I can't help feeling that the repr of complex(nan, nan) should have been 'nan + nan*1j' rather than the current 'nan + nan*j'.) > Also, do you want to stick with the 754 interpretation of NaNs as the > result of invalid operations I've never much liked the use of NaN to represent missing values, and I don't think Python should embrace that usage. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 17:01:39 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Fri, 02 Jan 2009 16:01:39 +0000 Subject: [issue4794] garbage collector blocks and takes worst-case linear time wrt number of objects In-Reply-To: <1230752086.58.0.537070994703.issue4794@psf.upfronthosting.co.za> Message-ID: <1230912099.82.0.660538055717.issue4794@psf.upfronthosting.co.za> Martin v. L?wis added the comment: Hard real-time applications written in Python should not rely on the cyclic garbage collector. They should call gc.disable at startup, and completely rely on reference counting for releasing memory. Doing so might require rewrites to the application, explicitly breaking cycles so that reference counting can release them. Even with cyclic gc disabled, applications worried about meeting hard deadlines need to look even more into memory allocation and deallocation; e.g. releasing a single object may cause a chained release of many objects, which can affect worst case execution times. There are more issues to consider (which are all out of scope of the bug tracker). ---------- nosy: +loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 17:07:09 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Fri, 02 Jan 2009 16:07:09 +0000 Subject: [issue3959] Add Google's ipaddr.py to the stdlib In-Reply-To: <1230766995.94.0.793340858766.issue3959@psf.upfronthosting.co.za> Message-ID: <495E3BAA.6070200@v.loewis.de> Martin v. L?wis added the comment: > I think this might be worth a look before any hard and fast decisions > are made :- > > http://code.google.com/p/netaddr/ Looking at code isn't really helpful for determining whether it can be included into Python. What matters more is whether the authors want to contribute it, how they want to support it afterwards, and so on. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 17:08:19 2009 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 02 Jan 2009 16:08:19 +0000 Subject: [issue2121] complex constructor doesn't accept string with nan and inf In-Reply-To: <1203063317.15.0.466109223175.issue2121@psf.upfronthosting.co.za> Message-ID: <1230912499.33.0.453177575031.issue2121@psf.upfronthosting.co.za> Mark Dickinson added the comment: cdavid, in your application, how hard is it to work around the problem by simply printing and parsing pairs of floats rather than complex numbers? E.g., z = complex(float(real_part), float(imag_part)) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 17:10:35 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 02 Jan 2009 16:10:35 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <495E2B49.8020702@egenix.com> Message-ID: <1230912587.9067.23.camel@localhost> Antoine Pitrou added the comment: > This is safer than enabling the support unconditionally for GCC and > the SUN Pro C compiler, since it is rather likely that some GCC versions > have bugs which could render Python unusable if compiled with the > dispatching support enabled. What do you mean, "unusable"? 10% slower? Well, Python 3.x is already unusable (compared to 2.x) by that metric... Until now, only Skip has reported a slowdown on his PPC machine, while x86 systems have all seen a positive (if tiny, sometimes) improvement. I fear that with a configure option, disabled by default, the code will get very poor testing and perhaps get broken in some subtle way without anyone noticing. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 17:16:00 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Fri, 02 Jan 2009 16:16:00 +0000 Subject: [issue4035] Support bytes for os.exec*() In-Reply-To: <1223077104.22.0.62328245443.issue4035@psf.upfronthosting.co.za> Message-ID: <1230912960.71.0.245879177735.issue4035@psf.upfronthosting.co.za> Martin v. L?wis added the comment: Any discussion in the tracker should be deferred until a PEP has been written, discussed, and accepted. Then the question whether to accept a specific patch shouldn't be a matter of taste, but should follow from the general rules that the PEP has set up. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 17:16:10 2009 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 02 Jan 2009 16:16:10 +0000 Subject: [issue4065] _multiprocessing doesn't build on macosx 10.3 In-Reply-To: <1223376772.75.0.564119782301.issue4065@psf.upfronthosting.co.za> Message-ID: <1230912970.69.0.519029183933.issue4065@psf.upfronthosting.co.za> Ronald Oussoren added the comment: The manpage for writev(2) mentions #include . Adding a #include for is the right fix after all... _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 17:17:41 2009 From: report at bugs.python.org (Skip Montanaro) Date: Fri, 02 Jan 2009 16:17:41 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230912587.9067.23.camel@localhost> Message-ID: <18782.15905.838842.10862@montanaro-dyndns-org.local> Skip Montanaro added the comment: Antoine> I fear that with a configure option, disabled by default, the Antoine> code will get very poor testing and perhaps get broken in some Antoine> subtle way without anyone noticing. That can be fixed by enabling that option on the buildbots where it is presumed to help. I see more slowdown on PPC than people are reporting as speedups on Intel. Is there something I can do to help debug the problem? It doesn't appear the Apple version of gcc supports the -fno-crossjumping flag. If I dump the assembler code for ceval.c will that help others debug the problem? Skip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 17:18:15 2009 From: report at bugs.python.org (Randy Syring) Date: Fri, 02 Jan 2009 16:18:15 +0000 Subject: [issue4809] 2.5.4 release missing from python.org/downloads In-Reply-To: <1230913095.06.0.854632300097.issue4809@psf.upfronthosting.co.za> Message-ID: <1230913095.06.0.854632300097.issue4809@psf.upfronthosting.co.za> New submission from Randy Syring : http://www.python.org/download/ is missing a link to 2.5.4 in the standard releases section. ---------- assignee: georg.brandl components: Documentation messages: 78832 nosy: georg.brandl, rsyring severity: normal status: open title: 2.5.4 release missing from python.org/downloads _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 17:26:11 2009 From: report at bugs.python.org (Cournapeau David) Date: Fri, 02 Jan 2009 16:26:11 +0000 Subject: [issue2121] complex constructor doesn't accept string with nan and inf In-Reply-To: <1203063317.15.0.466109223175.issue2121@psf.upfronthosting.co.za> Message-ID: <1230913571.52.0.378472470119.issue2121@psf.upfronthosting.co.za> Cournapeau David added the comment: It is not really for an application, but for numpy. Of course, one can always get around the problem - but since this is really a limitation which can be easily fixed, why not fixing the problem :) ? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 17:28:28 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 02 Jan 2009 16:28:28 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <18782.15905.838842.10862@montanaro-dyndns-org.local> Message-ID: <1230913712.9067.26.camel@localhost> Antoine Pitrou added the comment: > If I dump the assembler code for ceval.c will that help others debug > the problem? Well, I'm no PPC expert but it can be useful. Can you dump it with "-S -dA"? (also, can you try the latest patch? I've made some tiny adjustement in the opcode epilogues, I don't think it will make a difference but who knows) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 17:34:09 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Fri, 02 Jan 2009 16:34:09 +0000 Subject: [issue4800] little inaccuracy in Py_ssize_t explanation In-Reply-To: <1230805955.17.0.970467276629.issue4800@psf.upfronthosting.co.za> Message-ID: <1230914049.16.0.645708801602.issue4800@psf.upfronthosting.co.za> Martin v. L?wis added the comment: I think the documentation is correct as it stands; the question is what a "distinct memory location" is. Wrt. reference count, this surely refers to pointers; each pointer is at least 4 bytes, and pointers are four-aligned. So for N bits address space, there can be at most 2**(N-2) pointers. ---------- nosy: +loewis resolution: -> wont fix status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 17:38:12 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Fri, 02 Jan 2009 16:38:12 +0000 Subject: [issue3959] Add Google's ipaddr.py to the stdlib In-Reply-To: <1230811305.7.0.402640242385.issue3959@psf.upfronthosting.co.za> Message-ID: <495E42F1.9000906@v.loewis.de> Martin v. L?wis added the comment: > One point I will make is on licensing. netaddr is BSD, so you can do > whatever you want with it and contribute as you see fit. That is not sufficient for inclusion to Python. We also want support from the author (along with a promise to eventually give up the external project). _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 17:40:41 2009 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Fri, 02 Jan 2009 16:40:41 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230912587.9067.23.camel@localhost> Message-ID: <495E4384.40100@egenix.com> Marc-Andre Lemburg added the comment: On 2009-01-02 17:10, Antoine Pitrou wrote: > Antoine Pitrou added the comment: > >> This is safer than enabling the support unconditionally for GCC and >> the SUN Pro C compiler, since it is rather likely that some GCC versions >> have bugs which could render Python unusable if compiled with the >> dispatching support enabled. > > What do you mean, "unusable"? Well, not working. GCC versions often have optimizer bugs (esp. the 3.x series and early 4.x versions) and I wouldn't bet on them always getting the dispatch optimizations right. Trying to compile Python with an unconditionally enabled dispatch patch on such a system would render Python unusable. > 10% slower? Well, Python 3.x is already > unusable (compared to 2.x) by that metric... Until now, only Skip has > reported a slowdown on his PPC machine, while x86 systems have all seen > a positive (if tiny, sometimes) improvement. > > I fear that with a configure option, disabled by default, the code will > get very poor testing and perhaps get broken in some subtle way without > anyone noticing. Like Skip said: the buildbots could take care of identifying such problems. People using the option would certainly report problems as well and I'm sure that Linux distributions would compile Python with the switch after verifying that their GCC version works correctly. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 17:41:28 2009 From: report at bugs.python.org (Skip Montanaro) Date: Fri, 02 Jan 2009 16:41:28 +0000 Subject: [issue4810] timeit needs "official" '--' flag In-Reply-To: <18782.17333.839740.4416@montanaro-dyndns-org.local> Message-ID: <18782.17333.839740.4416@montanaro-dyndns-org.local> New submission from Skip Montanaro : Consider this timeit run: % python -m timeit '-1.0e-3 < -0.0001 < 1.0e-3' option -1 not recognized use -h/--help for command line help As it turns out this works: % python -m timeit -- '-1.0e-3 < -0.0001 < 1.0e-3' 10000000 loops, best of 3: 0.192 usec per loop but the output using the -h flag doesn't report it as a possibility. It probably should. ---------- messages: 78838 nosy: skip.montanaro severity: normal status: open title: timeit needs "official" '--' flag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 17:50:56 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Fri, 02 Jan 2009 16:50:56 +0000 Subject: [issue4566] 2.6.1 breaks many applications that embed Python on Windows In-Reply-To: <1230847546.8.0.602549249733.issue4566@psf.upfronthosting.co.za> Message-ID: <495E45ED.2010102@v.loewis.de> Martin v. L?wis added the comment: > Here's an option, though unfortunately not a trivial one: use a private > build of the C runtime. I'm not sure whether the license allows us to do so. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 17:54:35 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Fri, 02 Jan 2009 16:54:35 +0000 Subject: [issue4614] Document PyModule_Create() In-Reply-To: <1228856807.3.0.093975807386.issue4614@psf.upfronthosting.co.za> Message-ID: <1230915275.93.0.271973281722.issue4614@psf.upfronthosting.co.za> Martin v. L?wis added the comment: What's the policy for marking bug reports as critical? If the description of the priority (Might block a future release) is normative, why got this report marked critical? I don't think a documentation bug can ever block a release. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 18:00:23 2009 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 02 Jan 2009 17:00:23 +0000 Subject: [issue4614] Document PyModule_Create() In-Reply-To: <1228856807.3.0.093975807386.issue4614@psf.upfronthosting.co.za> Message-ID: <1230915623.4.0.832045844571.issue4614@psf.upfronthosting.co.za> Benjamin Peterson added the comment: I'm not suggesting that this should block a release (if that is the definition of critical). I do however think this is critical for 3.x's adoption and therefore should be of much importance to us. ---------- nosy: +benjamin.peterson priority: critical -> high _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 18:01:14 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Fri, 02 Jan 2009 17:01:14 +0000 Subject: [issue4804] Python on Windows disables all C runtime library assertions In-Reply-To: <1230869380.06.0.720418986656.issue4804@psf.upfronthosting.co.za> Message-ID: <1230915674.76.0.138353263276.issue4804@psf.upfronthosting.co.za> Martin v. L?wis added the comment: As long as the CRT contains bogus assertions (that violate standard C), I think Python rightfully should continue to disable assertions. If applications desire assertions, they should explicitly turn them on (provided there is an API to do so). ---------- nosy: +loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 18:08:26 2009 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 02 Jan 2009 17:08:26 +0000 Subject: [issue4796] Decimal to receive from_float method In-Reply-To: <1230764359.55.0.955763939043.issue4796@psf.upfronthosting.co.za> Message-ID: <1230916106.3.0.455479805252.issue4796@psf.upfronthosting.co.za> Steven D'Aprano added the comment: Mark wrote: >> Also, why not just extend the Decimal() constructor to accept >> a float as the argument? Why have a separate from_float() >> method at all? > > This was discussed extensively when the decimal module was > being proposed; see the Decimal PEP for arguments against this. I'm very aware of that. The Decimal PEP says the consensus was for from_float() to take a second argument specifying the precision. Decimal(1.1) => Decimal("1.1") was rejected for the reasons given in the PEP by Paul Moore, and Decimal(1.1) => Decimal('110000000000000008881784197001252...e-51') was (presumably) rejected because it would confuse newbies. Hence the decision to (1) make an alternative constructor and (2) have it take a second argument. It looks like you and Raymond have rejected #2 but are keeping #1, and I'm curious why. That's genuine curiosity, and a real question, not a thinly-veiled scowl of disapproval disguised as a question :) Anyway, I'm happy enough so long as Raymond's suggested Context.create_decimal() exists, that's the actual functionality I'm after, so maybe I should let you guys get on with it. Thanks. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 18:20:34 2009 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 02 Jan 2009 17:20:34 +0000 Subject: [issue4760] cmp gone---What's new in 3.1 In-Reply-To: <1230436607.02.0.835606741355.issue4760@psf.upfronthosting.co.za> Message-ID: <1230916834.89.0.690211523373.issue4760@psf.upfronthosting.co.za> Mark Dickinson added the comment: > Uhm ? The builtin cmp wasn't removed. Non-removal of cmp for 3.0 was an oversight. It *might* be removed in 3.0.1. See issue 1717. ---------- nosy: +marketdickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 18:24:32 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Fri, 02 Jan 2009 17:24:32 +0000 Subject: [issue4614] Document PyModule_Create() In-Reply-To: <1228856807.3.0.093975807386.issue4614@psf.upfronthosting.co.za> Message-ID: <1230917072.46.0.602903439883.issue4614@psf.upfronthosting.co.za> Martin v. L?wis added the comment: I'm a bit worried about committers giving other committers priorities on how they should work; as a principle, volunteers are free to work on whatever they please, in whatever order they please. So unassigning Georg. ---------- assignee: georg.brandl -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 18:28:26 2009 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 02 Jan 2009 17:28:26 +0000 Subject: [issue4796] Decimal to receive from_float method In-Reply-To: <1230764359.55.0.955763939043.issue4796@psf.upfronthosting.co.za> Message-ID: <1230917306.67.0.0793953943984.issue4796@psf.upfronthosting.co.za> Mark Dickinson added the comment: > It looks like you and Raymond have rejected #2 but are keeping #1 I'm not against #2, but I'm not particularly for it either. In any case, once you've converted your float to Decimal it's trivial to round it to whatever precision you feel like, so #2 seems unnecessary to me. -0.0. I am -1.100000000000000088817841970012523233890533447265625 on any implementation of from_float (with or without keywords, defaults, etc.) for which Decimal.from_float(1.1) gives Decimal('1.1'). _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 18:31:13 2009 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 02 Jan 2009 17:31:13 +0000 Subject: [issue4614] Document PyModule_Create() In-Reply-To: <1230917072.46.0.602903439883.issue4614@psf.upfronthosting.co.za> Message-ID: <1afaf6160901020931h6d1df7d9tf77904c93abf133a@mail.gmail.com> Benjamin Peterson added the comment: On Fri, Jan 2, 2009 at 11:24 AM, Martin v. L?wis wrote: > > Martin v. L?wis added the comment: > > I'm a bit worried about committers giving other committers priorities on > how they should work; as a principle, volunteers are free to work on > whatever they please, in whatever order they please. Of course. > > So unassigning Georg. It would be really nice if there were some notes on use of the tracker. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 18:31:16 2009 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Fri, 02 Jan 2009 17:31:16 +0000 Subject: [issue4804] Python on Windows disables all C runtime library assertions In-Reply-To: <1230915674.76.0.138353263276.issue4804@psf.upfronthosting.co.za> Message-ID: <930F189C8A437347B80DF2C156F7EC7F04D1883E4D@exchis.ccp.ad.local> Kristj?n Valur J?nsson added the comment: We've had this discussion before, you know, 2006. MS is asserting on preconditions that are undefined by the standard. As such, they are not in violation. In fact, it is foolish by us to invoke undefined behaviour, because it may, proverbially, result in the formatting of the hard drive :) K _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 18:35:18 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 02 Jan 2009 17:35:18 +0000 Subject: [issue4738] Patch to make zlib-objects better support threads In-Reply-To: <1230136171.32.0.121363130694.issue4738@psf.upfronthosting.co.za> Message-ID: <1230917718.96.0.322010051322.issue4738@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Checked in r68165. Thanks! ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 18:49:53 2009 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Jan 2009 17:49:53 +0000 Subject: [issue4738] Patch to make zlib-objects better support threads In-Reply-To: <1230136171.32.0.121363130694.issue4738@psf.upfronthosting.co.za> Message-ID: <1230918593.99.0.066561675096.issue4738@psf.upfronthosting.co.za> STINNER Victor added the comment: @pitrou: You added "Also, the GIL is now released when computing the CRC of a large buffer." in the NEWS. The GIL released for crc32 but also for adler32. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 18:58:03 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Fri, 02 Jan 2009 17:58:03 +0000 Subject: [issue4614] Document PyModule_Create() In-Reply-To: <1afaf6160901020931h6d1df7d9tf77904c93abf133a@mail.gmail.com> Message-ID: <495E55A9.8060002@v.loewis.de> Martin v. L?wis added the comment: > It would be really nice if there were some notes on use of the tracker. I think Brett has a vision here; you might ping him what the status of that is. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 19:07:43 2009 From: report at bugs.python.org (Georg Brandl) Date: Fri, 02 Jan 2009 18:07:43 +0000 Subject: [issue4809] 2.5.4 release missing from python.org/downloads In-Reply-To: <1230913095.06.0.854632300097.issue4809@psf.upfronthosting.co.za> Message-ID: <1230919663.33.0.105254868138.issue4809@psf.upfronthosting.co.za> Georg Brandl added the comment: Normally this bug tracker isn't meant for website problems (mail to pydotorg at python.org instead), but since this is minor, I've fixed it right now. Thanks! ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 19:11:07 2009 From: report at bugs.python.org (Georg Brandl) Date: Fri, 02 Jan 2009 18:11:07 +0000 Subject: [issue1717] Get rid of more refercenes to __cmp__ In-Reply-To: <1199205565.64.0.0495465164968.issue1717@psf.upfronthosting.co.za> Message-ID: <1230919867.72.0.97128542556.issue1717@psf.upfronthosting.co.za> Georg Brandl added the comment: Doc/extending/newtypes.rst I'll fix this one after the patch has landed. Misc/cheatsheet This needs a general overhaul. Misc/python-mode.el I think this should be removed from the distribution; it's maintained externally. Parser/spark.py # (I don't know what this does. Anyone?) This is used by asdl_c.py which generates Python-ast.c -- it should be updated. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 19:15:21 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Fri, 02 Jan 2009 18:15:21 +0000 Subject: [issue4804] Python on Windows disables all C runtime library assertions In-Reply-To: <930F189C8A437347B80DF2C156F7EC7F04D1883E4D@exchis.ccp.ad.local> Message-ID: <495E59B6.10706@v.loewis.de> Martin v. L?wis added the comment: > We've had this discussion before, you know, 2006. > MS is asserting on preconditions that are undefined by the standard. > As such, they are not in violation. I remember, and you were already wrong back then :-) MS asserts (in winsig.c) that the signal number in signal() is one of the explicit list of supported or ignored signals; if it isn't, it aborts. This is in violation to ISO C, 7.14.1.1p8, which specifies that SIG_ERR must be returned and errno set. It is true that Python *also* invokes undefined behavior in certain cases; contributions to eliminate these are welcome. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 19:32:56 2009 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 02 Jan 2009 18:32:56 +0000 Subject: [issue4809] 2.5.4 release missing from python.org/downloads In-Reply-To: <1230913095.06.0.854632300097.issue4809@psf.upfronthosting.co.za> Message-ID: <1230921176.37.0.686148525204.issue4809@psf.upfronthosting.co.za> Benjamin Peterson added the comment: webmaster at python.org is better. ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 19:51:34 2009 From: report at bugs.python.org (Roumen Petrov) Date: Fri, 02 Jan 2009 18:51:34 +0000 Subject: [issue4472] Is shared lib building broken on trunk for Mac OS X? In-Reply-To: <18738.49496.996446.483821@montanaro-dyndns-org.local> Message-ID: <1230922294.34.0.497070247621.issue4472@psf.upfronthosting.co.za> Roumen Petrov added the comment: 10x cygwin is now not impacted. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 19:55:09 2009 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Jan 2009 18:55:09 +0000 Subject: [issue4751] Patch for better thread support in hashlib In-Reply-To: <1230298756.92.0.632482701363.issue4751@psf.upfronthosting.co.za> Message-ID: <1230922509.44.0.38793838169.issue4751@psf.upfronthosting.co.za> STINNER Victor added the comment: New implementation of finer lock grain in _hashlibopenssl: only create the lock at the first update with more than 8 KB bytes. Object creation/deallocation is faster if we hash less than 8 KB. Changes between hashopenssl_threads-4.diff and my new patch: fix the deadlock in ENTER_HASHLIB() (for the GIL) without speed change (because we don't change the GIL state if we don't use a lock). Changes between py3k trunk and my new patch: - release the GIL with large byte string => faster with multiple CPUs - fix EVP_get_block_size() and EVP_get_digest_size(): the context was not protected by the lock! Added file: http://bugs.python.org/file12541/hashlibopenssl_small_lock.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 19:55:27 2009 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Jan 2009 18:55:27 +0000 Subject: [issue4751] Patch for better thread support in hashlib In-Reply-To: <1230298756.92.0.632482701363.issue4751@psf.upfronthosting.co.za> Message-ID: <1230922527.35.0.443489898704.issue4751@psf.upfronthosting.co.za> Changes by STINNER Victor : Removed file: http://bugs.python.org/file12459/hashopenssl_threads-2.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 20:02:01 2009 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Jan 2009 19:02:01 +0000 Subject: [issue4751] Patch for better thread support in hashlib In-Reply-To: <1230298756.92.0.632482701363.issue4751@psf.upfronthosting.co.za> Message-ID: <1230922921.76.0.828266682073.issue4751@psf.upfronthosting.co.za> STINNER Victor added the comment: Update small lock patch: replace all tabs by spaces! I forget a change between Python trunk and my patch: there is also the error message for Unicode object. Before: >>> import hashlib; hashlib.md5("abc") TypeError: object supporting the buffer API required after: >>> import hashlib; hashlib.md5("abc") TypeError: Unicode-objects must be encoded before hashing Added file: http://bugs.python.org/file12542/hashlibopenssl_small_lock-2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 20:02:15 2009 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Jan 2009 19:02:15 +0000 Subject: [issue4751] Patch for better thread support in hashlib In-Reply-To: <1230298756.92.0.632482701363.issue4751@psf.upfronthosting.co.za> Message-ID: <1230922935.41.0.442349846963.issue4751@psf.upfronthosting.co.za> Changes by STINNER Victor : Removed file: http://bugs.python.org/file12541/hashlibopenssl_small_lock.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 20:09:34 2009 From: report at bugs.python.org (Georg Brandl) Date: Fri, 02 Jan 2009 19:09:34 +0000 Subject: [issue4808] doc issue for threading module (name/daemon properties) In-Reply-To: <1230908113.29.0.280160311198.issue4808@psf.upfronthosting.co.za> Message-ID: <1230923374.65.0.789951399668.issue4808@psf.upfronthosting.co.za> Georg Brandl added the comment: I don't understand -- both name and daemon are already documented on their own. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 20:19:08 2009 From: report at bugs.python.org (Corey Goldberg) Date: Fri, 02 Jan 2009 19:19:08 +0000 Subject: [issue4808] doc issue for threading module (name/daemon properties) In-Reply-To: <1230908113.29.0.280160311198.issue4808@psf.upfronthosting.co.za> Message-ID: <1230923948.55.0.326938770324.issue4808@psf.upfronthosting.co.za> Corey Goldberg added the comment: sorry for the confusion. The doc might actually be correct, but it seems ambiguous and confusing with respect to the name and daemon properties. if you look here: http://docs.python.org/dev/py3k/library/threading.html scroll down to where it says: Thread.getName() Thread.setName() Old API for name. when you click on "name", it expands and shows you the 'name' property. However, it looks like it is denoting this as the "Old API". at first glance it appears as though Thread.getName() and Thread.setName() are the new way, and you can click on 'name' to see the old API. I think the issue is actually the fact that Thread.name and Thread.daemon are not expanded in the HTML doc until you click on their names (unlike other properties/attributes in the doc which are already expanded) Let me know if I am not explaining well. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 20:24:12 2009 From: report at bugs.python.org (Georg Brandl) Date: Fri, 02 Jan 2009 19:24:12 +0000 Subject: [issue4808] doc issue for threading module (name/daemon properties) In-Reply-To: <1230908113.29.0.280160311198.issue4808@psf.upfronthosting.co.za> Message-ID: <1230924252.66.0.472478852853.issue4808@psf.upfronthosting.co.za> Georg Brandl added the comment: Hmm, I do see docs for name and daemon, directly below the respective getter/setter entries. For more clarity, I can only offer moving the getter/setter entries below the property entries. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 20:25:05 2009 From: report at bugs.python.org (Corey Goldberg) Date: Fri, 02 Jan 2009 19:25:05 +0000 Subject: [issue4808] doc issue for threading module (name/daemon properties) In-Reply-To: <1230908113.29.0.280160311198.issue4808@psf.upfronthosting.co.za> Message-ID: <1230924305.0.0.899066663558.issue4808@psf.upfronthosting.co.za> Corey Goldberg added the comment: Just took another look. The doc is correct and already shows name and daemon properties. it was just confusing at first since where it says "Old API for name", it links to the new style API and you jump to that section. perhaps it could be stated more clearly? If this is just a nit, please close this issue. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 20:26:58 2009 From: report at bugs.python.org (Corey Goldberg) Date: Fri, 02 Jan 2009 19:26:58 +0000 Subject: [issue4808] doc issue for threading module (name/daemon properties) In-Reply-To: <1230908113.29.0.280160311198.issue4808@psf.upfronthosting.co.za> Message-ID: <1230924418.34.0.0268528489113.issue4808@psf.upfronthosting.co.za> Corey Goldberg added the comment: yes if the new style was listed first, and the old style was below and marked as "Old API", it would help with some confusion (like I ran into). _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 20:51:25 2009 From: report at bugs.python.org (Guilherme Polo) Date: Fri, 02 Jan 2009 19:51:25 +0000 Subject: [issue1482122] Shift+Backspace exhibits odd behavior Message-ID: <1230925885.32.0.569542752713.issue1482122@psf.upfronthosting.co.za> Guilherme Polo added the comment: I'm closing this as won't fix but let me tell what you can do to solve the problem yourself (this may be added somewhere else then, like in the tkinter wiki). First, check the keysym you get when pressing Shift-BackSpace: import Tkinter def show_key(event): print event.keysym, event.keycode, hex(event.keysym_num) root = Tkinter.Tk() root.bind("", show_key) root.mainloop() While running this I pressed Shift-BackSpace, this is what I got: Shift_L 50 0xffe1 Terminate_Server 22 0xfed5 You can clearly see that Shift-BackSpace is assigned to something else here, Terminate_Server. You can confirm this by doing: $ xmodmap -pk | grep 0xfed5 22 0xff08 (BackSpace) 0xfed5 (Terminate_Server) 0xff08 (BackSpace) 0xfed5 (Terminate_Server) 0xff08 (BackSpace) 0xfed5 (Terminate_Server) The second field in this output indicates that when I press the key 22 (BackSpace) while holding shift, a Terminate_Server is sent. For more information about xmodmap you should consult its documentation. Then, to fix the initial problem you can do the following: $ xmodmap -e "keycode 22 = BackSpace" But then it may happen that you can no longer issue a Ctrl-Alt-BackSpace to finalize your X (till you end this session and start another, since nothing was permanently saved here). To solve this issue I suggest checking conflicts between xkb and xmodmap. ---------- resolution: -> wont fix status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 21:10:30 2009 From: report at bugs.python.org (Georg Brandl) Date: Fri, 02 Jan 2009 20:10:30 +0000 Subject: [issue4808] doc issue for threading module (name/daemon properties) In-Reply-To: <1230908113.29.0.280160311198.issue4808@psf.upfronthosting.co.za> Message-ID: <1230927030.57.0.548975584742.issue4808@psf.upfronthosting.co.za> Georg Brandl added the comment: OK, moved the old methods below the new properties in r68170. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 21:15:19 2009 From: report at bugs.python.org (Gabriel Genellina) Date: Fri, 02 Jan 2009 20:15:19 +0000 Subject: [issue4811] invalid reST markup in several documents In-Reply-To: <1230927319.41.0.991139894945.issue4811@psf.upfronthosting.co.za> Message-ID: <1230927319.41.0.991139894945.issue4811@psf.upfronthosting.co.za> New submission from Gabriel Genellina : Several documents contain invalid reST markup that "leaks" into the html output (missing ``, incorrect indentation, etc.) This patch fixes the obvious ones. ---------- assignee: georg.brandl components: Documentation files: invalid-doc-markup.diff keywords: patch messages: 78866 nosy: gagenellina, georg.brandl severity: normal status: open title: invalid reST markup in several documents versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1 Added file: http://bugs.python.org/file12543/invalid-doc-markup.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 21:16:42 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Fri, 02 Jan 2009 20:16:42 +0000 Subject: [issue2827] IDLE 3.0a5 cannot handle UTF-8 In-Reply-To: <1210546189.14.0.555715055472.issue2827@psf.upfronthosting.co.za> Message-ID: <1230927402.79.0.859128453563.issue2827@psf.upfronthosting.co.za> Martin v. L?wis added the comment: This is now fixed in r68022. ---------- nosy: +loewis resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 21:20:16 2009 From: report at bugs.python.org (Georg Brandl) Date: Fri, 02 Jan 2009 20:20:16 +0000 Subject: [issue4614] Document PyModule_Create() In-Reply-To: <1228856807.3.0.093975807386.issue4614@psf.upfronthosting.co.za> Message-ID: <1230927616.68.0.542696236314.issue4614@psf.upfronthosting.co.za> Georg Brandl added the comment: Attaching a doc patch -- Martin, could you please confirm that I didn't write nonsense? ---------- assignee: -> loewis keywords: +patch Added file: http://bugs.python.org/file12544/new-module-apis.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 21:23:05 2009 From: report at bugs.python.org (Guilherme Polo) Date: Fri, 02 Jan 2009 20:23:05 +0000 Subject: [issue1482122] Shift+Backspace exhibits odd behavior Message-ID: <1230927785.5.0.53380861438.issue1482122@psf.upfronthosting.co.za> Guilherme Polo added the comment: Just for future reference it is now on http://tkinter.unpy.net/wiki/Linux_Shift-Backspace _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 21:25:39 2009 From: report at bugs.python.org (Georg Brandl) Date: Fri, 02 Jan 2009 20:25:39 +0000 Subject: [issue4811] invalid reST markup in several documents In-Reply-To: <1230927319.41.0.991139894945.issue4811@psf.upfronthosting.co.za> Message-ID: <1230927939.23.0.0377056525462.issue4811@psf.upfronthosting.co.za> Georg Brandl added the comment: Many thanks! Applied in r68171. Did you find those yourself, or with some sort of tool? ---------- resolution: -> accepted status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 21:26:58 2009 From: report at bugs.python.org (Skip Montanaro) Date: Fri, 02 Jan 2009 20:26:58 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230325778.98.0.752974375077.issue4753@psf.upfronthosting.co.za> Message-ID: <1230928018.0.0.899207248331.issue4753@psf.upfronthosting.co.za> Skip Montanaro added the comment: OK, I think I'm misreading the output of pybench. Let me reset. Ignore anything I've written previously on this topic. Instead, I will just post the output of my pybench comparison runs and let more expert people interpret as appropriate. The first file is the result of the run on PowerPC (Mac G5). Added file: http://bugs.python.org/file12545/pybench.sum.PPC _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 21:27:55 2009 From: report at bugs.python.org (Skip Montanaro) Date: Fri, 02 Jan 2009 20:27:55 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230325778.98.0.752974375077.issue4753@psf.upfronthosting.co.za> Message-ID: <1230928075.39.0.719545310432.issue4753@psf.upfronthosting.co.za> Skip Montanaro added the comment: The next is the result of running on my MacBook Pro (Intel Core 2 Duo). Added file: http://bugs.python.org/file12546/pybench.sum.Intel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 21:33:18 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Fri, 02 Jan 2009 20:33:18 +0000 Subject: [issue4075] Use WCHAR variant of OutputDebugString In-Reply-To: <1223471607.48.0.166278298943.issue4075@psf.upfronthosting.co.za> Message-ID: <1230928398.93.0.891352801504.issue4075@psf.upfronthosting.co.za> Martin v. L?wis added the comment: Thanks for the patch. Committed as r68172. ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 21:40:32 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Fri, 02 Jan 2009 20:40:32 +0000 Subject: [issue4051] UNICODE macro in cPickle conflicts with Windows define In-Reply-To: <1223288926.88.0.428745871562.issue4051@psf.upfronthosting.co.za> Message-ID: <1230928832.18.0.890643259267.issue4051@psf.upfronthosting.co.za> Martin v. L?wis added the comment: Thanks for the patch. Committed as r68173. ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 21:44:15 2009 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 02 Jan 2009 20:44:15 +0000 Subject: [issue4796] Decimal to receive from_float method In-Reply-To: <1230764359.55.0.955763939043.issue4796@psf.upfronthosting.co.za> Message-ID: <1230929055.51.0.462955688035.issue4796@psf.upfronthosting.co.za> Raymond Hettinger added the comment: > once you've converted your float to Decimal it's trivial > to round it to whatever precision you feel like, so #2 > seems unnecessary to me. Agree with Mark on how to control rounding. The DecimalWay(tm) is that used by Context.create_decimal(). A second argument is problematic for two reasons. First, it demands that some rounding take place but doesn't let you control the rounding method or signal an Inexact conversion -- you need a context for that. Second, the API for decimal is already somewhat complex and we don't want to make it worse by introducing a new variant with a second argument that has no parallel elsewhere in the API. Also agree with Mark regarding Decimal.from_float() which needs to be lossless and exact. It parallels fractions.from_float() which does the same thing for rationals. The DecimalWay(tm) is to have Decimal constructors be exact and to use Context based constructors when rounding is desired. I'll submit a patch to this effect (unless someone beats me to it). _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 21:57:15 2009 From: report at bugs.python.org (Guilherme Polo) Date: Fri, 02 Jan 2009 20:57:15 +0000 Subject: [issue1135] xview/yview of Tix.Grid is broken In-Reply-To: <1189314445.29.0.484479560219.issue1135@psf.upfronthosting.co.za> Message-ID: <1230929835.46.0.72373290614.issue1135@psf.upfronthosting.co.za> Guilherme Polo added the comment: I would actually prefer to move xview and yview method to classes like it was done in xview_yview.patch (I've done this on a personal branch some time ago too, but named them as XScroll, YScroll), we can see they are used in several places in Tkinter, Tix and other extensions, and we are just duplicating code for them all the time. Also, what I would prefer to see in place of this: if not args: return self._getdoubles(self.tk.call(self._w, 'xview')) self.tk.call((self._w, 'xview') + args) would be this: res = self.tk.call(self._w, 'xview', *args) if args: return self._getdoubles(res) ---------- nosy: +gpolo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 22:04:18 2009 From: report at bugs.python.org (Pavel Kosina) Date: Fri, 02 Jan 2009 21:04:18 +0000 Subject: [issue2827] IDLE 3.0a5 cannot handle UTF-8 In-Reply-To: <1210546189.14.0.555715055472.issue2827@psf.upfronthosting.co.za> Message-ID: <1230930258.88.0.618289224688.issue2827@psf.upfronthosting.co.za> Pavel Kosina added the comment: Thank you. Not sure, what to do now, cause the putting down of IDLE is fixed, but still within IDLE I get wrong output: x="?????????" print (x) >>> ?????????????????? when running this script under python command line form another editor, I get the output readable as expected. Shall I open another issue? Added file: http://bugs.python.org/file12547/q.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 22:18:58 2009 From: report at bugs.python.org (Giampaolo Rodola') Date: Fri, 02 Jan 2009 21:18:58 +0000 Subject: [issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0) In-Reply-To: <1230728461.13.0.270652897235.issue4791@psf.upfronthosting.co.za> Message-ID: <1230931138.88.0.294171668038.issue4791@psf.upfronthosting.co.za> Changes by Giampaolo Rodola' : ---------- nosy: +giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 22:21:33 2009 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 02 Jan 2009 21:21:33 +0000 Subject: [issue4615] de-duping function in itertools In-Reply-To: <1228877279.97.0.446063330744.issue4615@psf.upfronthosting.co.za> Message-ID: <1230931293.65.0.860904659412.issue4615@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Added recipes to the itertools docs: r68177 . ---------- resolution: -> accepted status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 22:28:38 2009 From: report at bugs.python.org (Giampaolo Rodola') Date: Fri, 02 Jan 2009 21:28:38 +0000 Subject: [issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0) In-Reply-To: <1230728461.13.0.270652897235.issue4791@psf.upfronthosting.co.za> Message-ID: <1230931718.61.0.230637741805.issue4791@psf.upfronthosting.co.za> Giampaolo Rodola' added the comment: I'm unable to reproduce the issue. Could you please repeat the test by using the "timeout" parameter as such? < ftp = ftplib.FTP('ftp.edgecastcdn.net', user='theusername', passwd='thepassword') > ftp = ftplib.FTP('ftp.edgecastcdn.net', user='theusername', passwd='thepassword', timeout=2) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 22:30:43 2009 From: report at bugs.python.org (Senthil) Date: Fri, 02 Jan 2009 21:30:43 +0000 Subject: [issue4608] urllib.request.urlopen does not return an iterable object In-Reply-To: <1228824822.91.0.748607079368.issue4608@psf.upfronthosting.co.za> Message-ID: <1230931843.41.0.170339991371.issue4608@psf.upfronthosting.co.za> Senthil added the comment: Jakub, I have attached a revision to the patch. You are right, when __iter__ returns self.fp (as in previous patch), the __next__ is superflous. But, I was thinking of __iter__ returning an instance of addbase, instead of self.fp and in that case __next__ was required. But I see that i had not changed self.fp to self. This is implemented in the similar lines of IOBase class, io.py w.r.t to your other comment, why do you think __next__ implementation is incorrect? Thanks, Senthil Added file: http://bugs.python.org/file12548/issue4608_py31-v2.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 22:38:53 2009 From: report at bugs.python.org (David Watson) Date: Fri, 02 Jan 2009 21:38:53 +0000 Subject: [issue3023] Problem with invalidly-encoded command-line arguments (Unix) In-Reply-To: <1212358937.18.0.778474192325.issue3023@psf.upfronthosting.co.za> Message-ID: <1230932333.8.0.834610747321.issue3023@psf.upfronthosting.co.za> David Watson added the comment: @ Victor Stinner: Yes, the behaviour of those functions is as you describe - it's been changed since I filed this issue. I do consider it an improvement. By the password database, I mean /etc/passwd or replacements that are accessible via getpwnam() and friends. Users are often allowed to change things like the GECOS field, and can generally stick any old junk in there, regardless of encoding. Now that I come to check, it seems that in the Python 3.0 release, the pwd.* functions do raise UnicodeDecodeError when the GECOS field can't be decoded (bizarrely, they try to interpret it as a Python string literal, and thus choke on invalid backslash escapes). Unfortunately, this allows a user to change their GECOS field so that system programs written in Python can't determine the username corresponding to that user's UID or vice versa. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 22:47:37 2009 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 02 Jan 2009 21:47:37 +0000 Subject: [issue1402289] Allow mappings as globals (was: Fix dictionary subclass ...) Message-ID: <1230932857.05.0.568650957078.issue1402289@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Haven't had a chance to work on this one. Unassigning. ---------- assignee: rhettinger -> versions: +Python 2.7, Python 3.1 -Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 22:49:10 2009 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 02 Jan 2009 21:49:10 +0000 Subject: [issue980098] Module to dynamically generate structseq objects Message-ID: <1230932950.11.0.29731648397.issue980098@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I agree with Georg. ---------- resolution: -> rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 22:49:34 2009 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 02 Jan 2009 21:49:34 +0000 Subject: [issue1820] Enhance Object/structseq.c to match namedtuple and tuple api In-Reply-To: <1200284428.58.0.762384814897.issue1820@psf.upfronthosting.co.za> Message-ID: <1230932974.45.0.668064921108.issue1820@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- versions: +Python 2.7, Python 3.1 -Python 2.6, Python 3.0 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 22:50:18 2009 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 02 Jan 2009 21:50:18 +0000 Subject: [issue1533] Bug in range() function for large values In-Reply-To: <1196468890.07.0.55666875231.issue1533@psf.upfronthosting.co.za> Message-ID: <1230933018.43.0.382707755139.issue1533@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- assignee: rhettinger -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 22:50:48 2009 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 02 Jan 2009 21:50:48 +0000 Subject: [issue4793] Glossary incorrectly describes a decorator as "merely syntactic sugar" In-Reply-To: <1230749976.35.0.878652242005.issue4793@psf.upfronthosting.co.za> Message-ID: <1230933048.07.0.185859184631.issue4793@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Based on my reading of the pydev discussion, the doc correctly describes the design intent. If there is any bug, it is in the optimization of skipping the apparently redundant first name binding. I presume the thinking was that since the decorator gets the function as an input, there is no sensible need to access it again via its name. A conforming implementation should be free to not do this optimization, but to simply make the easy and obvious translation. ---------- nosy: +tjreedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 22:51:17 2009 From: report at bugs.python.org (Pavel Kosina) Date: Fri, 02 Jan 2009 21:51:17 +0000 Subject: [issue2827] IDLE 3.0a5 cannot handle UTF-8 In-Reply-To: <1210546189.14.0.555715055472.issue2827@psf.upfronthosting.co.za> Message-ID: <1230933077.65.0.529321541026.issue2827@psf.upfronthosting.co.za> Pavel Kosina added the comment: Moreover: do you think its good idea to change the file encoding at opened and then saved file without any question when there is no encoding declaration? :-( Users do not edit just python programs, they can edit also config files, text files, etc .... It could be that at first saving we are asked to use *utf8 *used one. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 22:51:31 2009 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 02 Jan 2009 21:51:31 +0000 Subject: [issue4705] python3.0 -u: unbuffered stdout In-Reply-To: <1229780843.45.0.259077303406.issue4705@psf.upfronthosting.co.za> Message-ID: <1230933091.47.0.0538773739319.issue4705@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Instead of importing IO each time in create_stdio, maybe you should just pass io.open to create_stdio. ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 22:55:35 2009 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 02 Jan 2009 21:55:35 +0000 Subject: [issue2827] IDLE 3.0a5 cannot handle UTF-8 In-Reply-To: <1210546189.14.0.555715055472.issue2827@psf.upfronthosting.co.za> Message-ID: <1230933335.0.0.754245099986.issue2827@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Well, if you're still using 3.0, it's not patched yet. :) ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 22:57:43 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Fri, 02 Jan 2009 21:57:43 +0000 Subject: [issue2827] IDLE 3.0a5 cannot handle UTF-8 In-Reply-To: <1230930258.88.0.618289224688.issue2827@psf.upfronthosting.co.za> Message-ID: <495E8DD5.7060806@v.loewis.de> Martin v. L?wis added the comment: > Thank you. Not sure, what to do now, cause the putting down of IDLE is > fixed, but still within IDLE I get wrong output: In general, when a reported issue is closed, and you have a further issue, the right thing is to report this as a new issue, rather than following up on closed one. In the specific case, I believe you are referring to issue 4008, and its duplicates #4410, and #4623. There might be more duplicate reports, so no need to report yet another one. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 23:02:30 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Fri, 02 Jan 2009 22:02:30 +0000 Subject: [issue3023] Problem with invalidly-encoded command-line arguments (Unix) In-Reply-To: <1230932333.8.0.834610747321.issue3023@psf.upfronthosting.co.za> Message-ID: <495E8EF4.6050006@v.loewis.de> Martin v. L?wis added the comment: > By the password database, I mean /etc/passwd or replacements that > are accessible via getpwnam() and friends. Please only discuss one issue at the time in the bug tracker. This issue is about "invalidly-encoded command-line arguments", not about the password database. If you want to report an issue with the password database, please do so in a separate report. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 23:05:59 2009 From: report at bugs.python.org (Mark Hammond) Date: Fri, 02 Jan 2009 22:05:59 +0000 Subject: [issue4566] 2.6.1 breaks many applications that embed Python on Windows In-Reply-To: <1228577334.37.0.676469955994.issue4566@psf.upfronthosting.co.za> Message-ID: <1230933959.46.0.424643093509.issue4566@psf.upfronthosting.co.za> Changes by Mark Hammond : Removed file: http://bugs.python.org/file12537/bug4566.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 23:07:24 2009 From: report at bugs.python.org (Mark Hammond) Date: Fri, 02 Jan 2009 22:07:24 +0000 Subject: [issue4566] 2.6.1 breaks many applications that embed Python on Windows In-Reply-To: <1228577334.37.0.676469955994.issue4566@psf.upfronthosting.co.za> Message-ID: <1230934044.57.0.32856162272.issue4566@psf.upfronthosting.co.za> Mark Hammond added the comment: Uploading a corrected patch; some old docs I saw said DWORD, and I obviously neglected to fix every spot I used that, and I've changed 'Vista' to 'XP' in the patch comments. Added file: http://bugs.python.org/file12549/bug4566.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 23:08:13 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Fri, 02 Jan 2009 22:08:13 +0000 Subject: [issue2827] IDLE 3.0a5 cannot handle UTF-8 In-Reply-To: <1230933077.65.0.529321541026.issue2827@psf.upfronthosting.co.za> Message-ID: <495E9049.3030509@v.loewis.de> Martin v. L?wis added the comment: > Moreover: do you think its good idea to change the file encoding at > opened and then saved file without any question when there is no > encoding declaration? See my previous comment: one issue at a time. This issue was about code that IDLE 3.0a5 cannot parse, but IDLE 3.0 can. If you have a further issue with the proposed solution, please report it separately. > Users do not edit just python programs, they > can edit also config files, text files, etc .... I don't think IDLE was designed to support editing any other files. I would be opposed to adding user interface relevant only for editing non-Python text files. If IDLE would assume a different encoding at save time than was assumed at load time, this might be still considered a bug; you would need to provide detailed instructions to reproduce such a bug. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 23:21:28 2009 From: report at bugs.python.org (Mark Hammond) Date: Fri, 02 Jan 2009 22:21:28 +0000 Subject: [issue4804] Python on Windows disables all C runtime library assertions In-Reply-To: <1230869380.06.0.720418986656.issue4804@psf.upfronthosting.co.za> Message-ID: <1230934888.56.0.34612443196.issue4804@psf.upfronthosting.co.za> Mark Hammond added the comment: Can anyone point me at a test that failed in this case? A quick look over winsig.c shows no asserts. I didn't compare the vs2005 crt source though, so its highly likely I just missed it... On the broader point, it could be argued that if it is the apps responsibility to re-enable assertions, it is also the apps responsibility to disable them in the first place. If other libraries on the system attempted the same as Python, it would obviously be undefined if Python's attempt had any actual affect - the last called would win. As we found with the old locale() issues, we really can't rely on Python setting a global shared state to keep things nice. From a pragmatic POV, if we know the MS crt asserts on certain constants signal numbers, can't we just avoid passing those numbers? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 23:31:05 2009 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 02 Jan 2009 22:31:05 +0000 Subject: [issue4812] Junk in the decimals namespace In-Reply-To: <1230935465.8.0.0565784557984.issue4812@psf.upfronthosting.co.za> Message-ID: <1230935465.8.0.0565784557984.issue4812@psf.upfronthosting.co.za> New submission from Raymond Hettinger : In r59144 , a bunch of internal-use constants were dumped in the main namespace. These all need to be prefixed with an underscore. They should be fixed right-away before people start using them. Since they are externally undocumented and since the internal notes describe them as being only for internal-use, I think this can go in as a bugfix. ---------- assignee: facundobatista components: Library (Lib) messages: 78893 nosy: facundobatista, rhettinger priority: high severity: normal status: open title: Junk in the decimals namespace versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 23:35:13 2009 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 02 Jan 2009 22:35:13 +0000 Subject: [issue4812] Junk in the decimals namespace In-Reply-To: <1230935465.8.0.0565784557984.issue4812@psf.upfronthosting.co.za> Message-ID: <1230935713.04.0.736686900254.issue4812@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Mark, it looks like r59144 merely moved these around and that they existed beforehand. Can we go ahead and get them renamed? They are defeating the extensive efforts we've made to keep that namespace free of anything that isn't part of the documented spec. ---------- assignee: facundobatista -> marketdickinson nosy: +marketdickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 23:35:32 2009 From: report at bugs.python.org (Guilherme Polo) Date: Fri, 02 Jan 2009 22:35:32 +0000 Subject: [issue1581476] Text search gives bad count if called from variable trace Message-ID: <1230935732.8.0.763589014286.issue1581476@psf.upfronthosting.co.za> Guilherme Polo added the comment: Fixed the issue now. _tkinter.call needs to use the TCL_EVAL_GLOBAL flag since all the variables in Tkinter are global variables. Matthias: your issue about the pattern should be placed in a different issue. ---------- keywords: +patch versions: +Python 2.6, Python 2.7, Python 3.0, Python 3.1 -Python 2.4 Added file: http://bugs.python.org/file12550/issue_1581476.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 23:45:18 2009 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 02 Jan 2009 22:45:18 +0000 Subject: [issue4751] Patch for better thread support in hashlib In-Reply-To: <1230298756.92.0.632482701363.issue4751@psf.upfronthosting.co.za> Message-ID: <1230936318.78.0.61097220207.issue4751@psf.upfronthosting.co.za> Gregory P. Smith added the comment: First: thanks for doing this. I've had a patch sitting in my own sandbox to release the GIL while hashing for a while but I hadn't finished testing it. It looks pretty similar to what you've done so lets go with the patch being developed in this issue. Rather than making HASHLIB_GIL_MINSIZE a constant I suggest making it a property of the hash object so that it can be set by the user. Most users will be fine with the default but depending upon the application, platform and hash algorithm being used other values may make more sense. ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 23:50:04 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Fri, 02 Jan 2009 22:50:04 +0000 Subject: [issue4804] Python on Windows disables all C runtime library assertions In-Reply-To: <1230934888.56.0.34612443196.issue4804@psf.upfronthosting.co.za> Message-ID: <495E9A18.4060706@v.loewis.de> Martin v. L?wis added the comment: > Can anyone point me at a test that failed in this case? See issue 1350409 (and subsequently #1167262 and #1311784). Python fails to start when assertions are turned on (haven't tested for VS 2008, though). If you were looking for a test case that fails specifically - there might none. However, try Amaury's example. > On the broader point, it could be argued that if it is the apps > responsibility to re-enable assertions, it is also the apps > responsibility to disable them in the first place. Ideally, assertions should be enabled in debug builds, and disabled in release builds, and there should be no runtime configuration. Unfortunately, Microsoft chose to add bogus assertions, so this general rule is useless within the context of MSC. (it's not just that the signal issue is a standards violation. Assuming that _close apparently follows POSIX close, it should always set errno to EBADF for a double-close, rather than raising an assertion. It is conforming in release mode, but loses conformance in debug mode) > From > a pragmatic POV, if we know the MS crt asserts on certain constants > signal numbers, can't we just avoid passing those numbers? It's the other way 'round: it rejects all but a list of known signals. Still, it would be possible to hack around - one such hack is currently implemented. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 2 23:57:08 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 02 Jan 2009 22:57:08 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230928018.0.0.899207248331.issue4753@psf.upfronthosting.co.za> Message-ID: <1230937035.9067.29.camel@localhost> Antoine Pitrou added the comment: > OK, I think I'm misreading the output of pybench. Let me reset. Ignore > anything I've written previously on this topic. Instead, I will just > post the output of my pybench comparison runs and let more expert people > interpret as appropriate. The first file is the result of the run on > PowerPC (Mac G5). Ok, so the threaded version is actually faster by 20% on your PPC, and slower by 5% on your Core 2 Duo. Thanks for doing the measurements! _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 00:03:16 2009 From: report at bugs.python.org (Skip Montanaro) Date: Fri, 02 Jan 2009 23:03:16 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230937035.9067.29.camel@localhost> Message-ID: <18782.40240.905009.93554@montanaro-dyndns-org.local> Skip Montanaro added the comment: Antoine> Ok, so the threaded version is actually faster by 20% on your Antoine> PPC, and slower by 5% on your Core 2 Duo. Thanks for doing the Antoine> measurements! Confirmed by pystone runs as well. Sorry for the earlier misdirection. Skip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 00:09:42 2009 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 02 Jan 2009 23:09:42 +0000 Subject: [issue4812] Junk in the decimals namespace In-Reply-To: <1230935465.8.0.0565784557984.issue4812@psf.upfronthosting.co.za> Message-ID: <1230937782.56.0.368028704047.issue4812@psf.upfronthosting.co.za> Mark Dickinson added the comment: I assume you're referring to Dec_0 and friends? Fixed in the trunk in r68182. Leaving open until I get the chance to merge it to the other branches. ---------- resolution: -> fixed versions: -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 00:22:47 2009 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 02 Jan 2009 23:22:47 +0000 Subject: [issue4812] Junk in the decimals namespace In-Reply-To: <1230935465.8.0.0565784557984.issue4812@psf.upfronthosting.co.za> Message-ID: <1230938567.04.0.760106519475.issue4812@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Thanks. BTW, my preferred new names are _One _Zero and _NegativeOne. Names like dec_n1 are cryptic in places other than where they're defined. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 00:34:04 2009 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 02 Jan 2009 23:34:04 +0000 Subject: [issue4812] Junk in the decimals namespace In-Reply-To: <1230935465.8.0.0565784557984.issue4812@psf.upfronthosting.co.za> Message-ID: <1230939244.65.0.95874288202.issue4812@psf.upfronthosting.co.za> Mark Dickinson added the comment: Fine. Will re-rename in the morning. Are _Inf, _negInf, _NaN and _Infsign okay as they are? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 00:36:50 2009 From: report at bugs.python.org (Gabriel Genellina) Date: Fri, 02 Jan 2009 23:36:50 +0000 Subject: [issue4811] invalid reST markup in several documents In-Reply-To: <1230927319.41.0.991139894945.issue4811@psf.upfronthosting.co.za> Message-ID: <1230939410.1.0.996980305751.issue4811@psf.upfronthosting.co.za> Gabriel Genellina added the comment: I did a search on the .html files using a regular expression, and manually filtered out the false positives. The expression used was this "::[^=]|:[a-zA-Z][a-zA-Z0-9]+|`|\.\.\s*\w +:" I'll try to come up with a useable tool. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 00:42:19 2009 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Jan 2009 23:42:19 +0000 Subject: [issue4705] python3.0 -u: unbuffered stdout In-Reply-To: <1229780843.45.0.259077303406.issue4705@psf.upfronthosting.co.za> Message-ID: <1230939739.49.0.772930011382.issue4705@psf.upfronthosting.co.za> Changes by STINNER Victor : Removed file: http://bugs.python.org/file12477/unbufferedstdout-2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 00:50:06 2009 From: report at bugs.python.org (Mitchell Model) Date: Fri, 02 Jan 2009 23:50:06 +0000 Subject: [issue4813] On OS-X the directories searched by setup.py for Tk are in the wrong order. In-Reply-To: <1230940206.74.0.201449731913.issue4813@psf.upfronthosting.co.za> Message-ID: <1230940206.74.0.201449731913.issue4813@psf.upfronthosting.co.za> New submission from Mitchell Model : In function detect_tkinter_darwin of setup.py framework_dirs should be the reverse of what it is: first the user's library should be searched, then /Library, and finally /System/Library. If Tk 8.5 is installed in /Library or ~/Library make will otherwise find the headers from 8.4 but the libraries from 8.5. Issue 4017 discusses this problem, among others, and is marked fixed, but it is still incorrect in the 2.6 and 3.0 downloads as well as in the trunk, 3.0, and 3.1 subversion repositories. It may have been "fixed" in so far as someone was able to make a .dmg by manually altering setup.py, and that's great, but it isn't fixed in the source and the problem will reappear with each new version. ---------- components: Build messages: 78904 nosy: MLModel severity: normal status: open title: On OS-X the directories searched by setup.py for Tk are in the wrong order. type: compile error versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 00:50:56 2009 From: report at bugs.python.org (ebfe) Date: Fri, 02 Jan 2009 23:50:56 +0000 Subject: [issue4751] Patch for better thread support in hashlib In-Reply-To: <1230298756.92.0.632482701363.issue4751@psf.upfronthosting.co.za> Message-ID: <1230940256.41.0.926530895119.issue4751@psf.upfronthosting.co.za> ebfe added the comment: I don't think so. The interface should stay simple - python has very few such magic knobs. People will optimize for their own box as you said - and that code will run worse on all the others... Besides, we've lived so long with single-threaded openssl. Let's make HASHLIB_GIL_MINSIZE such that there is no risk of additional overhead introduced by this patch and refer to it's current value in the hashlib-module's documentation. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 00:58:49 2009 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Jan 2009 23:58:49 +0000 Subject: [issue3023] Problem with invalidly-encoded command-line arguments (Unix) In-Reply-To: <1230932333.8.0.834610747321.issue3023@psf.upfronthosting.co.za> Message-ID: <200901030059.16522.victor.stinner@haypocalc.com> STINNER Victor added the comment: > By the password database, I mean /etc/passwd or replacements that > are accessible via getpwnam() and friends. Users are often > allowed to change things like the GECOS field, and can generally > stick any old junk in there, regardless of encoding. I started to patch pwd module to return bytes instead of unicode, but I didn't finished my work and the lost it :-/ Today, most UNIX uses UTF-8 as the default charset. About GECOS: is it really used? If you have real problems, open a new issue as proposed by Martin. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 01:01:56 2009 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 03 Jan 2009 00:01:56 +0000 Subject: [issue4812] Junk in the decimals namespace In-Reply-To: <1230935465.8.0.0565784557984.issue4812@psf.upfronthosting.co.za> Message-ID: <1230940916.05.0.127989267364.issue4812@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Let's spell them out: _Infinity, _NegativeInfinity, _NaN, and _SignedInfinity. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 01:13:26 2009 From: report at bugs.python.org (pmoody) Date: Sat, 03 Jan 2009 00:13:26 +0000 Subject: [issue3959] Add Google's ipaddr.py to the stdlib In-Reply-To: <495E42F1.9000906@v.loewis.de> Message-ID: <8517e9350901021613m44082a53g3676652612693fc1@mail.gmail.com> pmoody added the comment: > That is not sufficient for inclusion to Python. We also want support > from the author (along with a promise to eventually give up the external > project). As Guido had mentioned in a previous message, this is along the lines of my thinking wrt ipaddr. Cheers, /peter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 01:32:11 2009 From: report at bugs.python.org (ebfe) Date: Sat, 03 Jan 2009 00:32:11 +0000 Subject: [issue4751] Patch for better thread support in hashlib In-Reply-To: <1230298756.92.0.632482701363.issue4751@psf.upfronthosting.co.za> Message-ID: <1230942731.86.0.427818216077.issue4751@psf.upfronthosting.co.za> ebfe added the comment: haypo, the patch will not compile when WITH_THREADS is not defined. The 'lock'-member in the object structure is not present without WITH_THREADS however the line 'if (self->lock == NULL && view.len >= HASHLIB_GIL_MINSIZE)' will always refer to it. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 01:45:29 2009 From: report at bugs.python.org (Alexandre Vassalotti) Date: Sat, 03 Jan 2009 00:45:29 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230325778.98.0.752974375077.issue4753@psf.upfronthosting.co.za> Message-ID: <1230943529.41.0.969700026517.issue4753@psf.upfronthosting.co.za> Alexandre Vassalotti added the comment: The patch make a huge difference on 64-bit Linux. I get a 20% speed-up and the lowest run time so far. That is quite impressive! At first glance, it seems the extra registers of the x86-64 architecture permit GCC to avoid spilling registers onto the stack (see assembly just below). However, I don't know why the speed up due to the patch is much more significant on x86-64 than on x86. This is the x86 assembly generated by GCC 4.3 (annotated and slightly edited for readability): movl -440(%ebp), %eax # tmp = next_instr movl $145, %esi # opcode = LIST_APPEND movl 8(%ebp), %ecx # f subl -408(%ebp), %eax # tmp -= first_instr movl %eax, 60(%ecx) # f->f_lasti = tmp movl -440(%ebp), %ebx # next_instr movzbl (%ebx), %eax # tmp = *next_instr addl $1, %ebx # next_instr++ movl %ebx, -440(%ebp) # next_instr movl opcode_targets(,%eax,4), %eax # tmp = opcode_targets[tmp] jmp *%eax # goto *tmp And this is the x86-64 assembly generated also by GCC 4.3: movl %r15d, %eax # tmp = next_instr subl 76(%rsp), %eax # tmp -= first_instr movl $145, %ebp # opcode = LIST_APPEND movl %eax, 120(%r14) # f->f_lasti = tmp movzbl (%r15), %eax # tmp = *next_instr addq $1, %r15 # next_instr++ movq opcode_targets(,%rax,8), %rax # tmp = opcode_targets[tmp] jmp *%rax # goto *tmp The above assemblies are equivalent to the following C code: opcode = LIST_APPEND; f->f_lasti = ((int)(next_instr - first_instr)); goto *opcode_targets[*next_instr++]; On the register-starved x86 architecture, the assembly has 4 stack load and 1 store operations. While on the x86-64 architecture, most variables are kept in registers thus it only uses 1 stack store operation. And from what I saw from the assemblies, the extra registers with the traditional switch dispatch aren't much used, especially with the opcode prediction macros which avoid manipulations of f->f_lasti. That said, I am glad to hear the patch makes Python on PowerPC faster, because this supports the hypothesis that extra registers are better used with indirect threading (PowerPC has 32 general-purpose registers). Added file: http://bugs.python.org/file12551/amd-athlon64-x2-64bit-pybench.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 01:48:08 2009 From: report at bugs.python.org (Alexandre Vassalotti) Date: Sat, 03 Jan 2009 00:48:08 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230325778.98.0.752974375077.issue4753@psf.upfronthosting.co.za> Message-ID: <1230943688.13.0.0315157723558.issue4753@psf.upfronthosting.co.za> Alexandre Vassalotti added the comment: One more thing, the patch causes the following warnings to be emited by GCC when USE_COMPUTED_GOTOS is undefined. Python/ceval.c: In function ?PyEval_EvalFrameEx?: Python/ceval.c:2420: warning: label ?_make_function? defined but not used Python/ceval.c:2374: warning: label ?_call_function_var_kw? defined but not used Python/ceval.c:2280: warning: label ?_setup_finally? defined but not used _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 01:52:14 2009 From: report at bugs.python.org (Giampaolo Rodola') Date: Sat, 03 Jan 2009 00:52:14 +0000 Subject: [issue4814] ftplib does not honour "timeout" parameter for active data connections In-Reply-To: <1230943934.69.0.609460387197.issue4814@psf.upfronthosting.co.za> Message-ID: <1230943934.69.0.609460387197.issue4814@psf.upfronthosting.co.za> New submission from Giampaolo Rodola' : When using the optional ftplib.FTP()'s timeout parameter which specifies a timeout in seconds for blocking operations like the connection attempt, it is applied on both FTP control and passive data channel (if any). It is not applied for active (PORT/EPRT) data connections. The patch in attachment modifies ftplib so that when ntransfer method is called in active mode, timeout is applied on the resulting data connection. ---------- files: ftplib.patch keywords: patch messages: 78912 nosy: giampaolo.rodola severity: normal status: open title: ftplib does not honour "timeout" parameter for active data connections versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1 Added file: http://bugs.python.org/file12552/ftplib.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 01:53:26 2009 From: report at bugs.python.org (STINNER Victor) Date: Sat, 03 Jan 2009 00:53:26 +0000 Subject: [issue4751] Patch for better thread support in hashlib In-Reply-To: <1230298756.92.0.632482701363.issue4751@psf.upfronthosting.co.za> Message-ID: <1230944006.66.0.53357007636.issue4751@psf.upfronthosting.co.za> STINNER Victor added the comment: About HASHLIB_GIL_MINSIZE, I'm unable to mesure the overhead. I tried timeit with 8190 and 8200 but the results are *very* close. I'm running Linux, it's maybe different on other OS. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 01:56:09 2009 From: report at bugs.python.org (Christopher Mahan) Date: Sat, 03 Jan 2009 00:56:09 +0000 Subject: [issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0) In-Reply-To: <1230728461.13.0.270652897235.issue4791@psf.upfronthosting.co.za> Message-ID: <1230944169.64.0.808282817298.issue4791@psf.upfronthosting.co.za> Christopher Mahan added the comment: Per Giampaolo's suggestion, I added the timeout. Program listing and output below: -----begin listing---- import ftplib ftp = ftplib.FTP('ftp.edgecastcdn.net', user='theusername', passwd='thepassword', timeout=2) ftp.set_debuglevel(3) ftp.cwd('chrismahan-675') ftp.dir() #ftp.retrlines('LIST') ftp.close() ----end listing---- *cmd* 'CWD chrismahan-675' *put* 'CWD chrismahan-675\r\n' *get* '250 CWD command successful\n' *resp* '250 CWD command successful' *cmd* 'TYPE A' *put* 'TYPE A\r\n' *get* '200 Type set to A\n' *resp* '200 Type set to A' *cmd* 'PASV' *put* 'PASV\r\n' *get* '227 Entering Passive Mode (72,21,82,190,172,22).\n' *resp* '227 Entering Passive Mode (72,21,82,190,172,22).' *cmd* 'LIST' *put* 'LIST\r\n' *get* '150 Opening ASCII mode data connection for file list\n' *resp* '150 Opening ASCII mode data connection for file list' *retr* '-rwxrwxrwx 1 nobody nogroup 3905538 Dec 29 09:51 Bronski Beat - Why.mp3\n' -rwxrwxrwx 1 nobody nogroup 3905538 Dec 29 09:51 Bronski Beat - Why.mp3 *retr* '-rwxrwxrwx 1 nobody nogroup 873966 Dec 28 13:53 test9.avi\n' -rwxrwxrwx 1 nobody nogroup 873966 Dec 28 13:53 test9.avi *retr* '-rwxrwxrwx 1 nobody nogroup 2512653 Dec 29 08:28 test9_lg.wmv\n' -rwxrwxrwx 1 nobody nogroup 2512653 Dec 29 08:28 test9_lg.wmv *retr* '-rwxrwxrwx 1 nobody nogroup 6549 Dec 29 08:28 test9_lg.wmv.jpg\n' -rwxrwxrwx 1 nobody nogroup 6549 Dec 29 08:28 test9_lg.wmv.jpg *retr* '-rwxrwxrwx 1 nobody nogroup 1788466 Dec 29 03:04 test9_med.flv\n' -rwxrwxrwx 1 nobody nogroup 1788466 Dec 29 03:04 test9_med.flv *retr* '-rwxrwxrwx 1 nobody nogroup 6394 Dec 29 03:04 test9_med.flv.jpg\n' -rwxrwxrwx 1 nobody nogroup 6394 Dec 29 03:04 test9_med.flv.jpg *retr* '-rwxrwxrwx 1 nobody nogroup 1263041 Dec 28 13:53 test9_sm.flv\n' -rwxrwxrwx 1 nobody nogroup 1263041 Dec 28 13:53 test9_sm.flv *retr* '-rwxrwxrwx 1 nobody nogroup 6465 Dec 28 13:53 test9_sm.flv.jpg\n' -rwxrwxrwx 1 nobody nogroup 6465 Dec 28 13:53 test9_sm.flv.jpg *retr* '' Traceback (most recent call last): File "C:\python_scripts\python3\candee_processor.py", line 6, in ftp.dir() File "c:\python30\lib\ftplib.py", line 511, in dir self.retrlines(cmd, func) File "c:\python30\lib\ftplib.py", line 433, in retrlines return self.voidresp() File "c:\python30\lib\ftplib.py", line 225, in voidresp resp = self.getresp() File "c:\python30\lib\ftplib.py", line 211, in getresp resp = self.getmultiline() File "c:\python30\lib\ftplib.py", line 197, in getmultiline line = self.getline() File "c:\python30\lib\ftplib.py", line 184, in getline line = self.file.readline() File "C:\Python30\lib\io.py", line 1813, in readline while self._read_chunk(): File "C:\Python30\lib\io.py", line 1560, in _read_chunk input_chunk = self.buffer.read1(self._CHUNK_SIZE) File "C:\Python30\lib\io.py", line 994, in read1 self._peek_unlocked(1) File "C:\Python30\lib\io.py", line 981, in _peek_unlocked current = self.raw.read(to_read) File "C:\Python30\lib\io.py", line 575, in read n = self.readinto(b) File "C:\Python30\lib\socket.py", line 214, in readinto return self._sock.recv_into(b) socket.timeout: timed out _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 01:59:21 2009 From: report at bugs.python.org (Skip Montanaro) Date: Sat, 03 Jan 2009 00:59:21 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230325778.98.0.752974375077.issue4753@psf.upfronthosting.co.za> Message-ID: <1230944361.69.0.636552690846.issue4753@psf.upfronthosting.co.za> Skip Montanaro added the comment: Alexandre's last comment reminded me I forgot to post the PPC assembler code. Next two files are the output as requested by Antoine. Added file: http://bugs.python.org/file12553/ceval.i.unthreaded _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 01:59:55 2009 From: report at bugs.python.org (STINNER Victor) Date: Sat, 03 Jan 2009 00:59:55 +0000 Subject: [issue4751] Patch for better thread support in hashlib In-Reply-To: <1230298756.92.0.632482701363.issue4751@psf.upfronthosting.co.za> Message-ID: <1230944395.46.0.462879597401.issue4751@psf.upfronthosting.co.za> STINNER Victor added the comment: > haypo, the patch will not compile when WITH_THREADS is not defined. Ooops, fixed (patch version 3). Added file: http://bugs.python.org/file12554/hashlibopenssl_small_lock-3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 02:00:51 2009 From: report at bugs.python.org (Skip Montanaro) Date: Sat, 03 Jan 2009 01:00:51 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230325778.98.0.752974375077.issue4753@psf.upfronthosting.co.za> Message-ID: <1230944451.66.0.545711575541.issue4753@psf.upfronthosting.co.za> Changes by Skip Montanaro : Added file: http://bugs.python.org/file12555/ceval.i.threaded _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 02:13:48 2009 From: report at bugs.python.org (Brett Cannon) Date: Sat, 03 Jan 2009 01:13:48 +0000 Subject: [issue4626] compile() doesn't ignore the source encoding when a string is passed in In-Reply-To: <1228976357.63.0.133847904092.issue4626@psf.upfronthosting.co.za> Message-ID: <1230945228.36.0.298587550738.issue4626@psf.upfronthosting.co.za> Brett Cannon added the comment: Here is what I have found out so far. Python/bltinmodule.c:builtin_compile takes in a PyObject and gets the char * representation of that object and passes it to Python/pythonrun.c:Py_CompileStringFlags. Unfortunately no other information is passed along in the call, including what the encoding happens to be. This is unfortunate as builtin_compile makes sure that the char* data is encoded using the default encoding before calling Py_CompileStringFlags. I just tried setting a PyCF flag to denote that the char* data is encoded using the default encoding, but Parser/tokenizer.c is not compiled against unicodeobject.c and thus one cannot use PyUnicode_GetDefaultEncoding() to know what the data is stored as. I'm going to try to explicitly convert to UTF-8 and see if that works. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 02:14:59 2009 From: report at bugs.python.org (STINNER Victor) Date: Sat, 03 Jan 2009 01:14:59 +0000 Subject: [issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0) In-Reply-To: <1230728461.13.0.270652897235.issue4791@psf.upfronthosting.co.za> Message-ID: <1230945299.15.0.911506327915.issue4791@psf.upfronthosting.co.za> STINNER Victor added the comment: The traceback shows that the problem is not related to the socket created to retrieve the content of the directory listing, but the "main" socket (the one used for the whole ftp session) used by dir() command the retrieve the command answer code: Traceback (most recent call last): ftp.dir() => self.retrlines(cmd, func) => return self.voidresp() => line = self.getline() => line = self.file.readline() (ftplib.py:184) ... socket.timeout: timed out I don't understand why the readline() blocks. It's maybe related to the newline: voidresp() uses getline() which reads a line using self.file. The file is created by self.sock.makefile('r', encoding=self.encoding) and so the newline is always \n whereas ftplib of Python2 uses \r\n (CRLF) or \n (LF). _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 02:16:14 2009 From: report at bugs.python.org (STINNER Victor) Date: Sat, 03 Jan 2009 01:16:14 +0000 Subject: [issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0) In-Reply-To: <1230728461.13.0.270652897235.issue4791@psf.upfronthosting.co.za> Message-ID: <1230945374.26.0.14459869644.issue4791@psf.upfronthosting.co.za> STINNER Victor added the comment: Christopher: Can you paste the full output with debuglevel=3 of Python 2.x (python2.5)? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 02:36:37 2009 From: report at bugs.python.org (Christopher Mahan) Date: Sat, 03 Jan 2009 01:36:37 +0000 Subject: [issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0) In-Reply-To: <1230728461.13.0.270652897235.issue4791@psf.upfronthosting.co.za> Message-ID: <1230946597.86.0.515334893136.issue4791@psf.upfronthosting.co.za> Christopher Mahan added the comment: When running scritp with python 2.5.4, got this error. I'll remove the "timeout=2" and run again. see below. Traceback (most recent call last): File "C:\python_scripts\python3\candee_processor.py", line 3, in ftp = ftplib.FTP('ftp.edgecastcdn.net', user='client1 at arcostream.com', passwd='1210184520', timeout=2) TypeError: __init__() got an unexpected keyword argument 'timeout' Same without the timeout argument: >>> *cmd* 'CWD chrismahan-675' *put* 'CWD chrismahan-675\r\n' *get* '250 CWD command successful\r\n' *resp* '250 CWD command successful' *cmd* 'TYPE A' *put* 'TYPE A\r\n' *get* '200 Type set to A\r\n' *resp* '200 Type set to A' *cmd* 'PASV' *put* 'PASV\r\n' *get* '227 Entering Passive Mode (72,21,82,190,228,195).\r\n' *resp* '227 Entering Passive Mode (72,21,82,190,228,195).' *cmd* 'LIST' *put* 'LIST\r\n' *get* '150 Opening ASCII mode data connection for file list\r\n' *resp* '150 Opening ASCII mode data connection for file list' *retr* '-rwxrwxrwx 1 nobody nogroup 3905538 Dec 29 09:51 Bronski Beat - Why.mp3\r\n' -rwxrwxrwx 1 nobody nogroup 3905538 Dec 29 09:51 Bronski Beat - Why.mp3 *retr* '-rwxrwxrwx 1 nobody nogroup 873966 Dec 28 13:53 test9.avi\r\n' -rwxrwxrwx 1 nobody nogroup 873966 Dec 28 13:53 test9.avi *retr* '-rwxrwxrwx 1 nobody nogroup 2512653 Dec 29 08:28 test9_lg.wmv\r\n' -rwxrwxrwx 1 nobody nogroup 2512653 Dec 29 08:28 test9_lg.wmv *retr* '-rwxrwxrwx 1 nobody nogroup 6549 Dec 29 08:28 test9_lg.wmv.jpg\r\n' -rwxrwxrwx 1 nobody nogroup 6549 Dec 29 08:28 test9_lg.wmv.jpg *retr* '-rwxrwxrwx 1 nobody nogroup 1788466 Dec 29 03:04 test9_med.flv\r\n' -rwxrwxrwx 1 nobody nogroup 1788466 Dec 29 03:04 test9_med.flv *retr* '-rwxrwxrwx 1 nobody nogroup 6394 Dec 29 03:04 test9_med.flv.jpg\r\n' -rwxrwxrwx 1 nobody nogroup 6394 Dec 29 03:04 test9_med.flv.jpg *retr* '-rwxrwxrwx 1 nobody nogroup 1263041 Dec 28 13:53 test9_sm.flv\r\n' -rwxrwxrwx 1 nobody nogroup 1263041 Dec 28 13:53 test9_sm.flv *retr* '-rwxrwxrwx 1 nobody nogroup 6465 Dec 28 13:53 test9_sm.flv.jpg\r\n' -rwxrwxrwx 1 nobody nogroup 6465 Dec 28 13:53 test9_sm.flv.jpg *retr* '' *get* '226 Transfer complete\r\n' *resp* '226 Transfer complete' >>> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 02:37:18 2009 From: report at bugs.python.org (Christian Heimes) Date: Sat, 03 Jan 2009 01:37:18 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230943529.41.0.969700026517.issue4753@psf.upfronthosting.co.za> Message-ID: <495EC14C.7010405@cheimes.de> Christian Heimes added the comment: > Alexandre Vassalotti added the comment: > The patch make a huge difference on 64-bit Linux. I get a 20% speed-up > and the lowest run time so far. That is quite impressive! I'm really, REALLY impressed by the speed up. Good work! I'm not an expert in this kind of optimizations. Could we gain more speed by making the dispatcher table more dense? Python has less than 128 opcodes (len(opcode.opmap) == 113) so they can be squeezed in a smaller table. I naively assume a smaller table increases the amount of cache hits. Christian _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 02:40:12 2009 From: report at bugs.python.org (STINNER Victor) Date: Sat, 03 Jan 2009 01:40:12 +0000 Subject: [issue4705] python3.0 -u: unbuffered stdout In-Reply-To: <1229780843.45.0.259077303406.issue4705@psf.upfronthosting.co.za> Message-ID: <1230946812.36.0.388326745255.issue4705@psf.upfronthosting.co.za> STINNER Victor added the comment: > Instead of importing IO each time in create_stdio, > maybe you should just pass io.open to create_stdio create_stdio() uses io.open() but also io.TextIOWrapper. Since io module is already imported in initstdio(), I updated the patch to just pass the pointer to the module to create_stdio(). Added file: http://bugs.python.org/file12556/unbufferedstdout-4.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 02:40:16 2009 From: report at bugs.python.org (STINNER Victor) Date: Sat, 03 Jan 2009 01:40:16 +0000 Subject: [issue4705] python3.0 -u: unbuffered stdout In-Reply-To: <1229780843.45.0.259077303406.issue4705@psf.upfronthosting.co.za> Message-ID: <1230946816.67.0.615037870769.issue4705@psf.upfronthosting.co.za> Changes by STINNER Victor : Removed file: http://bugs.python.org/file12478/unbufferedstdout-3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 02:51:47 2009 From: report at bugs.python.org (Paolo 'Blaisorblade' Giarrusso) Date: Sat, 03 Jan 2009 01:51:47 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230325778.98.0.752974375077.issue4753@psf.upfronthosting.co.za> Message-ID: <1230947507.57.0.625781170189.issue4753@psf.upfronthosting.co.za> Paolo 'Blaisorblade' Giarrusso added the comment: About miscompilations: the current patch is a bit weird for GCC, because you keep both the switch and the computed goto. But actually, there is no case in which the switch is needed, and computed goto give less room to GCC's choices. So, can you try dropping the switch altogether, using always computed goto and seeing how does the resulting code get compiled? I see you'll need two labels (before and after argument fetch) per opcode and two dispatch tabels, but that's no big deal (except for code alignment - align just the common branch target). An important warning is that by default, on my system, GCC 4.2 aligns branch targets for switch to a 16-byte boundary (as recommended by the Intel optimization guide), by adding a ".p2align 4,,7" GAS directive, and it does not do that for computed goto. Adding the directive by hand gave a small speedup, 2% I think; I should try -falign-jumps=16 if it's not enabled (some -falign-jumps is enabled by -O2), since that is supposed to give the same result. Please use that yourself as well, and verify it works for labels, even if I fear it doesn't. > However, I don't know why the speed up due to the patch is much more significant on x86-64 than on x86. It's Amdahl's law, even if this is not about parallel code. When the rest is faster (x86_64), the same speedup on dispatch gives a bigger overall speedup. To be absolutely clear: x86_64 has more registers, so the rest of the interpreter is faster than x86, but dispatch still takes the same absolute time, which is 70% on x86_64, but only 50% on x86 (those are realistic figures); if this patch halved dispatch time on both (we're not so lucky), we would save 35% on x86_64 but only 25% on x86. In fact, on inefficient interpreters, indirect threading is useless altogether. So, do those extra register help _so_ much? Yes. In my toy interpreter, computing last_i for each dispatch doesn't give any big slowdown, but storing it in f->last_i gives a ~20% slowdown - I cross-checked multiple times because I was astonished. Conversely, when the program counter had to be stored in memory, I think it was like 2x slower. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 03:02:06 2009 From: report at bugs.python.org (STINNER Victor) Date: Sat, 03 Jan 2009 02:02:06 +0000 Subject: [issue3959] Add Google's ipaddr.py to the stdlib In-Reply-To: <1222298050.73.0.172554962966.issue3959@psf.upfronthosting.co.za> Message-ID: <1230948126.61.0.66875700403.issue3959@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: -haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 03:19:28 2009 From: report at bugs.python.org (ebfe) Date: Sat, 03 Jan 2009 02:19:28 +0000 Subject: [issue4751] Patch for better thread support in hashlib In-Reply-To: <1230298756.92.0.632482701363.issue4751@psf.upfronthosting.co.za> Message-ID: <1230949168.31.0.750114514563.issue4751@psf.upfronthosting.co.za> ebfe added the comment: Here is another patch, this time for the fallback-md5-module. I know that situations are rare where openssl is not present but threading is. However they might occur out there and the md5module needed some love anyway: - The MD5 class from the fallback module can now also use threads with 'small locks' - The behaviour regarding unicode data input is now consistent as to what the openssl-driven classes do. - Some code cleanup. I might act on the sha modules as way the next days. sha256.c still accepts 's#'... I might a Added file: http://bugs.python.org/file12557/md5module_small_locks.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 03:20:58 2009 From: report at bugs.python.org (Paolo 'Blaisorblade' Giarrusso) Date: Sat, 03 Jan 2009 02:20:58 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230325778.98.0.752974375077.issue4753@psf.upfronthosting.co.za> Message-ID: <1230949258.6.0.586239956138.issue4753@psf.upfronthosting.co.za> Paolo 'Blaisorblade' Giarrusso added the comment: > I'm not an expert in this kind of optimizations. Could we gain more speed by making the dispatcher table more dense? Python has less than 128 opcodes (len(opcode.opmap) == 113) so they can be squeezed in a smaller table. I naively assume a smaller table increases the amount of cache hits. Well, you have no binary compatibility constraint with a new release, so it can be tried and benchmarked, or it can be done anyway! On x86_64 the impact of the jump table is 8 bytes per pointer * 256 pointers = 2KiB, and the L1 data cache of Pentium4 can be 8KiB or 16KiB wide. But I don't expect this to be noticeable in most synthetic microbenchmarks. Matrix multiplication would be the perfect one I guess; the repeated column access would kill the L1 data cache, if the whole matrixes don't fit. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 03:44:58 2009 From: report at bugs.python.org (darrenr) Date: Sat, 03 Jan 2009 02:44:58 +0000 Subject: [issue4794] garbage collector blocks and takes worst-case linear time wrt number of objects In-Reply-To: <1230752086.58.0.537070994703.issue4794@psf.upfronthosting.co.za> Message-ID: <1230950698.31.0.95639563177.issue4794@psf.upfronthosting.co.za> darrenr added the comment: OK cool, that's the development strategy we've already adopted. Is this limitation of Python's garbage collector in relation to real-time applications documented anywhere? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 03:55:45 2009 From: report at bugs.python.org (STINNER Victor) Date: Sat, 03 Jan 2009 02:55:45 +0000 Subject: [issue4751] Patch for better thread support in hashlib In-Reply-To: <1230298756.92.0.632482701363.issue4751@psf.upfronthosting.co.za> Message-ID: <1230951345.26.0.153561705088.issue4751@psf.upfronthosting.co.za> STINNER Victor added the comment: ebfe> Here is another patch, this time for the fallback-md5-module Please open a separated issue for each module, this issue is already too long and complex ;-) And it would be easier to fix other modules when patches for hashlib will be accepted ;-) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 04:38:10 2009 From: report at bugs.python.org (Alexander Belopolsky) Date: Sat, 03 Jan 2009 03:38:10 +0000 Subject: [issue4805] Make python code compilable with a C++ compiler In-Reply-To: <1230911682.85.0.598113499033.issue4805@psf.upfronthosting.co.za> Message-ID: Alexander Belopolsky added the comment: On Fri, Jan 2, 2009 at 10:54 AM, Marc-Andre Lemburg wrote: > > Marc-Andre Lemburg added the comment: > > Also note that by removing the extern "C" declarations, you not only > change the exported symbol names of functions, but also those of > exported globals. > What are " exported globals" other than "exported symbol names of functions"? AFAIK, C++ does not mangle non-function symbols. > Those would also have to get declared in the header files, to prevent > their names from being mangled (causing the exported C API to change). I believe .c files should only contain static functions and functions that are declared in an included header file. If a function that is not advertised in a header, it is not part of API and it is a fair game to mangle it. The only exception is the module init functions that are part of the ABI rather than API. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 04:55:52 2009 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 03 Jan 2009 03:55:52 +0000 Subject: [issue4580] slicing of memoryviews when itemsize != 1 is wrong In-Reply-To: <1228681907.24.0.868516520055.issue4580@psf.upfronthosting.co.za> Message-ID: <1230954952.26.0.680099205966.issue4580@psf.upfronthosting.co.za> Nick Coghlan added the comment: Finally got around to looking at the most recent patch (issue4580-2.patch). It looks good to me. I still think something needs to change when it comes to item assignment for memoryviews with itemsize > 1, but that's not as urgent as fixing the rest of the slicing behaviour (and probably should be a different issue). _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 05:02:15 2009 From: report at bugs.python.org (Brett Cannon) Date: Sat, 03 Jan 2009 04:02:15 +0000 Subject: [issue4626] compile() doesn't ignore the source encoding when a string is passed in In-Reply-To: <1228976357.63.0.133847904092.issue4626@psf.upfronthosting.co.za> Message-ID: <1230955335.81.0.913226579403.issue4626@psf.upfronthosting.co.za> Brett Cannon added the comment: So explicitly converting to UTF-8 didn't work, or at least as simply as I had hoped. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 05:33:25 2009 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 03 Jan 2009 04:33:25 +0000 Subject: [issue4796] Decimal to receive from_float method In-Reply-To: <1230764359.55.0.955763939043.issue4796@psf.upfronthosting.co.za> Message-ID: <1230957205.18.0.983310338173.issue4796@psf.upfronthosting.co.za> Raymond Hettinger added the comment: See attached patch for Py27. ---------- keywords: +patch Added file: http://bugs.python.org/file12558/decimal.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 05:56:21 2009 From: report at bugs.python.org (Pavel Kosina) Date: Sat, 03 Jan 2009 04:56:21 +0000 Subject: [issue4815] idle 3.1a1 utf8 In-Reply-To: <1230958581.39.0.288049654968.issue4815@psf.upfronthosting.co.za> Message-ID: <1230958581.39.0.288049654968.issue4815@psf.upfronthosting.co.za> New submission from Pavel Kosina : When you open file without encoding declaration, make changes and save, then IDLE changes without any question encodings to utf8. You can try it on attached file that is cp1250 now. It could be that at first saving we are asked to use *utf8 *current one. ---------- components: IDLE files: cp1250.py messages: 78932 nosy: geon severity: normal status: open title: idle 3.1a1 utf8 versions: Python 3.1 Added file: http://bugs.python.org/file12559/cp1250.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 06:00:26 2009 From: report at bugs.python.org (Pavel Kosina) Date: Sat, 03 Jan 2009 05:00:26 +0000 Subject: [issue4008] IDLE: checksyntax() doesn't support Unicode? In-Reply-To: <1222875475.18.0.22602254781.issue4008@psf.upfronthosting.co.za> Message-ID: <1230958826.67.0.681001280305.issue4008@psf.upfronthosting.co.za> Pavel Kosina added the comment: I vote for fixing this too. This might be simplified/another example of above mentioned issues: # -*- coding: utf-8 -*- print ("?????????") in IDLE prints this: >>> ?????????????????? When running this script under python command line from another editor, I get the output readable as expected. ---------- nosy: +geon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 06:17:23 2009 From: report at bugs.python.org (Alexander Belopolsky) Date: Sat, 03 Jan 2009 05:17:23 +0000 Subject: [issue4805] Make python code compilable with a C++ compiler In-Reply-To: <1230872206.73.0.47638283248.issue4805@psf.upfronthosting.co.za> Message-ID: <1230959843.63.0.423882230771.issue4805@psf.upfronthosting.co.za> Changes by Alexander Belopolsky : Added file: http://bugs.python.org/file12560/c++-patch-2.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 06:17:29 2009 From: report at bugs.python.org (Alexander Belopolsky) Date: Sat, 03 Jan 2009 05:17:29 +0000 Subject: [issue4805] Make python code compilable with a C++ compiler In-Reply-To: <1230872206.73.0.47638283248.issue4805@psf.upfronthosting.co.za> Message-ID: <1230959849.58.0.514116386843.issue4805@psf.upfronthosting.co.za> Changes by Alexander Belopolsky : Removed file: http://bugs.python.org/file12530/c++-patch-1.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 08:32:41 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Sat, 03 Jan 2009 07:32:41 +0000 Subject: [issue3638] tkinter.mainloop() is meaningless and crash: remove it In-Reply-To: <1219356014.43.0.144260212562.issue3638@psf.upfronthosting.co.za> Message-ID: <1230967961.2.0.278733823257.issue3638@psf.upfronthosting.co.za> Martin v. L?wis added the comment: The patch is incorrect. Tkapp_Mainloop is supposed to work both as a module function and a method, and it tests for self to find out which case it is. Now, this test is apparently broken in 3.x, but that could be fixed, instead of ripping the module function out. Or, if that function is removed, the code to support it should also be removed. The same issue probably also affects other functions that double both as instance methods and module functions. ---------- nosy: +loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 08:36:13 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Sat, 03 Jan 2009 07:36:13 +0000 Subject: [issue4794] garbage collector blocks and takes worst-case linear time wrt number of objects In-Reply-To: <1230950698.31.0.95639563177.issue4794@psf.upfronthosting.co.za> Message-ID: <495F156A.2030807@v.loewis.de> Martin v. L?wis added the comment: > OK cool, that's the development strategy we've already adopted. Is this > limitation of Python's garbage collector in relation to real-time > applications documented anywhere? Why do you ask? (this is OT for the bug tracker) It's not in the Python documentation. However, any good book on real-time systems will tell you that garbage collection is a problem. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 08:45:36 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Sat, 03 Jan 2009 07:45:36 +0000 Subject: [issue4815] idle 3.1a1 utf8 In-Reply-To: <1230958581.39.0.288049654968.issue4815@psf.upfronthosting.co.za> Message-ID: <1230968736.91.0.839573715947.issue4815@psf.upfronthosting.co.za> Martin v. L?wis added the comment: IDLE is right to save the file as UTF-8; the file is invalid Python 3.0 code. In Python 3.0, the source encoding *is* UTF-8; nothing else is allowed unless you have an encoding declaration. Perhaps IDLE should offer to convert it on opening. ---------- nosy: +loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 09:29:39 2009 From: report at bugs.python.org (Pavel Kosina) Date: Sat, 03 Jan 2009 08:29:39 +0000 Subject: [issue4815] idle 3.1a1 utf8 In-Reply-To: <1230958581.39.0.288049654968.issue4815@psf.upfronthosting.co.za> Message-ID: <1230971379.79.0.225620079723.issue4815@psf.upfronthosting.co.za> Pavel Kosina added the comment: You can open script made in python 2.x and it stops immediately working after saving, if it is coding-aware. You can have bigger project and use idle for editing config and text files from this project too. It is "unfair" to change without notification the encodings. Or do you consider IDLE just for beginners for learning? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 09:36:05 2009 From: report at bugs.python.org (Pavel Kosina) Date: Sat, 03 Jan 2009 08:36:05 +0000 Subject: [issue4815] idle 3.1a1 utf8 In-Reply-To: <1230958581.39.0.288049654968.issue4815@psf.upfronthosting.co.za> Message-ID: <1230971765.2.0.460725348831.issue4815@psf.upfronthosting.co.za> Pavel Kosina added the comment: I forgot about "Perhaps IDLE should offer to convert it on opening." That would be nice, too. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 09:39:35 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Sat, 03 Jan 2009 08:39:35 +0000 Subject: [issue4815] idle 3.1a1 utf8 In-Reply-To: <1230958581.39.0.288049654968.issue4815@psf.upfronthosting.co.za> Message-ID: <1230971975.81.0.773597663187.issue4815@psf.upfronthosting.co.za> Martin v. L?wis added the comment: Here is a patch to provide an explicit message that the file will be converted when the file is opened (also querying what encoding should be converted from), answering the complaint that the conversion is without notice. If you want to edit Python 2.x scripts with IDLE 3, you need to add encoding declarations to the files. For bigger projects, it is reasonable to expect that they do add these declarations. Again, please only report one issue at the time. You chose to make Python source files the topic of this issue, so please don't divert into config or text files. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 09:50:30 2009 From: report at bugs.python.org (Pavel Kosina) Date: Sat, 03 Jan 2009 08:50:30 +0000 Subject: [issue4815] idle 3.1a1 utf8 In-Reply-To: <1230958581.39.0.288049654968.issue4815@psf.upfronthosting.co.za> Message-ID: <1230972630.29.0.893412424.issue4815@psf.upfronthosting.co.za> Pavel Kosina added the comment: Sorry, where is the patch? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 09:54:39 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Sat, 03 Jan 2009 08:54:39 +0000 Subject: [issue4815] idle 3.1a1 utf8 In-Reply-To: <1230958581.39.0.288049654968.issue4815@psf.upfronthosting.co.za> Message-ID: <1230972879.95.0.204097043841.issue4815@psf.upfronthosting.co.za> Changes by Martin v. L?wis : ---------- keywords: +patch Added file: http://bugs.python.org/file12561/conv.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 09:55:07 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Sat, 03 Jan 2009 08:55:07 +0000 Subject: [issue4815] idle 3.1a1 utf8 In-Reply-To: <1230958581.39.0.288049654968.issue4815@psf.upfronthosting.co.za> Message-ID: <1230972907.96.0.796154778207.issue4815@psf.upfronthosting.co.za> Changes by Martin v. L?wis : ---------- keywords: +needs review priority: -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 10:38:41 2009 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 03 Jan 2009 09:38:41 +0000 Subject: [issue4796] Decimal to receive from_float method In-Reply-To: <1230764359.55.0.955763939043.issue4796@psf.upfronthosting.co.za> Message-ID: <1230975521.04.0.257626071774.issue4796@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- assignee: rhettinger -> marketdickinson keywords: +needs review -patch Added file: http://bugs.python.org/file12562/decimal2.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 10:38:47 2009 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 03 Jan 2009 09:38:47 +0000 Subject: [issue4796] Decimal to receive from_float method In-Reply-To: <1230764359.55.0.955763939043.issue4796@psf.upfronthosting.co.za> Message-ID: <1230975527.33.0.99503487777.issue4796@psf.upfronthosting.co.za> Changes by Raymond Hettinger : Removed file: http://bugs.python.org/file12558/decimal.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 11:36:13 2009 From: report at bugs.python.org (Pavel Kosina) Date: Sat, 03 Jan 2009 10:36:13 +0000 Subject: [issue4815] idle 3.1a1 utf8 In-Reply-To: <1230958581.39.0.288049654968.issue4815@psf.upfronthosting.co.za> Message-ID: <1230978973.03.0.846244652385.issue4815@psf.upfronthosting.co.za> Pavel Kosina added the comment: OK, I got it. In my opinion it would nice if user can either convert file to utf8 or to do nothing and add new encodings declaration or cancel. Current "Cancel" gives an Decoding error. If you give an encodings that doesn't exist, it shouldn't destroy IDLE. Hoping its not my mistake, cause I do not have all files from 3.1a - just those from idlelib. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 11:40:43 2009 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 03 Jan 2009 10:40:43 +0000 Subject: [issue4796] Decimal to receive from_float method In-Reply-To: <1230764359.55.0.955763939043.issue4796@psf.upfronthosting.co.za> Message-ID: <1230979243.38.0.906207633131.issue4796@psf.upfronthosting.co.za> Mark Dickinson added the comment: Instead of the repeated divisions and Inexact tests, how about a direct approach: n/2**k = (n*5**k)/10**k, so something like: sign = 0 if copysign(1.0, self) == 1.0 else 1 n, d = abs(self).as_integer_ratio() k = d.bit_length() - 1 return _dec_from_triple(sign, str(n*5**k), -k) should work, and would likely be faster too. I also think the sign of 0 should be preserved: i.e., >>> Decimal.from_float(-0.0) Decimal('-0') Am still reviewing---more comments to come. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 11:51:15 2009 From: report at bugs.python.org (Thomas Finley) Date: Sat, 03 Jan 2009 10:51:15 +0000 Subject: [issue4816] Patch of itertools.{combinations, permutations} for empty combinations In-Reply-To: <1230979875.82.0.811611724155.issue4816@psf.upfronthosting.co.za> Message-ID: <1230979875.82.0.811611724155.issue4816@psf.upfronthosting.co.za> New submission from Thomas Finley : This is a patch for the Python 3.1 build checked out from http://svn.python.org/projects/python/branches/py3k The current behavior of itertools.combinations(iterable,r) and itertools.permutations(iterable,r) is to throw a ValueError if iterable yields fewer than r items. This changes these functions so the generator instead yields 0 items. As for my argument for acceptance, while the original behavior is not a bug insofar as its implementation was deliberate, I'd argue this is undesirable on grounds of mathematical consistency and functionality. In mathematics the "choose" function is defined as "(n choose r)=0" for r>n, so itertools.combinations' behavior is inconsistent with its obvious combinatorial analogy. (Similar for permutations and the combinatorial "P" function.) For functionality I'll cite my own case as anecdote. In writing regression tests I wanted to ensure that a group of items obeyed a certain "mutually consistent" property between all triples. (Something akin to the triangle inequality.) So: all(triangle_respected(*triple) for triple in itertools.combinations(group, 3)) If len(group)<=2, that's fine, since with no triangles there is no inconsistency, and all(())==True. However, the code failed with a ValueError when groups were that small. Working around this was fairly awkward, since I wanted to continue to fail noisily if my triangle_respected function threw a ValueError, and I wasn't sure at all that it wouldn't if my items were The patch modifies Modules/itertoolsmodule.c slightly, changing combinationsobject_new and permutationsobject_new. (Deleting the error throwing code, and have one line changes in both structures to handle the n>r case. One could handle this special case more efficiently than I do by not bothering to allocate certain structures in this case, but I didn't want to tempt fate.) The patch also changes the appropriate tests in Lib/test/test_itertools.py . Obviously, this would break code that depends upon Python throwing ValueError in the event of the combination or permutation sequence being empty. However, I hope given that combinations and permutations are a relative novelty that their behavior in this corner case is not yet etched in stone. Sorry if this belongs in a PEP -- it seems quite minor, but I don't quite have a feel what the threshold is. ---------- components: Library (Lib), Tests files: itertools-empty-combinations.diff keywords: patch messages: 78943 nosy: TFinley severity: normal status: open title: Patch of itertools.{combinations,permutations} for empty combinations type: behavior versions: Python 3.1 Added file: http://bugs.python.org/file12563/itertools-empty-combinations.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 11:52:57 2009 From: report at bugs.python.org (Jakub Wilk) Date: Sat, 03 Jan 2009 10:52:57 +0000 Subject: [issue4608] urllib.request.urlopen does not return an iterable object In-Reply-To: <1228824822.91.0.748607079368.issue4608@psf.upfronthosting.co.za> Message-ID: <1230979977.71.0.587177461214.issue4608@psf.upfronthosting.co.za> Jakub Wilk added the comment: Oops, __next__ is OK. Sorry for the confusion. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 12:09:46 2009 From: report at bugs.python.org (Ulrich Eckhardt) Date: Sat, 03 Jan 2009 11:09:46 +0000 Subject: [issue4817] PyOS_GetLastModificationTime is unused In-Reply-To: <1230980986.2.0.22709793272.issue4817@psf.upfronthosting.co.za> Message-ID: <1230980986.2.0.22709793272.issue4817@psf.upfronthosting.co.za> New submission from Ulrich Eckhardt : This is just to record that the above function is wrongly documented, inconsistently implemented, but fortunately unused, so it can be removed. In addition to the patch attached, there are two files that can be removed: Python/getmtime.c RISCOS/Python/getmtime_riscos.c ---------- components: Interpreter Core files: python-2.7-eradicate-getmtime.0.patch keywords: patch messages: 78945 nosy: eckhardt severity: normal status: open title: PyOS_GetLastModificationTime is unused type: resource usage versions: Python 2.7 Added file: http://bugs.python.org/file12564/python-2.7-eradicate-getmtime.0.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 12:19:25 2009 From: report at bugs.python.org (ebfe) Date: Sat, 03 Jan 2009 11:19:25 +0000 Subject: [issue4751] Patch for better thread support in hashlib In-Reply-To: <1230298756.92.0.632482701363.issue4751@psf.upfronthosting.co.za> Message-ID: <1230981565.46.0.497351403812.issue4751@psf.upfronthosting.co.za> Changes by ebfe : Removed file: http://bugs.python.org/file12557/md5module_small_locks.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 12:19:33 2009 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 03 Jan 2009 11:19:33 +0000 Subject: [issue4796] Decimal to receive from_float method In-Reply-To: <1230764359.55.0.955763939043.issue4796@psf.upfronthosting.co.za> Message-ID: <1230981573.69.0.301980119243.issue4796@psf.upfronthosting.co.za> Mark Dickinson added the comment: A couple more things: 1. There's a typo 'equilvalent' in the decimal.py part of the patch. 2. Can I suggest using return d._fix(self) instead of return self.plus(d) in create_decimal_from_float. The plus method does two things: rounds to the current context *and* converts -0.0 to 0.0; we only want the first of these. (It's always been a source of mild irritation to me that there's no public method for simply rounding a Decimal to a given context---i.e., a public equivalent of _fix.) ---------- assignee: marketdickinson -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 12:24:00 2009 From: report at bugs.python.org (ebfe) Date: Sat, 03 Jan 2009 11:24:00 +0000 Subject: [issue4818] Patch for thread-support in md5module.c In-Reply-To: <1230981840.09.0.761060151323.issue4818@psf.upfronthosting.co.za> Message-ID: <1230981840.09.0.761060151323.issue4818@psf.upfronthosting.co.za> New submission from ebfe : Here is another patch, this time for the fallback-md5-module. I know that situations are rare where openssl is not present but threading is. However they might occur out there and the md5module needed some love anyway: - The MD5 class from the fallback module can now also use threads with 'small locks' - The behaviour regarding unicode data input is now consistent as to what the openssl-driven classes do. - Some code cleanup. I might act on the sha modules as way the next days. sha256.c still accepts 's#'... Also see issue #4751 ---------- files: md5module_small_locks.diff keywords: patch messages: 78947 nosy: ebfe severity: normal status: open title: Patch for thread-support in md5module.c Added file: http://bugs.python.org/file12565/md5module_small_locks.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 12:53:46 2009 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 03 Jan 2009 11:53:46 +0000 Subject: [issue4816] Patch of itertools.{combinations, permutations} for empty combinations In-Reply-To: <1230979875.82.0.811611724155.issue4816@psf.upfronthosting.co.za> Message-ID: <1230983626.02.0.730324688636.issue4816@psf.upfronthosting.co.za> Mark Dickinson added the comment: I agree that the proposed behaviour seems more correct: the collection of all subsets of size 4 of range(3) is perfectly valid and well-defined; it just happens to be empty. I've also encountered this in practice (in code that was enumerating partitions of a list into a fixed number of pieces), but in my case it was easier to work around. I guess the counterargument is that the current ValueError might catch bugs early; I don't know how often this is true in practice. In any case, this is Raymond's call. ---------- assignee: -> rhettinger nosy: +marketdickinson, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 13:06:47 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Sat, 03 Jan 2009 12:06:47 +0000 Subject: [issue4815] idle 3.1a1 utf8 In-Reply-To: <1230958581.39.0.288049654968.issue4815@psf.upfronthosting.co.za> Message-ID: <1230984407.84.0.801107914282.issue4815@psf.upfronthosting.co.za> Martin v. L?wis added the comment: > In my opinion it would nice if user can either convert file to utf8 or > to do nothing and add new encodings declaration or cancel. Ypu can still add an encoding declaration after the file got converted. Cancelling is also possible. > If you give an encodings that doesn't exist, it shouldn't destroy IDLE. Right. Here is a patch that fixes that. Added file: http://bugs.python.org/file12566/conv.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 13:06:55 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Sat, 03 Jan 2009 12:06:55 +0000 Subject: [issue4815] idle 3.1a1 utf8 In-Reply-To: <1230958581.39.0.288049654968.issue4815@psf.upfronthosting.co.za> Message-ID: <1230984415.87.0.22460864134.issue4815@psf.upfronthosting.co.za> Changes by Martin v. L?wis : Removed file: http://bugs.python.org/file12561/conv.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 13:14:26 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Sat, 03 Jan 2009 12:14:26 +0000 Subject: [issue4818] Patch for thread-support in md5module.c In-Reply-To: <1230981840.09.0.761060151323.issue4818@psf.upfronthosting.co.za> Message-ID: <1230984866.02.0.982007913624.issue4818@psf.upfronthosting.co.za> Martin v. L?wis added the comment: ebfe, please identify yourself with a real name; please also sign a contributor form. ---------- nosy: +loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 13:18:41 2009 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 03 Jan 2009 12:18:41 +0000 Subject: [issue4812] Junk in the decimals namespace In-Reply-To: <1230935465.8.0.0565784557984.issue4812@psf.upfronthosting.co.za> Message-ID: <1230985121.88.0.111302811041.issue4812@psf.upfronthosting.co.za> Mark Dickinson added the comment: Done (r68191 through r68194). ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 13:28:53 2009 From: report at bugs.python.org (ebfe) Date: Sat, 03 Jan 2009 12:28:53 +0000 Subject: [issue4751] Patch for better thread support in hashlib In-Reply-To: <1230298756.92.0.632482701363.issue4751@psf.upfronthosting.co.za> Message-ID: <1230985733.4.0.5704593272.issue4751@psf.upfronthosting.co.za> ebfe added the comment: Haypo, we can probably reduce overhead by defining ENTER_HASHLIB like this: #define ENTER_HASHLIB(obj) \ if ((obj)->lock) { \ if (!PyThread_acquire_lock((obj)->lock, 0)) { \ Py_BEGIN_ALLOW_THREADS \ PyThread_acquire_lock((obj)->lock, 1); \ Py_END_ALLOW_THREADS \ } \ } _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 13:48:20 2009 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 03 Jan 2009 12:48:20 +0000 Subject: [issue1717] Get rid of more refercenes to __cmp__ In-Reply-To: <1199205565.64.0.0495465164968.issue1717@psf.upfronthosting.co.za> Message-ID: <1230986900.42.0.910046093886.issue1717@psf.upfronthosting.co.za> Mark Dickinson added the comment: [Georg Brandl, on spark.py] > This is used by asdl_c.py which generates Python-ast.c -- it should be > updated. The only issue here is a single comment, which reads: # GenericASTMatcher. AST nodes must have "__getitem__" and "__cmp__" Still, I'm reluctant to remove or alter the comment without understanding why it was there in the first place. If someone more familiar with AST stuff can confirm that __cmp__ is definitely no longer needed, I'll remove the mention of it from the comment. > Misc/cheatsheet > > This needs a general overhaul. I'll open a separate issue for this, if that's okay with everyone. Presumably 3.0.1 doesn't need to wait for Misc/cheatsheet to be updated. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 13:55:43 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Sat, 03 Jan 2009 12:55:43 +0000 Subject: [issue1717] Get rid of more references to __cmp__ In-Reply-To: <1199205565.64.0.0495465164968.issue1717@psf.upfronthosting.co.za> Message-ID: <1230987343.91.0.614683129411.issue1717@psf.upfronthosting.co.za> Changes by Martin v. L?wis : ---------- title: Get rid of more refercenes to __cmp__ -> Get rid of more references to __cmp__ _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 13:59:58 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Sat, 03 Jan 2009 12:59:58 +0000 Subject: [issue4580] slicing of memoryviews when itemsize != 1 is wrong In-Reply-To: <1228681907.24.0.868516520055.issue4580@psf.upfronthosting.co.za> Message-ID: <1230987598.96.0.857169707959.issue4580@psf.upfronthosting.co.za> Changes by Martin v. L?wis : ---------- keywords: -needs review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 14:00:30 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Sat, 03 Jan 2009 13:00:30 +0000 Subject: [issue4580] slicing of memoryviews when itemsize != 1 is wrong In-Reply-To: <1228681907.24.0.868516520055.issue4580@psf.upfronthosting.co.za> Message-ID: <1230987630.24.0.369005219068.issue4580@psf.upfronthosting.co.za> Changes by Martin v. L?wis : ---------- assignee: -> pitrou resolution: -> accepted _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 14:03:43 2009 From: report at bugs.python.org (Lukas Lueg) Date: Sat, 03 Jan 2009 13:03:43 +0000 Subject: [issue4818] Patch for thread-support in md5module.c In-Reply-To: <1230981840.09.0.761060151323.issue4818@psf.upfronthosting.co.za> Message-ID: <1230987823.83.0.938309928363.issue4818@psf.upfronthosting.co.za> Lukas Lueg added the comment: Sent the form by fax _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 14:16:34 2009 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 03 Jan 2009 13:16:34 +0000 Subject: [issue4819] Misc/cheatsheet needs updating In-Reply-To: <1230988594.32.0.497089911482.issue4819@psf.upfronthosting.co.za> Message-ID: <1230988594.32.0.497089911482.issue4819@psf.upfronthosting.co.za> New submission from Mark Dickinson : Misc/cheatsheet could do with an upgrade, both for the 2.x and 3.x branches. For 3.x, I guess the changes needed are quite extensive. I'm not sure how much needs to be changed or added for 2.x; at a quick glance, the 'with' statement, the 'x if b else y' construction, and the unified try-except-finally are missing. ---------- assignee: georg.brandl components: Documentation messages: 78955 nosy: georg.brandl, marketdickinson severity: normal status: open title: Misc/cheatsheet needs updating versions: Python 2.7, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 14:22:38 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 03 Jan 2009 13:22:38 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <495EC14C.7010405@cheimes.de> Message-ID: <1230988965.10091.2.camel@localhost> Antoine Pitrou added the comment: > I'm not an expert in this kind of optimizations. Could we gain more > speed by making the dispatcher table more dense? Python has less than > 128 opcodes (len(opcode.opmap) == 113) so they can be squeezed in a > smaller table. I naively assume a smaller table increases the amount of > cache hits. I don't think so. The end of the current table, which doesn't correspond to any valid opcodes, will not be cached anyway. The upper limit to be considered is the maximum value for a valid opcode, which is 147. Reducing that to 113 may reduce cache pressure, but only by a tiny bit. Of course, only experimentation could tell us for sure :) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 14:44:57 2009 From: report at bugs.python.org (=?utf-8?q?Hagen_F=C3=BCrstenau?=) Date: Sat, 03 Jan 2009 13:44:57 +0000 Subject: [issue4806] Function calls taking a generator as star argument can mask TypeErrors in the generator In-Reply-To: <1230900364.95.0.0532833034138.issue4806@psf.upfronthosting.co.za> Message-ID: <1230990297.36.0.701438062512.issue4806@psf.upfronthosting.co.za> Hagen F?rstenau added the comment: I'm getting confused about whether it's actually desired behaviour that generators can be star arguments. The error message seems to say it's not: "argument after * must be a sequence". The docs seem to agree: "If the syntax *expression appears in the function call, expression must evaluate to a sequence." However test_extcall specifically tests function calls with (non-sequence) iterables as star arguments. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 14:57:22 2009 From: report at bugs.python.org (STINNER Victor) Date: Sat, 03 Jan 2009 13:57:22 +0000 Subject: [issue3638] tkinter.mainloop() is meaningless and crash: remove it In-Reply-To: <1219356014.43.0.144260212562.issue3638@psf.upfronthosting.co.za> Message-ID: <1230991042.32.0.650800719563.issue3638@psf.upfronthosting.co.za> Changes by STINNER Victor : Removed file: http://bugs.python.org/file11200/tkinter_remove_mainloop.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 15:00:15 2009 From: report at bugs.python.org (STINNER Victor) Date: Sat, 03 Jan 2009 14:00:15 +0000 Subject: [issue3638] tkinter.mainloop() is meaningless and crash: remove it In-Reply-To: <1219356014.43.0.144260212562.issue3638@psf.upfronthosting.co.za> Message-ID: <1230991215.35.0.664074846446.issue3638@psf.upfronthosting.co.za> STINNER Victor added the comment: > Tkapp_Mainloop is supposed to work both as a module function > and a method, and it tests for self to find out which > case it is. Now, this test is apparently broken in 3.x, ... Ok. In Python 2.x, selfptr is NULL whereas selfptr is a pointer to the module in Python 3.x. New attached patch uses PyModule_Check() to check if selfptr is the module or an object. > if that function is removed, the code to support > it should also be removed. Which code? I don't see which code uses _tkinter.mainloop. I saw code that calls the method mainloop() of a Tkapp object, like tkinter.mainloop() does. Or am I wrong? Added file: http://bugs.python.org/file12567/_tkinter_mainloop.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 15:10:02 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Sat, 03 Jan 2009 14:10:02 +0000 Subject: [issue3638] tkinter.mainloop() is meaningless and crash: remove it In-Reply-To: <1230991215.35.0.664074846446.issue3638@psf.upfronthosting.co.za> Message-ID: <495F71B7.6080600@v.loewis.de> Martin v. L?wis added the comment: > Ok. In Python 2.x, selfptr is NULL whereas selfptr is a pointer to the > module in Python 3.x. New attached patch uses PyModule_Check() to > check if selfptr is the module or an object. The patch looks right in principle. Please make sure not to include printf calls in it. Please also consider all similar cases, such as Tkapp_CreateFileHandler. >> if that function is removed, the code to support >> it should also be removed. > > Which code? The code inside the function: all tests whether self is NULL. If mainloop would stop being a module function, this code also should go. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 15:21:32 2009 From: report at bugs.python.org (Akira Kitada) Date: Sat, 03 Jan 2009 14:21:32 +0000 Subject: [issue4811] invalid reST markup in several documents In-Reply-To: <1230927319.41.0.991139894945.issue4811@psf.upfronthosting.co.za> Message-ID: <1230992492.68.0.09259638563.issue4811@psf.upfronthosting.co.za> Akira Kitada added the comment: Could you also fix the indentation of "Queues" example code at http://docs.python.org/library/multiprocessing.html#exchanging-objects-between-processes ? ---------- nosy: +akitada _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 15:27:10 2009 From: report at bugs.python.org (Guilherme Polo) Date: Sat, 03 Jan 2009 14:27:10 +0000 Subject: [issue3638] tkinter.mainloop() is meaningless and crash: remove it In-Reply-To: <1219356014.43.0.144260212562.issue3638@psf.upfronthosting.co.za> Message-ID: <1230992830.93.0.120031725509.issue3638@psf.upfronthosting.co.za> Guilherme Polo added the comment: Victor, you seem to be confusing "code that supports it" with "functions that use it". There are some conditional code inside Tkapp_MainLoop that depends on self being available, that is what Martin meant by code that supports it, and since it would no longer be a module function that code would no longer be needed. Now, I'm much more in favour to remove it from moduleMethods than from adjusting it to work in py3k. My reasons for the moment are: 1) To me, it makes much more sense to call a mainloop function from a Tcl interpreter object than from a module; 2) There is a member named dispatching in TkappObject, so I believe when this tcl/tk bridge was created -- or at least when this member was added -- it had the intention to allow multiple mainloops at some time (or is it really only intended to be used when trying to grab the thread that created the tcl interpreter ?); 3) It reduces code :) Although the reason #2 won't just work after removing mainloop from the module functions, it also doesn't help keeping it there. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 15:30:03 2009 From: report at bugs.python.org (Georg Brandl) Date: Sat, 03 Jan 2009 14:30:03 +0000 Subject: [issue4811] invalid reST markup in several documents In-Reply-To: <1230927319.41.0.991139894945.issue4811@psf.upfronthosting.co.za> Message-ID: <1230993003.22.0.610258718266.issue4811@psf.upfronthosting.co.za> Georg Brandl added the comment: Done. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 15:44:24 2009 From: report at bugs.python.org (Lukas Lueg) Date: Sat, 03 Jan 2009 14:44:24 +0000 Subject: [issue4818] Patch for thread-support in md5module.c In-Reply-To: <1230981840.09.0.761060151323.issue4818@psf.upfronthosting.co.za> Message-ID: <1230993864.99.0.722347918052.issue4818@psf.upfronthosting.co.za> Lukas Lueg added the comment: fixed naming, lock get's tried before releasing the gil to wait for it Added file: http://bugs.python.org/file12568/md5module_small_locks-2.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 15:44:29 2009 From: report at bugs.python.org (Lukas Lueg) Date: Sat, 03 Jan 2009 14:44:29 +0000 Subject: [issue4818] Patch for thread-support in md5module.c In-Reply-To: <1230981840.09.0.761060151323.issue4818@psf.upfronthosting.co.za> Message-ID: <1230993869.69.0.167797521525.issue4818@psf.upfronthosting.co.za> Changes by Lukas Lueg : Removed file: http://bugs.python.org/file12565/md5module_small_locks.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 15:48:20 2009 From: report at bugs.python.org (David M. Beazley) Date: Sat, 03 Jan 2009 14:48:20 +0000 Subject: [issue4820] ctypes.util.find_library incorrectly documented In-Reply-To: <1230994100.6.0.728617029399.issue4820@psf.upfronthosting.co.za> Message-ID: <1230994100.6.0.728617029399.issue4820@psf.upfronthosting.co.za> New submission from David M. Beazley : In the "ctypes reference / Finding shared libraries" section of the ctypes documentation, the find_library() function is described as being located in ctypes.util. However, it's formal description right below that lists it as ctypes.find_library(). ---------- assignee: georg.brandl components: Documentation messages: 78964 nosy: beazley, georg.brandl severity: normal status: open title: ctypes.util.find_library incorrectly documented versions: Python 3.0 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 16:00:30 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Sat, 03 Jan 2009 15:00:30 +0000 Subject: [issue3638] tkinter.mainloop() is meaningless and crash: remove it In-Reply-To: <1230992830.93.0.120031725509.issue3638@psf.upfronthosting.co.za> Message-ID: <495F7D82.8080809@v.loewis.de> Martin v. L?wis added the comment: > Now, I'm much more in favour to remove it from moduleMethods than from > adjusting it to work in py3k. Would you apply the same reasoning to the other Tkapp methods available on _tkinter? IIRC, these functions were there first; the Tkapp object was added later. The module functions are kept for compatibility (which we were free to break in 3.0). I'm not opposed to removing these module functions now (not even for 3.0.1), but... > 1) To me, it makes much more sense to call a mainloop function from a > Tcl interpreter object than from a module; To me, it makes perfect sense. Windowing events are a global, and not specific to a Tcl interpreter - before receiving it, you cannot know (in general) what interpreter it is for. Indeed, Tcl's Tcl_DoOneEvent doesn't take a Tcl_Interp* parameter. > 2) There is a member named dispatching in TkappObject, so I believe when > this tcl/tk bridge was created -- or at least when this member was added > -- it had the intention to allow multiple mainloops at some time (or is > it really only intended to be used when trying to grab the thread that > created the tcl interpreter ?); This entire machinery got added when Tcl started supporting threads in a way fundamentally different from Python's support for threads. Tcl is inherently single-threaded, no GIL. To support threads, you create a new interpreter for each new thread, and the different interpreters are completely independent from each other. So when a Tkinter application passes a Tcl command from one thread to another, this would crash or otherwise not work. In the old days, Python's threading could be used with Tcl just fine; any thread could make Tk calls (on Unix, at least). When Tcl threading was added, I tried to preserve this mode, by making one thread the Tcl thread. Any other Python thread can't make direct Tcl calls (since those would get to a different interpreter), but instead an RPC system based on Tcl's thread synchronization was added. As this RPC depends on the Tcl mainloop, the "dispatching" member tells the caller if the Tcl thread is up. So, no: the "dispatching" member is there for continued support of a single mainloop, not for multiple mainloops. > 3) It reduces code :) That is a good reason. We would still need a complete patch. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 16:08:23 2009 From: report at bugs.python.org (Pavel Kosina) Date: Sat, 03 Jan 2009 15:08:23 +0000 Subject: [issue4815] idle 3.1a1 utf8 In-Reply-To: <1230958581.39.0.288049654968.issue4815@psf.upfronthosting.co.za> Message-ID: <1230995303.87.0.918540869956.issue4815@psf.upfronthosting.co.za> Pavel Kosina added the comment: seems to be working. Seems to me now I get it. The file encoding is ruled by the encoding declaration. When I stated # -*- coding: cp1250 -*- then the file would be saved in cp1250. Now hoping that I would keep this issue, cause it comes with this patches: when I open file *with* say # -*- coding: cp1250 -*-, I am asked to change to utf8. This behaviour was not before and is probably unwanted..... _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 16:22:13 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Sat, 03 Jan 2009 15:22:13 +0000 Subject: [issue4815] idle 3.1a1 utf8 In-Reply-To: <1230995303.87.0.918540869956.issue4815@psf.upfronthosting.co.za> Message-ID: <495F82A2.10509@v.loewis.de> Martin v. L?wis added the comment: > Now hoping that I would keep this issue, cause it comes with this > patches: when I open file *with* say # -*- coding: cp1250 -*-, I am > asked to change to utf8. This behaviour was not before and is probably > unwanted..... Actually, the behavior was there before - it's just that conversion was silent. If you put an empty line after the coding declaration, it should work well. issue 4008 contains a patch for that problem. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 16:27:38 2009 From: report at bugs.python.org (STINNER Victor) Date: Sat, 03 Jan 2009 15:27:38 +0000 Subject: [issue3638] tkinter.mainloop() is meaningless and crash: remove it In-Reply-To: <1230992830.93.0.120031725509.issue3638@psf.upfronthosting.co.za> Message-ID: <200901031628.02453.victor.stinner@haypocalc.com> STINNER Victor added the comment: > Victor, you seem to be confusing "code that supports it" with "functions > that use it" Oh ok, I didn't understood what "code that supports it" mean. > There are some conditional code inside Tkapp_MainLoop that > depends on self being available, that is what Martin meant by code that > supports it, and since it would no longer be a module function that code > would no longer be needed. Yes, right. I also prefer smaller code base with same functions ;-) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 16:36:14 2009 From: report at bugs.python.org (Guilherme Polo) Date: Sat, 03 Jan 2009 15:36:14 +0000 Subject: [issue3638] tkinter.mainloop() is meaningless and crash: remove it In-Reply-To: <495F7D82.8080809@v.loewis.de> Message-ID: Guilherme Polo added the comment: > Martin v. L?wis added the comment: > >> Now, I'm much more in favour to remove it from moduleMethods than from >> adjusting it to work in py3k. > > Would you apply the same reasoning to the other Tkapp methods available > on _tkinter? > As I see all those functions that are calling into Tcl should be moved from the module functions. Some parts of the code inside these functions are conflicting with each other, while one will try to allow multiple threads, the other part will just disallow it. And since to follow the Tcl appartment model we need to access some of the members in TkappObject it just makes me want to remove those functions even more. > IIRC, these functions were there first; the Tkapp object was added > later. The module functions are kept for compatibility (which we > were free to break in 3.0). > > I'm not opposed to removing these module functions now (not even for > 3.0.1), but... > >> 1) To me, it makes much more sense to call a mainloop function from a >> Tcl interpreter object than from a module; > > To me, it makes perfect sense. Windowing events are a global, and not > specific to a Tcl interpreter - before receiving it, you cannot know > (in general) what interpreter it is for. Indeed, Tcl's Tcl_DoOneEvent > doesn't take a Tcl_Interp* parameter. > That is way to see it. But what I was taking into account was something like the proper update of the dispatching member for different interpreters, this would mean dispatching could be used to stop a running mainloop by setting it to 0. >> 2) There is a member named dispatching in TkappObject, so I believe when >> this tcl/tk bridge was created -- or at least when this member was added >> -- it had the intention to allow multiple mainloops at some time (or is >> it really only intended to be used when trying to grab the thread that >> created the tcl interpreter ?); > > This entire machinery got added when Tcl started supporting threads in > a way fundamentally different from Python's support for threads. Tcl > is inherently single-threaded, no GIL. To support threads, you create > a new interpreter for each new thread, and the different interpreters > are completely independent from each other. So when a Tkinter > application passes a Tcl command from one thread to another, this would > crash or otherwise not work. > That is exactly one of the reasons to move mainloop and others from the moduleMethods. It is hard for me to accept the two distinct behaviours present in _tkinter, which are based from where you call the function. > In the old days, Python's threading could be used with Tcl just fine; > any thread could make Tk calls (on Unix, at least). When Tcl threading > was added, I tried to preserve this mode, by making one thread the > Tcl thread. Any other Python thread can't make direct Tcl calls (since > those would get to a different interpreter), but instead an RPC > system based on Tcl's thread synchronization was added. As this RPC > depends on the Tcl mainloop, the "dispatching" member tells the caller > if the Tcl thread is up. > But I don't see a RPC being used there, I just see some polling. > So, no: the "dispatching" member is there for continued support of > a single mainloop, not for multiple mainloops. > >> 3) It reduces code :) > > That is a good reason. We would still need a complete patch. > _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 16:37:58 2009 From: report at bugs.python.org (Pavel Kosina) Date: Sat, 03 Jan 2009 15:37:58 +0000 Subject: [issue4815] idle 3.1a1 utf8 In-Reply-To: <1230958581.39.0.288049654968.issue4815@psf.upfronthosting.co.za> Message-ID: <1230997078.61.0.0444043880725.issue4815@psf.upfronthosting.co.za> Pavel Kosina added the comment: Well, thanks a lot. (aware this is really off this issue): Now I even get the system of patches - issue 4008 solved the inconvenience in print Unicode signs inside IDLE. Still not sure how works patches for Python versions. I vote for including this a that patch about IDLE even in some 3.0.1, not only in branch 3.1. In non-English speaking countries troubles with encodings are more common, more beginners-frustrating than you can believe. HNY 2009 Pavel Kosina _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 16:48:12 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Sat, 03 Jan 2009 15:48:12 +0000 Subject: [issue3638] tkinter.mainloop() is meaningless and crash: remove it In-Reply-To: Message-ID: <495F88B9.3060107@v.loewis.de> Martin v. L?wis added the comment: > But I don't see a RPC being used there, I just see some polling. Consider Tkapp_Call (e.g.). If this is invoked in the Tk interpreter thread, then there is a direct call to Tcl_EvalObjv/Tkapp_CallResult. If the call is made from a different thread, then a Tkapp_CallEvent is allocated, filled with the parameters, and Tkapp_ThreadSend is invoked. This puts the event into the thread queue of the receiving thread, and waits for a condition. In the interpreter thread, Tkapp_CallProc is invoked, which extracts the arguments from the event, invokes Tcl_EvalObj/Tkapp_CallResult, and notifies the condition. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 16:53:32 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Sat, 03 Jan 2009 15:53:32 +0000 Subject: [issue4815] idle 3.1a1 utf8 In-Reply-To: <1230997078.61.0.0444043880725.issue4815@psf.upfronthosting.co.za> Message-ID: <495F89F8.5070409@v.loewis.de> Martin v. L?wis added the comment: > I > vote for including this a that patch about IDLE even in some 3.0.1, not > only in branch 3.1. This is my plan, yes - hence I marked them all release-critical. They still need review. I agree that IDLE in 3.0 is fairly broken wrt. non-ASCII characters. I knew that before the release, but there is so much work and only so little time. FWIW, my own language (German) also uses (some) non-ASCII characters. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 16:57:51 2009 From: report at bugs.python.org (Guilherme Polo) Date: Sat, 03 Jan 2009 15:57:51 +0000 Subject: [issue3638] tkinter.mainloop() is meaningless and crash: remove it In-Reply-To: <495F88B9.3060107@v.loewis.de> Message-ID: Guilherme Polo added the comment: > Martin v. L?wis added the comment: > >> But I don't see a RPC being used there, I just see some polling. > > Consider Tkapp_Call (e.g.). If this is invoked in the Tk interpreter > thread, then there is a direct call to Tcl_EvalObjv/Tkapp_CallResult. > > If the call is made from a different thread, then a Tkapp_CallEvent > is allocated, filled with the parameters, and Tkapp_ThreadSend is > invoked. This puts the event into the thread queue of the receiving > thread, and waits for a condition. > > In the interpreter thread, Tkapp_CallProc is invoked, which extracts > the arguments from the event, invokes Tcl_EvalObj/Tkapp_CallResult, > and notifies the condition. This is all true but the dispatching isn't used there actually. dispatching is being used in a polling manner to try to catch the thread running the tcl interpreter which someone tried to call into, the code then proceeds to do what you described. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 17:04:31 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Sat, 03 Jan 2009 16:04:31 +0000 Subject: [issue3638] tkinter.mainloop() is meaningless and crash: remove it In-Reply-To: Message-ID: <495F8C8B.8080809@v.loewis.de> Martin v. L?wis added the comment: > This is all true but the dispatching isn't used there actually. > dispatching is being used in a polling manner to try to catch the > thread running the tcl interpreter which someone tried to call into, > the code then proceeds to do what you described. Right. If the main thread doesn't actually invoke mainloop(), the Tcl events don't get dispatched, and the RPC system breaks down, effectively leading to a deadlock. To prevent application breakage during startup, a grace period is added in case applications create threads before starting the mainloop. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 18:08:24 2009 From: report at bugs.python.org (Lukas Lueg) Date: Sat, 03 Jan 2009 17:08:24 +0000 Subject: [issue4821] Patches for thread-support in built-in SHA modules In-Reply-To: <1231002504.32.0.171592356443.issue4821@psf.upfronthosting.co.za> Message-ID: <1231002504.32.0.171592356443.issue4821@psf.upfronthosting.co.za> New submission from Lukas Lueg : Here is the follow-up to issue #4818. The patches attached allow the built-in SHA modules to release the GIL. Also the build-in SHA modules will now no longer accept "s#" as input. Input is parsed just as in the openssl-driven classes where unicode-objects are explicitly rejected. The built-in hash modules have been not quite beautiful before even more code is now copy & pasted between them. Is there any interest in refactoring all those modules? AFAIK _sha1 and such are only used by hashlib.py ... ---------- messages: 78975 nosy: ebfe severity: normal status: open title: Patches for thread-support in built-in SHA modules _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 18:08:38 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 03 Jan 2009 17:08:38 +0000 Subject: [issue4751] Patch for better thread support in hashlib In-Reply-To: <1230298756.92.0.632482701363.issue4751@psf.upfronthosting.co.za> Message-ID: <1231002518.58.0.344967124374.issue4751@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I'm not sure about the approach of dynamically allocating self->lock. Imagine you allocate this lock while another thread is between ENTER_HASHLIB and LEAVE_HASHLIB. What happens on LEAVE_HASHLIB? The thread tries to release a lock it hadn't acquired (because the lock was NULL at the time). Is it simply ignored? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 18:08:41 2009 From: report at bugs.python.org (Lukas Lueg) Date: Sat, 03 Jan 2009 17:08:41 +0000 Subject: [issue4821] Patches for thread-support in built-in SHA modules In-Reply-To: <1231002504.32.0.171592356443.issue4821@psf.upfronthosting.co.za> Message-ID: <1231002521.37.0.13867794574.issue4821@psf.upfronthosting.co.za> Changes by Lukas Lueg : ---------- keywords: +patch Added file: http://bugs.python.org/file12569/sha1module_small_locks.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 18:08:52 2009 From: report at bugs.python.org (Lukas Lueg) Date: Sat, 03 Jan 2009 17:08:52 +0000 Subject: [issue4821] Patches for thread-support in built-in SHA modules In-Reply-To: <1231002504.32.0.171592356443.issue4821@psf.upfronthosting.co.za> Message-ID: <1231002532.95.0.539299982406.issue4821@psf.upfronthosting.co.za> Changes by Lukas Lueg : Added file: http://bugs.python.org/file12570/sha256module_small_locks.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 18:09:06 2009 From: report at bugs.python.org (Lukas Lueg) Date: Sat, 03 Jan 2009 17:09:06 +0000 Subject: [issue4821] Patches for thread-support in built-in SHA modules In-Reply-To: <1231002504.32.0.171592356443.issue4821@psf.upfronthosting.co.za> Message-ID: <1231002546.95.0.44320881661.issue4821@psf.upfronthosting.co.za> Changes by Lukas Lueg : Added file: http://bugs.python.org/file12571/sha512module_small_locks.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 18:11:34 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 03 Jan 2009 17:11:34 +0000 Subject: [issue4580] slicing of memoryviews when itemsize != 1 is wrong In-Reply-To: <1228681907.24.0.868516520055.issue4580@psf.upfronthosting.co.za> Message-ID: <1231002694.75.0.793626354927.issue4580@psf.upfronthosting.co.za> Antoine Pitrou added the comment: The patch is committed in r68200, r68202. Thanks! _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 18:14:13 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 03 Jan 2009 17:14:13 +0000 Subject: [issue4822] Fix indentation in memoryobject.c In-Reply-To: <1231002853.44.0.302489681959.issue4822@psf.upfronthosting.co.za> Message-ID: <1231002853.44.0.302489681959.issue4822@psf.upfronthosting.co.za> New submission from Antoine Pitrou : The rules state new files should be indented with 4-spaces, but indentation has no consistent indentation: parts of it are indented with tabs, others with spaces. We could probably reindent it all with 4-spaces, especially since it hasn't been backported to trunk yet (and the versions in py3k and 3.0 should be identical). ---------- messages: 78978 nosy: pitrou priority: low severity: normal status: open title: Fix indentation in memoryobject.c type: behavior versions: Python 3.0, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 18:14:34 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 03 Jan 2009 17:14:34 +0000 Subject: [issue4580] slicing of memoryviews when itemsize != 1 is wrong In-Reply-To: <1228681907.24.0.868516520055.issue4580@psf.upfronthosting.co.za> Message-ID: <1231002874.5.0.629240428412.issue4580@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- resolution: accepted -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 18:17:53 2009 From: report at bugs.python.org (Lukas Lueg) Date: Sat, 03 Jan 2009 17:17:53 +0000 Subject: [issue4751] Patch for better thread support in hashlib In-Reply-To: <1230298756.92.0.632482701363.issue4751@psf.upfronthosting.co.za> Message-ID: <1231003073.1.0.527062862251.issue4751@psf.upfronthosting.co.za> Lukas Lueg added the comment: The lock is created while having the GIL in EVP_update. No other function releases the GIL (besides the creator-function which does not need the local lock). Thereby no other thread can be in between ENTER and LEAVE while the lock is allocated. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 18:23:10 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Sat, 03 Jan 2009 17:23:10 +0000 Subject: [issue4817] PyOS_GetLastModificationTime is unused In-Reply-To: <1230980986.2.0.22709793272.issue4817@psf.upfronthosting.co.za> Message-ID: <1231003390.03.0.0855289377184.issue4817@psf.upfronthosting.co.za> Martin v. L?wis added the comment: Thanks for the patch. Committed as r68203 and r68204. ---------- nosy: +loewis resolution: -> accepted status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 18:24:35 2009 From: report at bugs.python.org (djc) Date: Sat, 03 Jan 2009 17:24:35 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230325778.98.0.752974375077.issue4753@psf.upfronthosting.co.za> Message-ID: <1231003475.35.0.0538888451218.issue4753@psf.upfronthosting.co.za> Changes by djc : ---------- nosy: +djc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 18:55:31 2009 From: report at bugs.python.org (Georg Brandl) Date: Sat, 03 Jan 2009 17:55:31 +0000 Subject: [issue4822] Fix indentation in memoryobject.c In-Reply-To: <1231002853.44.0.302489681959.issue4822@psf.upfronthosting.co.za> Message-ID: <1231005331.6.0.784232214137.issue4822@psf.upfronthosting.co.za> Georg Brandl added the comment: I think this is the kind of reindention that Guido approved of on python-dev, along with unicodeobject.c. ---------- nosy: +georg.brandl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 19:00:28 2009 From: report at bugs.python.org (Benjamin Peterson) Date: Sat, 03 Jan 2009 18:00:28 +0000 Subject: [issue4822] Fix indentation in memoryobject.c In-Reply-To: <1231002853.44.0.302489681959.issue4822@psf.upfronthosting.co.za> Message-ID: <1231005628.69.0.0709946574632.issue4822@psf.upfronthosting.co.za> Benjamin Peterson added the comment: +1 ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 19:02:21 2009 From: report at bugs.python.org (Pavel Kosina) Date: Sat, 03 Jan 2009 18:02:21 +0000 Subject: [issue4823] idle height and place In-Reply-To: <1231005741.18.0.260844388854.issue4823@psf.upfronthosting.co.za> Message-ID: <1231005741.18.0.260844388854.issue4823@psf.upfronthosting.co.za> New submission from Pavel Kosina : Nearly always (after opening) is IDLE window outside visible area. Mainly the status bar is hidden under bottom windows menu bar. Same situation happens when choosing Window-Zoom Height from IDLE menu. xpsp3, 1024x768, py2.x-3.x ---------- components: IDLE messages: 78983 nosy: geon severity: normal status: open title: idle height and place type: behavior versions: Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 19:03:23 2009 From: report at bugs.python.org (Duncan McGreggor) Date: Sat, 03 Jan 2009 18:03:23 +0000 Subject: [issue3959] Add Google's ipaddr.py to the stdlib In-Reply-To: <1222298050.73.0.172554962966.issue3959@psf.upfronthosting.co.za> Message-ID: <1231005803.66.0.454539375867.issue3959@psf.upfronthosting.co.za> Duncan McGreggor added the comment: I am a contributor to netaddr, having deprecated my own old and crufty IP address library in its favor. JP's comments on the library in this ticket are included in the set of reasons that I initially chose it to replace my own. When I first looked at the ipaddr code a month ago, the features I was delighted to see in the ipaddr project include address exclusion and address collapsing (we'd been discussing these features in netaddr since my old project had similar functionality). Perhaps the following might be a prudent course: * determine how small or big a standard library ip address module or subpackage should be; * have a mutual discussion on the netaddr and ipaddr mail lists to determine what would need to be changed in each project in order to support inclusion in the standard lib; * choose the option that requires the least code changes (simple naming convention changes should probably be given less weight than any changes to logic). As for shutting down any project that is chosen, does such an action not leave older Python versions out in the cold? Shouldn't the project remain open to support Python versions < 2.7, with a highly visible note that the code is included in 2.7/3.1+? (I am completely ignorant of related Python development policy.) ---------- nosy: +oubiwann _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 19:12:35 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Sat, 03 Jan 2009 18:12:35 +0000 Subject: [issue3959] Add Google's ipaddr.py to the stdlib In-Reply-To: <1231005803.66.0.454539375867.issue3959@psf.upfronthosting.co.za> Message-ID: <495FAA90.8050409@v.loewis.de> Martin v. L?wis added the comment: > Perhaps the following might be a prudent course: This sounds all good. It is better if the experts in a domain make a recommendation, than if some random committer makes a choice. > As for shutting down any project that is chosen, does such an action not > leave older Python versions out in the cold? Shouldn't the project > remain open to support Python versions < 2.7, with a highly visible note > that the code is included in 2.7/3.1+? Of course - hence I said "eventually". The project could continue to maintain the external version as long as they please, provided it doesn't diverge from the in-core version (unless it is the in-core version itself that diverges). What I don't want to see happen is that the community recommends at some point to ignore the outdated crappy version in the core, and replace it with the more-powerful bug-fixed version available separately. This has happened in the past, so I'm extremely cautious here. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 19:18:29 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 03 Jan 2009 18:18:29 +0000 Subject: [issue4822] Fix indentation in memoryobject.c In-Reply-To: <1231002853.44.0.302489681959.issue4822@psf.upfronthosting.co.za> Message-ID: <1231006709.31.0.630512788866.issue4822@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Here's a patch. ---------- keywords: +patch Added file: http://bugs.python.org/file12572/reindent-memview.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 19:19:32 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 03 Jan 2009 18:19:32 +0000 Subject: [issue3959] Add Google's ipaddr.py to the stdlib In-Reply-To: <1222298050.73.0.172554962966.issue3959@psf.upfronthosting.co.za> Message-ID: <1231006772.86.0.991762290249.issue3959@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 19:22:35 2009 From: report at bugs.python.org (Georg Brandl) Date: Sat, 03 Jan 2009 18:22:35 +0000 Subject: [issue4822] Fix indentation in memoryobject.c In-Reply-To: <1231002853.44.0.302489681959.issue4822@psf.upfronthosting.co.za> Message-ID: <1231006955.61.0.739825925971.issue4822@psf.upfronthosting.co.za> Georg Brandl added the comment: Do you expect a review? ;) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 19:46:51 2009 From: report at bugs.python.org (Duncan McGreggor) Date: Sat, 03 Jan 2009 18:46:51 +0000 Subject: [issue3959] Add Google's ipaddr.py to the stdlib In-Reply-To: <1222298050.73.0.172554962966.issue3959@psf.upfronthosting.co.za> Message-ID: <1231008411.02.0.941743663734.issue3959@psf.upfronthosting.co.za> Duncan McGreggor added the comment: >> As for shutting down any project that is chosen, does such an action not >> leave older Python versions out in the cold? Shouldn't the project >> remain open to support Python versions < 2.7, with a highly visible note >> that the code is included in 2.7/3.1+? > > Of course - hence I said "eventually". The project could continue to > maintain the external version as long as they please, provided it > doesn't diverge from the in-core version (unless it is the in-core > version itself that diverges). What I don't want to see happen is that > the community recommends at some point to ignore the outdated crappy > version in the core, and replace it with the more-powerful bug-fixed > version available separately. This has happened in the past, so I'm > extremely cautious here. Fantastic! Thanks for the clarification. David, in the event of netaddr's complete or partial inclusion, are you +1 with this and the maintenance of an ip/net library in Python? Guido, what is your preference regarding feature set/size for an ip/net library in Python? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 19:56:09 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 03 Jan 2009 18:56:09 +0000 Subject: [issue3959] Add Google's ipaddr.py to the stdlib In-Reply-To: <1222298050.73.0.172554962966.issue3959@psf.upfronthosting.co.za> Message-ID: <1231008969.5.0.246477365804.issue3959@psf.upfronthosting.co.za> Antoine Pitrou added the comment: If there's going to be lots of discussion, perhaps it should be taken to python-dev? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 20:03:55 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 03 Jan 2009 19:03:55 +0000 Subject: [issue4718] wsgiref package totally broken In-Reply-To: <1229945457.69.0.495711258596.issue4718@psf.upfronthosting.co.za> Message-ID: <1231009435.09.0.231694817933.issue4718@psf.upfronthosting.co.za> Antoine Pitrou added the comment: It is committed now in py3k and the 3.0 maintenance branch. Thanks all for your participation! ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 20:10:21 2009 From: report at bugs.python.org (Pavel Kosina) Date: Sat, 03 Jan 2009 19:10:21 +0000 Subject: [issue4823] idle height and place In-Reply-To: <1231005741.18.0.260844388854.issue4823@psf.upfronthosting.co.za> Message-ID: <1231009821.47.0.452345132793.issue4823@psf.upfronthosting.co.za> Pavel Kosina added the comment: sorry it is duplicate to issue 3286 pls close _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 20:11:09 2009 From: report at bugs.python.org (Pavel Kosina) Date: Sat, 03 Jan 2009 19:11:09 +0000 Subject: [issue3286] IDLE opens window too low on Windows In-Reply-To: <1215200725.85.0.436129810041.issue3286@psf.upfronthosting.co.za> Message-ID: <1231009869.39.0.699499303673.issue3286@psf.upfronthosting.co.za> Pavel Kosina added the comment: +1 ---------- nosy: +geon versions: +Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 20:21:03 2009 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 03 Jan 2009 19:21:03 +0000 Subject: [issue4796] Decimal to receive from_float method In-Reply-To: <1230764359.55.0.955763939043.issue4796@psf.upfronthosting.co.za> Message-ID: <1231010463.89.0.950872218075.issue4796@psf.upfronthosting.co.za> Raymond Hettinger added the comment: The direct method is *much* faster! Applied Mark's suggestions. Committed as r68208 and r68211 . ---------- resolution: -> fixed status: open -> closed versions: +Python 2.7, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 20:29:23 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 03 Jan 2009 19:29:23 +0000 Subject: [issue4822] Fix indentation in memoryobject.c In-Reply-To: <1231002853.44.0.302489681959.issue4822@psf.upfronthosting.co.za> Message-ID: <1231010963.08.0.376955173932.issue4822@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Ok, committed. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 20:47:22 2009 From: report at bugs.python.org (Guilherme Polo) Date: Sat, 03 Jan 2009 19:47:22 +0000 Subject: [issue4823] idle height and place In-Reply-To: <1231005741.18.0.260844388854.issue4823@psf.upfronthosting.co.za> Message-ID: <1231012042.46.0.271226589588.issue4823@psf.upfronthosting.co.za> Changes by Guilherme Polo : ---------- resolution: -> duplicate status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 20:55:31 2009 From: report at bugs.python.org (Neil Richardson) Date: Sat, 03 Jan 2009 19:55:31 +0000 Subject: [issue3329] API for setting the memory allocator used by Python In-Reply-To: <1215632933.18.0.0332019532518.issue3329@psf.upfronthosting.co.za> Message-ID: <1231012531.63.0.815279214901.issue3329@psf.upfronthosting.co.za> Neil Richardson added the comment: I'll be in agreement here. I integrated Python into a game engine not too long ago, and had to a do a fair chunk of work to isolate Python into it's own heap - given that fragmentation on low memory systems can be a bit of a killer. Would also make future upgrades a heck of a lot easier too, as there'd be no need to do a search for all references and carefully replace them all. ---------- nosy: +neilo versions: +Python 2.5, Python 2.6, Python 3.0 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 20:56:27 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 03 Jan 2009 19:56:27 +0000 Subject: [issue4718] wsgiref package totally broken In-Reply-To: <1229945457.69.0.495711258596.issue4718@psf.upfronthosting.co.za> Message-ID: <1231012587.38.0.113650947739.issue4718@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Reopening, the patch actually produces failures when run with "python -bb", that is there are comparisons between str and bytes. See the errors at the end of http://www.python.org/dev/buildbot/3.x.stable/ppc%20Debian%20unstable%203.0/builds/26/step-test/0 ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 21:08:58 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 03 Jan 2009 20:08:58 +0000 Subject: [issue4718] wsgiref package totally broken In-Reply-To: <1229945457.69.0.495711258596.issue4718@psf.upfronthosting.co.za> Message-ID: <1231013338.88.0.223436306227.issue4718@psf.upfronthosting.co.za> Antoine Pitrou added the comment: People, does this patch look ok to you? Added file: http://bugs.python.org/file12573/wsgiref-bb.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 21:19:51 2009 From: report at bugs.python.org (Guilherme Polo) Date: Sat, 03 Jan 2009 20:19:51 +0000 Subject: [issue3638] tkinter.mainloop() is meaningless and crash: remove it In-Reply-To: <1219356014.43.0.144260212562.issue3638@psf.upfronthosting.co.za> Message-ID: <1231013991.3.0.0893553306829.issue3638@psf.upfronthosting.co.za> Guilherme Polo added the comment: Here is a patch, two actually. The next one deprecates the functions in trunk Added file: http://bugs.python.org/file12574/issue3638.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 21:20:12 2009 From: report at bugs.python.org (Guilherme Polo) Date: Sat, 03 Jan 2009 20:20:12 +0000 Subject: [issue3638] tkinter.mainloop() is meaningless and crash: remove it In-Reply-To: <1219356014.43.0.144260212562.issue3638@psf.upfronthosting.co.za> Message-ID: <1231014012.31.0.508832698201.issue3638@psf.upfronthosting.co.za> Changes by Guilherme Polo : Added file: http://bugs.python.org/file12575/deprecated_funcs.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 21:24:29 2009 From: report at bugs.python.org (Dmitry Vasiliev) Date: Sat, 03 Jan 2009 20:24:29 +0000 Subject: [issue4718] wsgiref package totally broken In-Reply-To: <1231013338.88.0.223436306227.issue4718@psf.upfronthosting.co.za> Message-ID: <495FC97A.3080508@hlabs.spb.ru> Dmitry Vasiliev added the comment: Antoine Pitrou wrote: > People, does this patch look ok to you? Oh, didn't know about -bb. The patch looks OK for me. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 21:26:57 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 03 Jan 2009 20:26:57 +0000 Subject: [issue4718] wsgiref package totally broken In-Reply-To: <495FC97A.3080508@hlabs.spb.ru> Message-ID: <1231014402.22041.6.camel@localhost> Antoine Pitrou added the comment: Le samedi 03 janvier 2009 ? 20:24 +0000, Dmitry Vasiliev a ?crit : > Dmitry Vasiliev added the comment: > > Antoine Pitrou wrote: > > People, does this patch look ok to you? > > Oh, didn't know about -bb. Well, it's meant to catch potential bugs. str and bytes always compare unequal in py3k (i.e. "a" != b"a"), so it's good to use -bb when porting some stuff from 2.x. There's another problem in that buildbot failure with the environment variable "NO_PROXY". We'll see if it's still there after the patch. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 21:57:11 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Sat, 03 Jan 2009 20:57:11 +0000 Subject: [issue3638] tkinter.mainloop() is meaningless and crash: remove it In-Reply-To: <1219356014.43.0.144260212562.issue3638@psf.upfronthosting.co.za> Message-ID: <1231016231.37.0.770299680835.issue3638@psf.upfronthosting.co.za> Martin v. L?wis added the comment: These look fine. I think further changes are necessary: tkinter/__init__.py tries to load createfilehandler/deletefilehandler; this becomes redundant. Also, why did you leave DoOneEvent and Quit as-is - don't they fall into the same category? One minor nit: I personally dislike function pointer casts, because they can easily go wrong. I rather prefer if the C compiler tells me when I mess up with function pointer types. Hence _tkinter uses selfptr/self all the time. ---------- assignee: -> gpolo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 21:59:45 2009 From: report at bugs.python.org (Dmitry Vasiliev) Date: Sat, 03 Jan 2009 20:59:45 +0000 Subject: [issue4718] wsgiref package totally broken In-Reply-To: <1231014402.22041.6.camel@localhost> Message-ID: <495FD1B1.1020204@hlabs.spb.ru> Dmitry Vasiliev added the comment: Antoine Pitrou wrote: > There's another problem in that buildbot failure with the environment > variable "NO_PROXY". We'll see if it's still there after the patch. Strange error and it seems there is only part of the traceback. I've already seen such "partially displayed" Python 3 traceback and error actually can be in very different place. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 22:07:46 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 03 Jan 2009 21:07:46 +0000 Subject: [issue4718] wsgiref package totally broken In-Reply-To: <495FD1B1.1020204@hlabs.spb.ru> Message-ID: <1231016853.22041.7.camel@localhost> Antoine Pitrou added the comment: > Strange error and it seems there is only part of the traceback. I've > already seen such "partially displayed" Python 3 traceback and error > actually can be in very different place. If you can reproduce such a problem, please open a bug. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 22:09:05 2009 From: report at bugs.python.org (Pavel Kosina) Date: Sat, 03 Jan 2009 21:09:05 +0000 Subject: [issue4815] idle 3.1a1 utf8 In-Reply-To: <1230958581.39.0.288049654968.issue4815@psf.upfronthosting.co.za> Message-ID: <1231016945.82.0.643243839334.issue4815@psf.upfronthosting.co.za> Pavel Kosina added the comment: I might have another problem with this patch and maybe also that one in issue 4008. Having a file with print ("?????????") # saved in cp1250 Open - confirm converting to utf8 - F5 - error: see attached file idleunicode1.jpg Added file: http://bugs.python.org/file12576/idleunicode1.jpg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 22:14:35 2009 From: report at bugs.python.org (Dmitry Vasiliev) Date: Sat, 03 Jan 2009 21:14:35 +0000 Subject: [issue4718] wsgiref package totally broken In-Reply-To: <1231016853.22041.7.camel@localhost> Message-ID: <495FD537.8040906@hlabs.spb.ru> Dmitry Vasiliev added the comment: Antoine Pitrou wrote: >> Strange error and it seems there is only part of the traceback. I've >> already seen such "partially displayed" Python 3 traceback and error >> actually can be in very different place. > > If you can reproduce such a problem, please open a bug. OK, I'll try to reproduce. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 22:24:14 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Sat, 03 Jan 2009 21:24:14 +0000 Subject: [issue4815] idle 3.1a1 utf8 In-Reply-To: <1231016945.82.0.643243839334.issue4815@psf.upfronthosting.co.za> Message-ID: <495FD77C.8000702@v.loewis.de> Martin v. L?wis added the comment: > print ("?????????") > # saved in cp1250 I can't reproduce the problem. Can you please attach the exact file that failed to work? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 22:24:21 2009 From: report at bugs.python.org (Guilherme Polo) Date: Sat, 03 Jan 2009 21:24:21 +0000 Subject: [issue3638] tkinter.mainloop() is meaningless and crash: remove it In-Reply-To: <1231016231.37.0.770299680835.issue3638@psf.upfronthosting.co.za> Message-ID: Guilherme Polo added the comment: > These look fine. I think further changes are necessary: > tkinter/__init__.py tries to load createfilehandler/deletefilehandler; > this becomes redundant. Indeed, I forgot to look into the Python code. I also see as redundant the checks for _tkinter._flatten and _tkinter._cnfmerge, the former because if we are still on Tkinter.py (or __init__.py in py3k) then _tkinter exists and _flatten is there too, the latter because there is no _cnfmerge in _tkinter. > Also, why did you leave DoOneEvent and Quit > as-is - don't they fall into the same category? > Ah, it is nice you ask this. I was indeed going to move then, but I noticed strange things with DoOneEvent which made me only remove those functions that were already checking the thread id of the caller and the interp creator. But rethinking about this, it seems to make more sense to do the move now and fix the "strange things" in other patch. The problems I noticed may be a bit off-topic for this specific issue, but I would hate to just say I had problems with a function and don't say which errors I got, and how I got, so I have to write. So, the problem started when I noticed DoOneEvent doesn't check for python errors after Tcl_DoOneEvent returns, making me try to get one of those SystemErrors "NULL result without error" -- I failed to get it, but I got other unexpected results: I get an empty string with the text below, but I was expecting some nameerror message: import _tkinter def mybgerror(errmsg): print errmsg called = [] def bad(): called.append(True) raise InvalidThing x = _tkinter.create() x.createcommand("bad", bad) x.createcommand("bgerror", mybgerror) x.call("after", 1, "bad") while not called: _tkinter.dooneevent() _tkinter.dooneevent() I ended up finding another problem (or problems, I forgot to annotate them), like with call: import _tkinter def bad(): raise InvalidThing x = _tkinter.create() x.createcommand("bad", bad) x.call("bad") Results in: Traceback (most recent call last): File "my_badtests/test1.py", line 7, in x.call("bad") _tkinter.TclError Meaning call is overwriting a python error by a tcl error, but since there was no error in the tcl interpreter the error message was empty (too many errors in a message). But these all would deserve another(s) issues, so I will be moving "quit" and "dooneevent" from there too. > One minor nit: I personally dislike function pointer casts, because they > can easily go wrong. I rather prefer if the C compiler tells me when I > mess up with function pointer types. Hence _tkinter uses selfptr/self > all the time. > Fine. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 22:26:46 2009 From: report at bugs.python.org (Guilherme Polo) Date: Sat, 03 Jan 2009 21:26:46 +0000 Subject: [issue3638] tkinter.mainloop() is meaningless and crash: remove it In-Reply-To: Message-ID: Guilherme Polo added the comment: > I get an empty string with the text below, but I was expecting some s/text/test _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 22:33:38 2009 From: report at bugs.python.org (Pavel Kosina) Date: Sat, 03 Jan 2009 21:33:38 +0000 Subject: [issue4815] idle 3.1a1 utf8 In-Reply-To: <495FD77C.8000702@v.loewis.de> Message-ID: <495FD9B2.9020909@post.cz> Pavel Kosina added the comment: Martin v. L?wis napsal(a), dne 3.1.2009 22:24: > I can't reproduce the problem. Can you please attach the > exact file that failed to work? > You can use that one that is already here: cp1250.py. It is the same error with me. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 22:38:30 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Sat, 03 Jan 2009 21:38:30 +0000 Subject: [issue3638] tkinter.mainloop() is meaningless and crash: remove it In-Reply-To: Message-ID: <495FDAD4.2030205@v.loewis.de> Martin v. L?wis added the comment: > But these all would deserve another(s) issues, so I will be moving > "quit" and "dooneevent" from there too. I haven't tried reproducing these problems, but this all sounds plausible. So go ahead and check in all the changes for this issue. Don't forget Misc/NEWS entries, and don't forget to svnmerge block the 2.7 change from being merged into 3.k. You should then also merge the 3k change into the 3.0 branch. I don't think we have to merge the warnings into 2.6 (but could if we wanted to). Leave the various revision numbers in this report when done. If you rather prefer me to check it in, please let me know. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 22:40:04 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Sat, 03 Jan 2009 21:40:04 +0000 Subject: [issue4815] idle 3.1a1 utf8 In-Reply-To: <495FD9B2.9020909@post.cz> Message-ID: <495FDB31.2050704@v.loewis.de> Martin v. L?wis added the comment: > You can use that one that is already here: cp1250.py. It is the same > error with me. Ok, then what are the exact steps to reproduce? What code base, what patches applied, what user interaction in what order? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 22:49:48 2009 From: report at bugs.python.org (Pavel Kosina) Date: Sat, 03 Jan 2009 21:49:48 +0000 Subject: [issue4815] idle 3.1a1 utf8 In-Reply-To: <495FDB31.2050704@v.loewis.de> Message-ID: <495FDD7C.2050708@post.cz> Pavel Kosina added the comment: Microsoft Windows XP [Verze 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\prg\Python30\Lib\idlelib>svn update # from http://svn.python.org/projects/python/branches/py3k/Lib/idlelib Restored 'AutoCompleteWindow.py' Restored 'ToolTip.py' Restored 'UndoDelegator.py' Restored 'Bindings.py' Restored '__init__.py' Restored 'AutoComplete.py' Restored 'configHandler.py' Restored 'HyperParser.py' Restored 'ColorDelegator.py' Restored 'Delegator.py' Restored 'ObjectBrowser.py' Restored 'testcode.py' Restored 'configSectionNameDialog.py' Restored 'ZoomHeight.py' Restored 'PyShell.py' Restored 'ParenMatch.py' Restored 'config-keys.def' Restored 'Debugger.py' Restored 'CREDITS.txt' Restored 'configDialog.py' Restored 'StackViewer.py' Restored 'HISTORY.txt' Restored 'SearchEngine.py' Restored 'ReplaceDialog.py' Restored 'ScriptBinding.py' Restored 'ChangeLog' Restored 'tabbedpages.py' Restored 'keybindingDialog.py' Restored 'configHelpSourceEdit.py' Restored 'WidgetRedirector.py' Restored 'GrepDialog.py' Restored 'FormatParagraph.py' Restored 'EditorWindow.py' Restored 'help.txt' Restored 'config-highlight.def' Restored 'PyParse.py' Restored 'README.txt' Restored 'rpc.py' Restored 'OutputWindow.py' Restored 'aboutDialog.py' Restored 'idle.bat' Restored 'TODO.txt' Restored 'config-main.def' Restored 'IdleHistory.py' Restored 'PathBrowser.py' Restored 'IOBinding.py' Restored 'WindowList.py' Restored 'ScrolledList.py' Restored 'ClassBrowser.py' Restored 'FileList.py' Restored 'CallTips.py' Restored 'idle.py' Restored 'CodeContext.py' Restored 'textView.py' Restored 'SearchDialogBase.py' Restored 'CallTipWindow.py' Restored 'SearchDialog.py' Restored 'RemoteObjectBrowser.py' Restored 'idlever.py' Restored 'RemoteDebugger.py' Restored 'TreeWidget.py' Restored 'NEWS.txt' Restored 'idle.pyw' Restored 'run.py' Restored 'config-extensions.def' Restored 'AutoExpand.py' Restored 'Percolator.py' Restored 'dynOptionMenuWidget.py' Restored 'extend.txt' Restored 'MultiStatusBar.py' Restored 'MultiCall.py' Restored 'macosxSupport.py' At revision 68230. C:\prg\Python30\Lib\idlelib>patch < conv.diff patching file IOBinding.py C:\prg\Python30\Lib\idlelib>patch < idle_encoding_4.patch patching file ScriptBinding.py patching file IOBinding.py ------------- Run IDLE - Open cp1250.py - confirm converting to utf8 - F5 (immediately, no change in code!) - error: see attached file idleunicode1.jpg All the other python code base is clean 3.0. xpsp3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 22:57:46 2009 From: report at bugs.python.org (Dmitry Vasiliev) Date: Sat, 03 Jan 2009 21:57:46 +0000 Subject: [issue4718] wsgiref package totally broken In-Reply-To: <1229945457.69.0.495711258596.issue4718@psf.upfronthosting.co.za> Message-ID: <1231019866.73.0.864134770179.issue4718@psf.upfronthosting.co.za> Dmitry Vasiliev added the comment: Attached patch for test_urllib, possible source of the "NO_PROXY" problem. Added file: http://bugs.python.org/file12577/no_proxy.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 23:07:37 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Sat, 03 Jan 2009 22:07:37 +0000 Subject: [issue4815] idle 3.1a1 utf8 In-Reply-To: <1230958581.39.0.288049654968.issue4815@psf.upfronthosting.co.za> Message-ID: <1231020457.17.0.0778461555708.issue4815@psf.upfronthosting.co.za> Martin v. L?wis added the comment: I see. Here is a revised patch. This sets the modified flag on the buffer after conversion, so that you get asked to save it before running it. Added file: http://bugs.python.org/file12578/conv.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 23:07:50 2009 From: report at bugs.python.org (Guilherme Polo) Date: Sat, 03 Jan 2009 22:07:50 +0000 Subject: [issue3638] Remove module level functions in _tkinter that depend on TkappObject In-Reply-To: <1219356014.43.0.144260212562.issue3638@psf.upfronthosting.co.za> Message-ID: <1231020470.28.0.72793467575.issue3638@psf.upfronthosting.co.za> Guilherme Polo added the comment: Thanks Martin, trunk: r68231 (blocked on py3k) py3k: r68237 release30-maint: r68239 ---------- resolution: -> fixed status: open -> closed title: tkinter.mainloop() is meaningless and crash: remove it -> Remove module level functions in _tkinter that depend on TkappObject versions: +Python 2.7, Python 3.1 -Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 23:15:14 2009 From: report at bugs.python.org (Yann Ramin) Date: Sat, 03 Jan 2009 22:15:14 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230325778.98.0.752974375077.issue4753@psf.upfronthosting.co.za> Message-ID: <1231020914.07.0.940743572132.issue4753@psf.upfronthosting.co.za> Changes by Yann Ramin : ---------- nosy: +theatrus _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 23:18:11 2009 From: report at bugs.python.org (Pavel Kosina) Date: Sat, 03 Jan 2009 22:18:11 +0000 Subject: [issue4815] idle 3.1a1 utf8 In-Reply-To: <1231020457.17.0.0778461555708.issue4815@psf.upfronthosting.co.za> Message-ID: <495FE423.7020304@post.cz> Pavel Kosina added the comment: Yes. Goooood jooooob. ;-) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 23:18:35 2009 From: report at bugs.python.org (Guilherme Polo) Date: Sat, 03 Jan 2009 22:18:35 +0000 Subject: [issue3638] Remove module level functions in _tkinter that depend on TkappObject In-Reply-To: <1219356014.43.0.144260212562.issue3638@psf.upfronthosting.co.za> Message-ID: <1231021115.7.0.355246258166.issue3638@psf.upfronthosting.co.za> Guilherme Polo added the comment: Uh, I forgot about the code removal in __init__ in the first commits. r68242, r68244 now _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 23:20:58 2009 From: report at bugs.python.org (Brett Cannon) Date: Sat, 03 Jan 2009 22:20:58 +0000 Subject: [issue2983] Ttk support for Tkinter In-Reply-To: <1211911032.63.0.360625687085.issue2983@psf.upfronthosting.co.za> Message-ID: <1231021258.95.0.828601549163.issue2983@psf.upfronthosting.co.za> Brett Cannon added the comment: Do you still need a review for this, Guilherme? If you just need a quick code check I can see if I can make the time for this, but my tkinter knowledge is lacking so it won't be very in-depth. Hopefully this is all isolated enough that even if it is initially broken it won't be a big deal if you just check it in. And do you want this in 2.7 and 3.1, or out of simplicity just 3.1? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 3 23:31:58 2009 From: report at bugs.python.org (Guilherme Polo) Date: Sat, 03 Jan 2009 22:31:58 +0000 Subject: [issue2983] Ttk support for Tkinter In-Reply-To: <1231021258.95.0.828601549163.issue2983@psf.upfronthosting.co.za> Message-ID: Guilherme Polo added the comment: > Do you still need a review for this, Guilherme? If you just need a quick > code check I can see if I can make the time for this, but my tkinter > knowledge is lacking so it won't be very in-depth. Hopefully this is all > isolated enough that even if it is initially broken it won't be a big > deal if you just check it in. > I was waiting more for an "Ok, commit" as I though Fredrik already did a quick code check on it. But of course you can look at it too if you want. Also, would it be fine to leave its tests on lib-tk (2.7) and tkinter (3.1) ? > And do you want this in 2.7 and 3.1, or out of simplicity just 3.1? > I would like both if I can decide on that. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 4 00:01:36 2009 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 03 Jan 2009 23:01:36 +0000 Subject: [issue4718] wsgiref package totally broken In-Reply-To: <1229945457.69.0.495711258596.issue4718@psf.upfronthosting.co.za> Message-ID: <1231023696.88.0.872870518984.issue4718@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Nice catch! I've committed the two patches and we'll see whether it makes the buildbots feel better. ---------- resolution: -> accepted stage: patch review -> committed/rejected status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 4 00:06:18 2009 From: report at bugs.python.org (Brett Cannon) Date: Sat, 03 Jan 2009 23:06:18 +0000 Subject: [issue2983] Ttk support for Tkinter In-Reply-To: <1211911032.63.0.360625687085.issue2983@psf.upfronthosting.co.za> Message-ID: <1231023978.08.0.43835302873.issue2983@psf.upfronthosting.co.za> Brett Cannon added the comment: If Fredrik already reviewed it I don't see why you can't commit. If something goes wrong you can always back the commit out. As for the testing question, I am not sure I understand what you are asking. Are you asking if the tests can stay integrated with tkinter's existing tests? Ans as for versions, put it into whatever versions you want to support. I was just saying you can do 3.1 only if you don't want to the hassle of supporting both versions. If you are up for it then please do both! _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 4 00:23:37 2009 From: report at bugs.python.org (Guilherme Polo) Date: Sat, 03 Jan 2009 23:23:37 +0000 Subject: [issue2983] Ttk support for Tkinter In-Reply-To: <1231023978.08.0.43835302873.issue2983@psf.upfronthosting.co.za> Message-ID: Guilherme Polo added the comment: > As for the testing question, I am not sure I understand what you are > asking. Are you asking if the tests can stay integrated with tkinter's > existing tests? > There are no tests for tkinter, except for some few ones for _tkinter basic functionality living on Lib/test/test_tcl.py If it is ok I can start a test/ directory inside lib-tk and tkinter (py3k), I would then prefix ttk file tests with a "ttk". > Ans as for versions, put it into whatever versions you want to support. > I was just saying you can do 3.1 only if you don't want to the hassle of > supporting both versions. If you are up for it then please do both! Perfect, both then :) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 4 00:30:39 2009 From: report at bugs.python.org (Skip Montanaro) Date: Sat, 03 Jan 2009 23:30:39 +0000 Subject: [issue4824] test_cmd_line failure on Mac OS X for py3k In-Reply-To: <18783.62745.773153.314589@montanaro.dyndns.org> Message-ID: <18783.62745.773153.314589@montanaro.dyndns.org> New submission from Skip Montanaro : test_cmd_line.test_run_code fails for me on Mac OS X: % ./python.exe -bb Lib/test/regrtest.py -v test_cmd_line test_cmd_line test_directories (test.test_cmd_line.CmdLineTest) ... ok test_optimize (test.test_cmd_line.CmdLineTest) ... ok test_q (test.test_cmd_line.CmdLineTest) ... ok test_run_code (test.test_cmd_line.CmdLineTest) ... FAIL test_run_module (test.test_cmd_line.CmdLineTest) ... ok test_run_module_bug1764407 (test.test_cmd_line.CmdLineTest) ... ok test_site_flag (test.test_cmd_line.CmdLineTest) ... ok test_usage (test.test_cmd_line.CmdLineTest) ... ok test_verbose (test.test_cmd_line.CmdLineTest) ... ok test_version (test.test_cmd_line.CmdLineTest) ... ok ====================================================================== FAIL: test_run_code (test.test_cmd_line.CmdLineTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/skip/src/python/py3k/Lib/test/test_cmd_line.py", line 143, in test_run_code 0) AssertionError: 1 != 0 ---------------------------------------------------------------------- Ran 10 tests in 1.282s Manually running what that test executes shows the problem: % ./python.exe Python 3.1a0 (py3k:68218, Jan 3 2009, 15:06:30) [GCC 4.0.1 (Apple Inc. build 5490)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.executable '/Users/skip/src/python/py3k/python.exe' >>> import subprocess >>> import sys >>> cmd_line = [sys.executable, '-E'] >>> cmd_line.extend(['-c', "assert(ord('\xe9') == 0xe9)"]) >>> cmd_line Traceback (most recent call last): File "", line 1, in File "/Users/skip/src/python/py3k/Lib/io.py", line 1488, in write b = encoder.encode(s) File "/Users/skip/src/python/py3k/Lib/encodings/ascii.py", line 22, in encode return codecs.ascii_encode(input, self.errors)[0] UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 68: ordinal not in range(128) >>> sys.getfilesystemencoding() 'utf-8' >>> subprocess.call(cmd_line, stdout=subprocess.PIPE, stderr=subprocess.PIPE) 1 If I execute that command from the shell prompt I do get a zero exit code no matter what I try to mimic the scenario in the test: py3k% ./python.exe -E -c 'assert(ord("\xe9") == 0xe9)' py3k% echo $? 0 py3k% ./python.exe -E -c 'assert(ord("\xe9") == 0xe9)' > /tmp/trash 2>&1 py3k% echo $? 0 py3k% ./python.exe -E -c 'assert(ord("\xe9") == 0xe9)' 2>&1 | cat > /dev/null py3k% echo $? 0 I'm not sure where the problem lies. ---------- messages: 79023 nosy: skip.montanaro severity: normal status: open title: test_cmd_line failure on Mac OS X for py3k _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 4 01:12:35 2009 From: report at bugs.python.org (MagnetoHydroDynamics) Date: Sun, 04 Jan 2009 00:12:35 +0000 Subject: [issue4825] TypeError with complex.real() and complex.imag() In-Reply-To: <1231027955.73.0.619900873026.issue4825@psf.upfronthosting.co.za> Message-ID: <1231027955.73.0.619900873026.issue4825@psf.upfronthosting.co.za> New submission from MagnetoHydroDynamics : In both version 2.6.1 and 3.0 this issue exists: N and M can be two numbers of any type. >>> (N+Mj).real() Traceback (most recent call last): File "", line 1, in (N+Mj).real() TypeError: 'float' object is not callable >>> (N+Mj).imag() Traceback (most recent call last): File "", line 1, in (N+Mj).imag() TypeError: 'float' object is not callable ---------- components: None messages: 79024 nosy: MagnetoHydroDynamics severity: normal status: open title: TypeError with complex.real() and complex.imag() type: behavior versions: Python 3.0 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 4 01:13:51 2009 From: report at bugs.python.org (MagnetoHydroDynamics) Date: Sun, 04 Jan 2009 00:13:51 +0000 Subject: [issue4825] TypeError with complex.real() and complex.imag() In-Reply-To: <1231027955.73.0.619900873026.issue4825@psf.upfronthosting.co.za> Message-ID: <1231028031.82.0.915383131388.issue4825@psf.upfronthosting.co.za> MagnetoHydroDynamics added the comment: In both version 2.6.1 and 3.0 this issue exists: N and M can be two numbers of any type. >>> (N+Mj).real() Traceback (most recent call last): File "", line 1, in (N+Mj).real() TypeError: 'float' object is not callable >>> (N+Mj).imag() Traceback (most recent call last): File "", line 1, in (N+Mj).imag() TypeError: 'float' object is not callable It would be nice to have this fixed, preferably soon. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 4 01:17:35 2009 From: report at bugs.python.org (=?utf-8?q?Tarek_Ziad=C3=A9?=) Date: Sun, 04 Jan 2009 00:17:35 +0000 Subject: [issue1702551] distutils sdist does not exclude SVN/CVS files on Windows Message-ID: <1231028255.42.0.792972506527.issue1702551@psf.upfronthosting.co.za> Tarek Ziad? added the comment: Fixed in r68276. I have added a test together with the patch, and slighty changed your fix. It's applied in the trunk, and 2.6 as well (it will be forwardported into 3.x as well) Thanks for the feedback and the solution ! ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 4 01:19:50 2009 From: report at bugs.python.org (Georg Brandl) Date: Sun, 04 Jan 2009 00:19:50 +0000 Subject: [issue1702551] distutils sdist does not exclude SVN/CVS files on Windows Message-ID: <1231028390.41.0.116228136399.issue1702551@psf.upfronthosting.co.za> Georg Brandl added the comment: Tarek, I don't know if you are already subscribed to the python-checkins mailing list -- I've reviewed the commit and posted a reply with a minor problem there. ---------- nosy: +georg.brandl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 4 01:29:16 2009 From: report at bugs.python.org (Pierre Bourdon) Date: Sun, 04 Jan 2009 00:29:16 +0000 Subject: [issue4825] TypeError with complex.real() and complex.imag() In-Reply-To: <1231027955.73.0.619900873026.issue4825@psf.upfronthosting.co.za> Message-ID: <1231028956.75.0.677528695856.issue4825@psf.upfronthosting.co.za> Pierre Bourdon added the comment: I don't think this is a valid issue : real and imag are just properties of complex objects, not methods ! ---------- nosy: +delroth _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 4 01:34:54 2009 From: report at bugs.python.org (Benoit Boissinot) Date: Sun, 04 Jan 2009 00:34:54 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230325778.98.0.752974375077.issue4753@psf.upfronthosting.co.za> Message-ID: <1231029294.82.0.0361353973148.issue4753@psf.upfronthosting.co.za> Changes by Benoit Boissinot : ---------- nosy: +bboissin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 4 01:39:31 2009 From: report at bugs.python.org (MagnetoHydroDynamics) Date: Sun, 04 Jan 2009 00:39:31 +0000 Subject: [issue4825] TypeError with complex.real() and complex.imag() In-Reply-To: <1231027955.73.0.619900873026.issue4825@psf.upfronthosting.co.za> Message-ID: <1231029571.48.0.477637933994.issue4825@psf.upfronthosting.co.za> MagnetoHydroDynamics added the comment: Nvm. I thought it was metods. Requesting deletion. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 4 01:40:38 2009 From: report at bugs.python.org (=?utf-8?q?Tarek_Ziad=C3=A9?=) Date: Sun, 04 Jan 2009 00:40:38 +0000 Subject: [issue1702551] distutils sdist does not exclude SVN/CVS files on Windows Message-ID: <1231029638.62.0.378265267488.issue1702551@psf.upfronthosting.co.za> Tarek Ziad? added the comment: Georg, I think I am supposed to be registered since a few days but I don't receive any mail yet. I'll ask... I didn't use a raw string because '\.' is not an escape sequence, so: >>> '\.svn' == '\\.svn' and '\.svn' == r'\.svn' True _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 4 01:49:04 2009 From: report at bugs.python.org (Skip Montanaro) Date: Sun, 04 Jan 2009 00:49:04 +0000 Subject: [issue4824] test_cmd_line failure on Mac OS X for py3k In-Reply-To: <18783.62745.773153.314589@montanaro.dyndns.org> Message-ID: <18784.1892.667609.910666@montanaro.dyndns.org> Skip Montanaro added the comment: Here is another data point. I added some print calls to the subprocess module and ran the key call from the interpreter: % ./python.exe Python 3.1a0 (py3k:68218, Jan 3 2009, 15:06:30) [GCC 4.0.1 (Apple Inc. build 5490)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import subprocess >>> import sys >>> cmd_line = [sys.executable, '-E']>>> cmd_line.extend(['-c', "assert(ord('\xe9') == 0xe9)"]) >>> subprocess.call(cmd_line, stdout=subprocess.PIPE, stderr=subprocess.PIPE) 1 wait, returncode= None 2 wait, pid= 4029 sts= 256 5 _handle_exitstatus WIFEXITED 3 wait, returncode= 1 1 >>> os.WIFEXITED(256) True >>> os.WEXITSTATUS(256) 1 >>> 256 & 255 0 A return code of 256 seems to me like the exit code should be 0. From my Mac's wait(2) man page: WEXITSTATUS(status) If WIFEXITED(status) is true, evaluates to the low-order 8 bits of the argument passed to _exit(2) or exit(3) by the child. What's with the WEXITSTATUS return value of 1? Skip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 4 02:04:14 2009 From: report at bugs.python.org (=?utf-8?q?Martin_v._L=C3=B6wis?=) Date: Sun, 04 Jan 2009 01:04:14 +0000 Subject: [issue3997] zipfile and winzip In-Reply-To: <1222701058.88.0.102455918408.issue3997@psf.upfronthosting.co.za> Message-ID: <1231031054.68.0.919851226774.issue3997@psf.upfronthosting.co.za> Changes by Martin v. L?wis : ---------- versions: +Python 2.7, Python 3.0, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 4 03:00:51 2009 From: report at bugs.python.org (Daniel Diniz) Date: Sun, 04 Jan 2009 02:00:51 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230325778.98.0.752974375077.issue4753@psf.upfronthosting.co.za> Message-ID: <1231034451.72.0.0523187640754.issue4753@psf.upfronthosting.co.za> Daniel Diniz added the comment: IIUC, this is what gcc 4.2.4 generates on a Celeron M for the code Alexandre posted: movl -272(%ebp), %eax movl 8(%ebp), %edx subl -228(%ebp), %eax movl %eax, 60(%edx) movl -272(%ebp), %ecx movzbl (%ecx), %eax - addl $1, %ecx movl %ecx, -272(%ebp) movl opcode_targets.9311(,%eax,4), %ecx movl %eax, %ebx - jmp *%ecx And this is what ICC 11.0 generates for (what I think is) the same bit: movl 360(%esp), %ecx movl %esi, %edi subl 304(%esp), %edi movl %edi, 60(%ecx) movzbl (%esi), %ecx - movl opcode_targets.2239.0.34(,%ecx,4), %eax incl %esi - jmp ..B12.137 # Prob 100% # ..B12.137: jmp *%eax Does this mean that icc handles register starvation better here? FWIW, on this CPU, compiling with icc gives a 20% speed boost in pybench regardless of this patch. ---------- nosy: +ajaksu2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 4 03:28:10 2009 From: report at bugs.python.org (Paolo 'Blaisorblade' Giarrusso) Date: Sun, 04 Jan 2009 02:28:10 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230325778.98.0.752974375077.issue4753@psf.upfronthosting.co.za> Message-ID: <1231036090.6.0.103983847749.issue4753@psf.upfronthosting.co.za> Paolo 'Blaisorblade' Giarrusso added the comment: 1st note: is that code from the threaded version? Note that you need to modify the source to make it accept also ICC to try that. In case you already did that, I guess the patch is not useful at all with ICC since, as far as I can see, the jump is shared. It is vital to this patch that the jump is not shared, something similar to -fno-crossjumping should be found. 2nd note: the answer to your questions seems yes, ICC has less register spills. Look for instance at: movl -272(%ebp), %ecx movzbl (%ecx), %eax addl $1, %ecx and movzbl (%esi), %ecx incl %esi This represents the increment of the program counter after loading the next opcode. In the code you posted, one can see that the program counter is spilled to memory by GCC, but isn't by ICC. Either the spill is elsewhere, or ICC is better here. And it's widely known that ICC has a much better optimizer in many cases, and I remember that GCC register allocator really needs improvement. Finally, I'm a bit surprised by "addl $1, %ecx", since any peephole optimizer should remove that; I'm not shocked just because I've never seen perfect GCC output. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 4 03:29:10 2009 From: report at bugs.python.org (Paolo 'Blaisorblade' Giarrusso) Date: Sun, 04 Jan 2009 02:29:10 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230325778.98.0.752974375077.issue4753@psf.upfronthosting.co.za> Message-ID: <1231036150.01.0.453840482426.issue4753@psf.upfronthosting.co.za> Paolo 'Blaisorblade' Giarrusso added the comment: Daniel, I forgot to ask for the compilation command line you used, since they make a lot of difference. Can you post them? Thanks _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 4 04:07:10 2009 From: report at bugs.python.org (Daniel Diniz) Date: Sun, 04 Jan 2009 03:07:10 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1231036090.6.0.103983847749.issue4753@psf.upfronthosting.co.za> Message-ID: <2d75d7660901031907n580d9d4eu5e7cda5287650fd2@mail.gmail.com> Daniel Diniz added the comment: Paolo 'Blaisorblade' Giarrusso wrote: > > 1st note: is that code from the threaded version? [...] It is vital to > this patch that the jump is not shared, something similar to > -fno-crossjumping should be found. Yes, threaded version by unconditionally defining USE_THREADED_CODE (old patch version :). Ok, I'll try to find a way to get at -fno-crossjumping behavior. BTW, man gcc suggests using -fno-gcse for programs that use computed gotos (couldn't fin [...] > In the code you posted, one can see that the program > counter is spilled to memory by GCC, but isn't by ICC. Either the spill > is elsewhere, or ICC is better here. I can [mail you|attach here] icc's output if you want to check the overall code, it's about 1.9M with the code annotations. > Finally, I'm a bit surprised by "addl $1, %ecx", since any peephole > optimizer should remove that; I'm not shocked just because I've never > seen perfect GCC output. I'm glad to see the same issue in Alexandre's output, not my fault then :D The command line I used (after a clean build with gcc) was: icc -pthread -c -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -w -I. -IInclude -I./Include -DPy_BUILD_CORE -S -fcode-asm -fsource-asm -dA Python/ceval.c (same as with gcc, except for warnings and -fcode-asm -fsource-asm). _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 4 05:16:15 2009 From: report at bugs.python.org (xverify) Date: Sun, 04 Jan 2009 04:16:15 +0000 Subject: [issue4826] exec() docstring bug about file objects In-Reply-To: <1231042574.98.0.745471149157.issue4826@psf.upfronthosting.co.za> Message-ID: <1231042574.98.0.745471149157.issue4826@psf.upfronthosting.co.za> New submission from xverify : exec() no longer accepts a file object but its docstring states otherwise. ---------- assignee: georg.brandl components: Documentation messages: 79036 nosy: georg.brandl, xverify severity: normal status: open title: exec() docstring bug about file objects versions: Python 3.0 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 4 05:51:14 2009 From: report at bugs.python.org (Alexandre Vassalotti) Date: Sun, 04 Jan 2009 04:51:14 +0000 Subject: [issue4753] Faster opcode dispatch on gcc In-Reply-To: <1230325778.98.0.752974375077.issue4753@psf.upfronthosting.co.za> Message-ID: <1231044674.89.0.486573368494.issue4753@psf.upfronthosting.co.za> Alexandre Vassalotti added the comment: Paolo wrote: > So, can you try dropping the switch altogether, using always computed > goto and seeing how does the resulting code get compiled? Removing the switch won't be possible unless we change the semantic EXTENDED_ARG. In addition, I doubt the improvement, if any, would worth the increased complexity. > To be absolutely clear: x86_64 has more registers, so the rest of the > interpreter is faster than x86, but dispatch still takes the same > absolute time, which is 70% on x86_64, but only 50% on x86 (those are > realistic figures); I don't understand what you mean by "absolute time" here. Do you actually mean the time spent interpreting bytecodes compared to the time spent in the other parts of Python? If so, your figures are wrong for CPython on x86-64. It is about 50% just like on x86 (when running pybench). With the patch, this drops to 35% on x86-64 and to 45% on x86. > In my toy interpreter, computing last_i for each dispatch doesn't give > any big slowdown, but storing it in f->last_i gives a ~20% slowdown. I patched ceval.c to minimize f->last_i manipulations in the dispatch code. On x86, I got an extra 9% speed up on pybench. However, the patch is a bit clumsy and a few unit tests are failing. I will see if I can improve it and open a new issue if worthwhile. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 4 06:35:24 2009 From: report at bugs.python.org (Pavel Kosina) Date: Sun, 04 Jan 2009 05:35:24 +0000 Subject: [issue3087] Clean up Demos and Tools In-Reply-To: <1213238540.5.0.535212077097.issue3087@psf.upfronthosting.co.za> Message-ID: <1231047323.9.0.143817390834.issue3087@psf.upfronthosting.co.za> Pavel Kosina added the comment: +1 In Tkinter there is still import Tkinter and not import tkinter. ---------- nosy: +geon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 4 07:50:43 2009 From: report at bugs.python.org (Jason Kankiewicz) Date: Sun, 04 Jan 2009 06:50:43 +0000 Subject: [issue4827] optparse: Callback example 1 is confusing In-Reply-To: <1231051843.8.0.720726802561.issue4827@psf.upfronthosting.co.za> Message-ID: <1231051843.8.0.720726802561.issue4827@psf.upfronthosting.co.za> New submission from Jason Kankiewicz : "Callback example 1: trivial callback" reads Here?s an example of a callback option that takes no arguments, and simply records that the option was seen: def record_foo_seen(option, opt_str, value, parser): parser.saw_foo = True parser.add_option("--foo", action="callback", callback=record_foo_seen) but the following paragraph Of course, you could do that with the store_true action. is wrong because parser.add_option("--foo", action="store_true", dest="saw_foo") would actually be duplicated by def record_foo_seen(option, opt_str, value, parser): parser.values.saw_foo = True parser.add_option("--foo", action="callback", callback=record_foo_seen) For example: >>> from optparse import OptionParser >>> parser = OptionParser() >>> def record_foo_seen(option, opt_str, value, parser): ... parser.saw_foo = True ... >>> parser.add_option("--foo", action="callback", callback=record_foo_seen)