python-graph 1.8.2 released

2012-07-15 Thread Pedro Matiello
python-graph release 1.8.2 http://code.google.com/p/python-graph/ python-graph is a library for working with graphs in Python. This software provides a suitable data structure for representing graphs and a whole set

Re: [OT] Simulation Results Managment

2012-07-15 Thread Dieter Maurer
moo...@yahoo.co.uk writes: ... Does pickle have any advantages over json/yaml? It can store and retrieve almost any Python object with almost no effort. Up to you whether you see it as an advantage to be able to store objects rather than (almost) pure data with a rather limited type set. Of

Re: Python and Qt4 Designer

2012-07-15 Thread Vincent Vande Vyvre
On 15/07/12 07:31, Michael Torrie wrote: On 07/14/2012 11:13 AM, rusi wrote: I looked at the second link and find code like this: app = None if ( not app ): app = QtGui.QApplication([]) Maybe I'm dense but whats that if doing there? Frankly I seem to be a bit jinxed with gui stuff. A few

Implicit conversion to boolean in if and while statements

2012-07-15 Thread Andrew Berg
This has probably been discussed before, but why is there an implicit conversion to a boolean in if and while statements? if not None: print('hi') prints 'hi' since bool(None) is False. If this was discussed in a PEP, I would like a link to it. There are so many PEPs, and I wouldn't know

Re: lambda in list comprehension acting funny

2012-07-15 Thread Steven D'Aprano
On Sun, 15 Jul 2012 10:49:48 +1000, Chris Angelico wrote: On Sun, Jul 15, 2012 at 9:29 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Not necessarily *compile* time, but the distinction is between when the function is defined (which may at compile time, or it may be at run

Re: lambda in list comprehension acting funny

2012-07-15 Thread Chris Angelico
On Sun, Jul 15, 2012 at 6:32 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: At compile time, Python parses the source code and turns it into byte- code. Class and function definitions are executed at run time, the same as any other statement. Between the parse step and the

Re: Implicit conversion to boolean in if and while statements

2012-07-15 Thread Chris Angelico
On Sun, Jul 15, 2012 at 6:34 PM, Andrew Berg bahamutzero8...@gmail.com wrote: Converting 0 and 1 to False and True seems reasonable, but I don't see the point in converting other arbitrary values. It's for convenience. Unfortunately, not all languages treat all types the same way. It's very

Re: Implicit conversion to boolean in if and while statements

2012-07-15 Thread Stefan Behnel
Andrew Berg, 15.07.2012 10:34: This has probably been discussed before, but why is there an implicit conversion to a boolean in if and while statements? There isn't. This has nothing to do with if or while. All objects have a truth value in Python, evaluating to True by default (object),

Re: lambda in list comprehension acting funny

2012-07-15 Thread Terry Reedy
On 7/15/2012 4:32 AM, Steven D'Aprano wrote: On Sun, 15 Jul 2012 10:49:48 +1000, Chris Angelico wrote: On Sun, Jul 15, 2012 at 9:29 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Not necessarily *compile* time, but the distinction is between when the function is defined

Re: Implicit conversion to boolean in if and while statements

2012-07-15 Thread Steven D'Aprano
On Sun, 15 Jul 2012 03:34:46 -0500, Andrew Berg wrote: This has probably been discussed before, By the hoary hosts of Hoggoth, has it ever! but why is there an implicit conversion to a boolean in if and while statements? It's nothing to do with if and while. All Python objects are

Re: [OT] Simulation Results Managment

2012-07-15 Thread Neal Becker
Dieter Maurer wrote: moo...@yahoo.co.uk writes: ... Does pickle have any advantages over json/yaml? It can store and retrieve almost any Python object with almost no effort. Up to you whether you see it as an advantage to be able to store objects rather than (almost) pure data with a

Re: 2 + 2 = 5

2012-07-15 Thread samuel . marks
On Friday, July 6, 2012 8:39:58 AM UTC+10, Andrew Cooper wrote: On 05/07/2012 22:46, Evan Driscoll wrote: gt; On 01/-10/-28163 01:59 PM, Alexander Blinne wrote: gt;gt; 5+0 is actually 4+0, because 5 == 4, so 5+0 gives 4. gt;gt; 5+1 is actually 4+1, which is 5, but 5 is again 4. gt;gt; 5+2 is

Re: Keeping the Console Open with IDLE

2012-07-15 Thread rantingrickjohnson
On Friday, February 20, 2009 9:41:42 AM UTC-6, David Smith wrote: What I meant was open open the command prompt, type cd, space, DO NOT hit enter yet. Drag the folder with your script into the command prompt window. Then go to the command prompt window and hit enter. This should compose a

Re: Keeping the Console Open with IDLE

2012-07-15 Thread Chris Angelico
On Mon, Jul 16, 2012 at 1:35 AM, rantingrickjohn...@gmail.com wrote: Besides, you can skip most of those steps by Shift+RightClicking the file icon and choosing Open Command Window Here. That's not standard. Me, I can invoke git bash anywhere I want it, but that doesn't mean I'd recommend

Re: Keeping the Console Open with IDLE

2012-07-15 Thread Rick Johnson
On Sunday, July 15, 2012 10:57:00 AM UTC-5, Chris Angelico wrote: On Mon, Jul 16, 2012 at 1:35 AM, rantingrickjohn...@gmail.com wrote: Besides, you can skip most of those steps by Shift+RightClicking the file icon and choosing Open Command Window Here. That's not standard. Me, I can invoke

Re: Implicit conversion to boolean in if and while statements

2012-07-15 Thread Ian Kelly
On Sun, Jul 15, 2012 at 4:56 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: (For the record, I can only think of one trap for the unwary: time objects are false at *exactly* midnight.) Ugh, that's irritating. I can't think of any scenario where I would ever want the semantics

Re: Simulation Results Managment

2012-07-15 Thread rusi
On Jul 15, 11:35 am, Dieter Maurer die...@handshake.de wrote: moo...@yahoo.co.uk writes: ... Does pickle have any advantages over json/yaml? It can store and retrieve almost any Python object with almost no effort. Up to you whether you see it as an advantage to be able to store objects

Re: Keeping the Console Open with IDLE

2012-07-15 Thread Chris Angelico
On Mon, Jul 16, 2012 at 2:19 AM, Rick Johnson rantingrickjohn...@gmail.com wrote: On Sunday, July 15, 2012 10:57:00 AM UTC-5, Chris Angelico wrote: On Mon, Jul 16, 2012 at 1:35 AM, rantingrickjohn...@gmail.com wrote: Besides, you can skip most of those steps by Shift+RightClicking the file

Re: Implicit conversion to boolean in if and while statements

2012-07-15 Thread Rick Johnson
On Sunday, July 15, 2012 11:19:16 AM UTC-5, Ian wrote: On Sun, Jul 15, 2012 at 4:56 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: (For the record, I can only think of one trap for the unwary: time objects are false at *exactly* midnight.) Ugh, that's irritating. I can't

Re: Implicit conversion to boolean in if and while statements

2012-07-15 Thread Andrew Berg
On 7/15/2012 5:56 AM, Steven D'Aprano wrote: 3) Rather than distinguishing true from false, a more useful dichotomy is between something and nothing. Python includes a number of ways of spelling nothing of various types, such as: None, 0, 0.0, '', [], {}, set() and nearly everything

Re: Implicit conversion to boolean in if and while statements

2012-07-15 Thread Andrew Berg
On 7/15/2012 11:19 AM, Ian Kelly wrote: Ugh, that's irritating. I can't think of any scenario where I would ever want the semantics if timeval (is not midnight):. It's not implemented with such a test, but logging.handlers.TimedRotatingFileHandler has an option to rollover at midnight. --

Re: Request for useful functions on dicts

2012-07-15 Thread Ian Kelly
On Sat, Jul 14, 2012 at 5:56 PM, Leif leif.poor...@gmail.com wrote: Hi, everybody. I am trying to collect all the functions I've found useful for working with dicts into a library: https://github.com/leifp/dictutil If you have a favorite dict-related func / class, or know of similar

Re: Implicit conversion to boolean in if and while statements

2012-07-15 Thread Ian Kelly
On Sun, Jul 15, 2012 at 11:16 AM, Andrew Berg bahamutzero8...@gmail.com wrote: On 7/15/2012 11:19 AM, Ian Kelly wrote: Ugh, that's irritating. I can't think of any scenario where I would ever want the semantics if timeval (is not midnight):. It's not implemented with such a test, but

Re: Implicit conversion to boolean in if and while statements

2012-07-15 Thread Ian Kelly
On Sun, Jul 15, 2012 at 10:50 AM, Rick Johnson rantingrickjohn...@gmail.com wrote: I think this issue is not so much a bool test vs type test, but more an ambiguous syntax issue. Consider this: ## EXAMPLE A ## py if money: ... do_something() The syntax if money implies we are

Re: Initial nose experience

2012-07-15 Thread python
Hi Roy, I've been using unittest for many years, but have steadfastly (perhaps stubbornly) avoided newfangled improvements like nose. I finally decided to take a serious look at nose. Thanks for sharing your nose experience. What motivated you to migrate from unittest to nose? After years

Re: Implicit conversion to boolean in if and while statements

2012-07-15 Thread Rick Johnson
On Sunday, July 15, 2012 1:01:58 PM UTC-5, Ian wrote: So now instead of having to understand how if handles arbitrary values, we have to understand how bool handles arbitrary values. How is that an improvement? Because we are keeping the condition consistent. We are not relying on implicit

Re: Initial nose experience

2012-07-15 Thread Roy Smith
In article mailman.2149.1342375358.4697.python-l...@python.org, pyt...@bdurham.com wrote: Hi Roy, I've been using unittest for many years, but have steadfastly (perhaps stubbornly) avoided newfangled improvements like nose. I finally decided to take a serious look at nose. Thanks

Re: lambda in list comprehension acting funny

2012-07-15 Thread Hans Mulder
On 15/07/12 10:44:09, Chris Angelico wrote: On Sun, Jul 15, 2012 at 6:32 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: At compile time, Python parses the source code and turns it into byte- code. Class and function definitions are executed at run time, the same as any other

Re: Request for useful functions on dicts

2012-07-15 Thread Leif
Thanks for the suggestions, Ian! I implemented most of them and pushed the code. That#39;s because the Pythonic way is to either create a new object and return it, or mutate the existing object and return None. You're saying what I was already thinking. In Python 2.7+, intersection and

Re: Implicit conversion to boolean in if and while statements

2012-07-15 Thread Terry Reedy
On 7/15/2012 12:19 PM, Ian Kelly wrote: On Sun, Jul 15, 2012 at 4:56 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: (For the record, I can only think of one trap for the unwary: time objects are false at *exactly* midnight.) Ugh, that's irritating. I can't think of any

Re: Implicit conversion to boolean in if and while statements

2012-07-15 Thread Terry Reedy
On 7/15/2012 1:02 PM, Andrew Berg wrote: On 7/15/2012 5:56 AM, Steven D'Aprano wrote: 3) Rather than distinguishing true from false, a more useful dichotomy is between something and nothing. Python includes a number of ways of spelling nothing of various types, such as: None, 0, 0.0, '',

Re: Implicit conversion to boolean in if and while statements

2012-07-15 Thread Chris Angelico
On Mon, Jul 16, 2012 at 4:56 AM, Rick Johnson rantingrickjohn...@gmail.com wrote: On Sunday, July 15, 2012 1:01:58 PM UTC-5, Ian wrote: So now instead of having to understand how if handles arbitrary values, we have to understand how bool handles arbitrary values. How is that an improvement?

Re: Implicit conversion to boolean in if and while statements

2012-07-15 Thread Ranting Rick
On Jul 15, 4:53 pm, Chris Angelico ros...@gmail.com wrote: Then the construct if bool(some_condition): is redundant. Wrong again, pay attention Chris! It's ONLY redundant IF some_condition is a rich comparison: like (a==b) OR a boolean function: like callable(a). If HOWEVER we want to truth

Diagramming code

2012-07-15 Thread hamilton
Is there any software to help understand python code ? Thanks hamilton -- http://mail.python.org/mailman/listinfo/python-list

Re: Diagramming code

2012-07-15 Thread Chris Rebert
On Sun, Jul 15, 2012 at 6:26 PM, hamilton hamil...@nothere.com wrote: Subject: Diagramming code Is there any software to help understand python code ? What sort of diagrams? Control flow diagrams? Class diagrams? Sequence diagrams? Module dependency diagrams? There are many different types you

Re: Implicit conversion to boolean in if and while statements

2012-07-15 Thread Chris Angelico
On Mon, Jul 16, 2012 at 11:21 AM, Ranting Rick rantingrickjohn...@gmail.com wrote: If HOWEVER we want to truth test an object (as in: if obj) we should be FORCED to use the bool! Why? Because explicit is better than implicit and readability counts if we want to create maintainable code bases!

Re: Diagramming code

2012-07-15 Thread hamilton
On 7/15/2012 7:38 PM, Chris Rebert wrote: On Sun, Jul 15, 2012 at 6:26 PM, hamilton hamil...@nothere.com wrote: Subject: Diagramming code Is there any software to help understand python code ? What sort of diagrams? Control flow diagrams? Class diagrams? Sequence diagrams? Module dependency

Re: Diagramming code

2012-07-15 Thread Chris Rebert
On Sun, Jul 15, 2012 at 6:57 PM, hamilton hamil...@nothere.com wrote: On 7/15/2012 7:38 PM, Chris Rebert wrote: On Sun, Jul 15, 2012 at 6:26 PM, hamilton hamil...@nothere.com wrote: Subject: Diagramming code Is there any software to help understand python code ? What sort of diagrams?

Re: Implicit conversion to boolean in if and while statements

2012-07-15 Thread Steven D'Aprano
On Sun, 15 Jul 2012 10:19:16 -0600, Ian Kelly wrote: On Sun, Jul 15, 2012 at 4:56 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: (For the record, I can only think of one trap for the unwary: time objects are false at *exactly* midnight.) Ugh, that's irritating. I can't

Re: Implicit conversion to boolean in if and while statements

2012-07-15 Thread Devin Jeanpierre
On Sun, Jul 15, 2012 at 9:51 PM, Chris Angelico ros...@gmail.com wrote: if bool(obj) and a==b: # Correct! if obj and a==b: # Incorrect! That still doesn't answer the question of what bool(obj) should do if obj is not a bool, and why if can't do the exact same thing, since if, by

Re: Implicit conversion to boolean in if and while statements

2012-07-15 Thread Ranting Rick
On Jul 15, 8:51 pm, Chris Angelico ros...@gmail.com wrote: On Mon, Jul 16, 2012 at 11:21 AM, Ranting Rick rantingrickjohn...@gmail.com wrote: If HOWEVER we want to truth test an object (as in: if obj) we should be FORCED to use the bool! Why? Because explicit is better than implicit and

Re: Implicit conversion to boolean in if and while statements

2012-07-15 Thread Steven D'Aprano
On Sun, 15 Jul 2012 12:02:37 -0500, Andrew Berg wrote: On 7/15/2012 5:56 AM, Steven D'Aprano wrote: 3) Rather than distinguishing true from false, a more useful dichotomy is between something and nothing. Python includes a number of ways of spelling nothing of various types, such as:

Re: Implicit conversion to boolean in if and while statements

2012-07-15 Thread Ranting Rick
On Jul 15, 9:13 pm, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: I have just written a bunch of code with about two dozen examples similar to this: for item in (seq or []):     do_something_with(item) iterates over seq if it is non-empty, or the empty list. Writing it like

Re: Implicit conversion to boolean in if and while statements

2012-07-15 Thread Chris Angelico
On Mon, Jul 16, 2012 at 12:41 PM, Ranting Rick rantingrickjohn...@gmail.com wrote: On Jul 15, 9:13 pm, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: I have just written a bunch of code with about two dozen examples similar to this: for item in (seq or []):

Re: Implicit conversion to boolean in if and while statements

2012-07-15 Thread Ranting Rick
On Jul 15, 9:15 pm, Devin Jeanpierre jeanpierr...@gmail.com wrote: For example, instead of if stack: or if bool(stack):, we could use if stack.isempty():. This line tells us explicitly that stack is a container. Or instead of if dist: or if bool(dist): we could use if dist == 0:. This tells

Re: Implicit conversion to boolean in if and while statements

2012-07-15 Thread Steven D'Aprano
On Sun, 15 Jul 2012 18:21:06 -0700, Ranting Rick wrote: If HOWEVER we want to truth test an object (as in: if obj) we should be FORCED to use the bool! Why? Because explicit is better than implicit And this is why Rick always writes code like: integer_value_three = int(1) + int(2) assert

Re: Implicit conversion to boolean in if and while statements

2012-07-15 Thread Chris Angelico
On Mon, Jul 16, 2012 at 12:58 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: And that, the reason given in the sentence above, is the reason that we, collectively all programmers, should prefer to be explicit, not merely conveying meaning by implication about everything we,

Re: Implicit conversion to boolean in if and while statements

2012-07-15 Thread Ranting Rick
On Jul 15, 9:58 pm, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Sun, 15 Jul 2012 18:21:06 -0700, Ranting Rick wrote: If HOWEVER we want to truth test an object (as in: if obj) we should be FORCED to use the bool! Why? Because explicit is better than implicit And this is

Re: Implicit conversion to boolean in if and while statements

2012-07-15 Thread Steven D'Aprano
On Sun, 15 Jul 2012 22:15:13 -0400, Devin Jeanpierre wrote: For example, instead of if stack: or if bool(stack):, we could use if stack.isempty():. This line tells us explicitly that stack is a container. isempty is not a container method. py container = [] py container.isempty() Traceback

Re: Implicit conversion to boolean in if and while statements

2012-07-15 Thread Ranting Rick
On Jul 15, 11:03 pm, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Sun, 15 Jul 2012 22:15:13 -0400, Devin Jeanpierre wrote: It boggles my mind that people who are perfectly happy to program to an interface or protocol when it comes to (say) iterables, numbers or even big

Re: Implicit conversion to boolean in if and while statements

2012-07-15 Thread Ranting Rick
On Jul 15, 11:20 pm, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: (It's not like explicit and implicit are distinct -- everything depends on something implicit, if only the meaning of the words you use to describe it.) It certainly doesn't mean that the semantics of Python

[issue1767933] Badly formed XML using etree and utf-16

2012-07-15 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: Thank you, Eli. However changes to tostring() and tostringlist() break the invariant b.join(tostringlist(element, 'utf-16')) == tostring(element, 'utf-16'). You should add followed methods to DataStream: def seekable(self):

[issue1470548] Bugfix for #1470540 (XMLGenerator cannot output UTF-16)

2012-07-15 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: Here is updated patch with more careful handling of closing (as for issue1767933) and added comments. -- nosy: +eli.bendersky Added file: http://bugs.python.org/file26385/XMLGenerator-3.patch

[issue4997] xml.sax.saxutils.XMLGenerator should write to io.RawIOBase.

2012-07-15 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: This issue will be fixed by patch for issue1470548. -- nosy: +storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4997 ___

[issue15357] Deprecate redundant pieces of pkgutil

2012-07-15 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 3987667bf98f by Nick Coghlan in branch 'default': Take the first step in resolving the messy pkgutil vs importlib edge cases by basing pkgutil explicitly on importlib, deprecating its internal import emulation and

[issue15343] pydoc -w package writes out page with empty Package Contents section

2012-07-15 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 3987667bf98f by Nick Coghlan in branch 'default': Take the first step in resolving the messy pkgutil vs importlib edge cases by basing pkgutil explicitly on importlib, deprecating its internal import emulation and

[issue15314] Use importlib instead of pkgutil in runpy

2012-07-15 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 3987667bf98f by Nick Coghlan in branch 'default': Take the first step in resolving the messy pkgutil vs importlib edge cases by basing pkgutil explicitly on importlib, deprecating its internal import emulation and

[issue15314] Use importlib instead of pkgutil in runpy

2012-07-15 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: OK, I think runpy and __main__.__loader__ are all sorted now. The relevant runpy and command line script tests all check for the expected values, and I added a couple of new tests to cover the -c and reading from stdin cases. --

[issue15272] pkgutil.find_loader accepts invalid module names

2012-07-15 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- assignee: - ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15272 ___ ___ Python-bugs-list

[issue15272] pkgutil.find_loader accepts invalid module names

2012-07-15 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: OK, this one is trickier than I thought - the exact behaviour depends on how you traverse the code, and I believe a PEP 302 importer is technically allowed to accept / in module names. (Unless there's a module names must be valid identifiers

[issue15358] Test pkgutil.walk_packages in test_pkgutil instead of test_runpy

2012-07-15 Thread Nick Coghlan
New submission from Nick Coghlan ncogh...@gmail.com: Created to record the egregious hack of relying on the test_runpy infrastructure in order to test pkgutil.walk_packages. It gets the job done, but is a really messy way of going about it. Worth cleaning up by factoring the support code out

[issue15358] Test pkgutil.walk_packages in test_pkgutil instead of test_runpy

2012-07-15 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- dependencies: +pydoc -w package writes out page with empty Package Contents section ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15358 ___

[issue11322] encoding package's normalize_encoding() function is too slow

2012-07-15 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: I don't know who changed the encoding's package normalize_encoding() function (wasn't me), but it's a really slow implementation. See changeset 54ef645d08e4. -- nosy: +storchaka ___ Python

[issue15343] pydoc -w package writes out page with empty Package Contents section

2012-07-15 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 9101eab6178c by Nick Coghlan in branch 'default': Issue #15343: Handle importlib.machinery.FileFinder instances in pkgutil.walk_packages (et al) http://hg.python.org/cpython/rev/9101eab6178c --

[issue15358] Test pkgutil.walk_packages in test_pkgutil instead of test_runpy

2012-07-15 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Also, a second test case should be added to cover the zipimporter.zipimporter component. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15358

[issue15358] Test pkgutil.walk_packages in test_pkgutil instead of test_runpy

2012-07-15 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- priority: low - normal ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15358 ___ ___ Python-bugs-list

[issue15343] pydoc -w package writes out page with empty Package Contents section

2012-07-15 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Fixing this has uncovered another issue: the old import emulation in PEP 302 ignored encoding cookies, thus merrily decoding everything as utf-8 in get_source(). importlib is smarter about this, which means the pydoc tests started failing as

[issue15343] pydoc -w package writes out page with empty Package Contents section

2012-07-15 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 7d202353a728 by Nick Coghlan in branch 'default': Issue #15343: A lot more than just unicode decoding can go wrong when retrieving a source file http://hg.python.org/cpython/rev/7d202353a728 --

[issue9319] imp.find_module('test/badsyntax_pep3120') causes segfault

2012-07-15 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset ce0687a8383b by Nick Coghlan in branch 'default': Issue #9319: Remove the workaround for this since fixed problem from pydoc http://hg.python.org/cpython/rev/ce0687a8383b --

[issue15343] pydoc -w package writes out page with empty Package Contents section

2012-07-15 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Main change in that last commit is really the one to make pydoc ignore just about *any* exception from get_source(). This should make it more robust against buggy loaders, too. -- ___ Python

[issue15343] pydoc -w package writes out page with empty Package Contents section

2012-07-15 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: And a manual check confirms the higher level issue is also fixed. (I believe there's already a meta issue somewhere about the lack of automated tests for pydoc's emitted HTML) -- resolution: - fixed status: open - closed

[issue15357] Deprecate redundant pieces of pkgutil

2012-07-15 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: I'm pretty sure I got them all while fixing #15343 -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org

[issue15356] '\xa0' isspace returns true while compiling python on solaris 10 by users using gcc 3.4.6

2012-07-15 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: I'm sorry, It looks like you said it was working as you expected in 2.7, and you marked it for version 2.6. So what is the bug that you see in 2.7? -- ___ Python tracker

[issue15359] Sockets support for CAN_BCM

2012-07-15 Thread Brian Thorne
New submission from Brian Thorne hardb...@gmail.com: In addition to CAN_RAW introduced in Python 3.3, it would be really useful to expose the CAN_BCM protocol. Effectively it hands off as much to the kernel as possible which gives Python programs the ability to send and receive many periodic

[issue15359] Sockets support for CAN_BCM

2012-07-15 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +neologix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15359 ___ ___ Python-bugs-list mailing

[issue15356] '\xa0' isspace returns true while compiling python on solaris 10 by users using gcc 3.4.6

2012-07-15 Thread zoupl
zoupl zoupen...@gmail.com added the comment: No, i mean it works ok on version 2.7. However, what I want to know is the way that works in version2.7, because I want to try to fix it in version 2.6. -- ___ Python tracker rep...@bugs.python.org

[issue15180] Cryptic traceback from os.path.join when mixing str bytes

2012-07-15 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset cf1ac0c9e753 by Hynek Schlawack in branch '3.2': #15180: Clarify posixpath.join() error message when mixing str bytes http://hg.python.org/cpython/rev/cf1ac0c9e753 New changeset 1462b963e5ce by Hynek Schlawack in

[issue15180] Cryptic traceback from os.path.join when mixing str bytes

2012-07-15 Thread Hynek Schlawack
Hynek Schlawack h...@ox.cx added the comment: Fixed for 3.2 default. -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15180

[issue15307] Patch for --symlink support in pyvenv with framework python

2012-07-15 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset f954ee489896 by Vinay Sajip in branch 'default': Issue #15307: Skipped test_venv:test_prefixes when run from a venv. http://hg.python.org/cpython/rev/f954ee489896 -- nosy: +python-dev

[issue15356] '\xa0' isspace returns true while compiling python on solaris 10 by users using gcc 3.4.6

2012-07-15 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Ah. I have no idea. I did a search and could not find an issue about it being fixed...that doesn't mean there wasn't one, though. Does the problem occur *only* solaris? Because if it isn't solaris specific it might be this one: issue

[issue15349] SyntaxError b0rked grammar

2012-07-15 Thread Roger Serwy
Roger Serwy roger.se...@gmail.com added the comment: Thank you for the bug report, Ztatik. Since 2.6 is now in security-fix-only mode, this issue will not be fixed. See http://www.python.org/getit/releases/2.6.8/ This grammar issue was fixed in 2.7 with revision 386922b629c3, but was not

[issue15351] Add to unittest.TestCase support for using context managers

2012-07-15 Thread Michael Foord
Michael Foord mich...@voidspace.org.uk added the comment: A method on TestCase that *just* executes the test method - allowing for overriding in subclasses - is an interesting idea. Including setUp and tearDown would be harder because TestCase necessarily does a bunch of bookkeeping between

[issue15202] followlinks/follow_symlinks/symlinks flags unification

2012-07-15 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: The .4 patches both LGTM, please commit! You're the one with commit rights here ;) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15202

[issue15233] atexit: guarantee order of execution of registered functions?

2012-07-15 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Shall I also backport to 2.7 and 3.2 as the issue suggests? If the tests are there, yes! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15233

[issue14787] pkgutil.walk_packages returns extra modules

2012-07-15 Thread Chris Jerdonek
Chris Jerdonek chris.jerdo...@gmail.com added the comment: For the record, this issue is still present after Nick's pkgutil changes documented in issue 15343 (not that I expected it to be resolved since this issue is a bit different). -- ___ Python

[issue15358] Test pkgutil.walk_packages in test_pkgutil instead of test_runpy

2012-07-15 Thread Chris Jerdonek
Changes by Chris Jerdonek chris.jerdo...@gmail.com: -- nosy: +cjerdonek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15358 ___ ___

[issue15360] Behavior of assigning to __dict__ is not documented

2012-07-15 Thread Davide Rizzo
New submission from Davide Rizzo sor...@gmail.com: The documentation (at least the obvious places, see Doc/reference/datamodel.rst) says classes and class instances have the '__dict__' attribute, but nothing is said about what happens when assigning to it (like obj.__dict__ = something). As

[issue15297] pkgutil.iter_importers() includes an ImpImporter

2012-07-15 Thread Chris Jerdonek
Chris Jerdonek chris.jerdo...@gmail.com added the comment: Closing as this is no longer an issue after Nick's pkgutil changes documented in issue 15343. -- status: open - closed ___ Python tracker rep...@bugs.python.org

[issue15358] Test pkgutil.walk_packages in test_pkgutil instead of test_runpy

2012-07-15 Thread Chris Jerdonek
Chris Jerdonek chris.jerdo...@gmail.com added the comment: Such helper functionality could also be used in the tests of unittest.TestLoader.loadTestsFromName(). See, for example, the tests proposed for issue 7559. -- ___ Python tracker

[issue8229] Interpreter crash on application shutdown

2012-07-15 Thread Roger Serwy
Roger Serwy roger.se...@gmail.com added the comment: tb220, is this still a bug? Python 2.6 is now in security-fix-only mode. -- nosy: +serwy status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8229

[issue15202] followlinks/follow_symlinks/symlinks flags unification

2012-07-15 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 758a9023d836 by Larry Hastings in branch 'default': Issue #15202: Consistently use the name follow_symlinks for http://hg.python.org/cpython/rev/758a9023d836 -- nosy: +python-dev

[issue14988] _elementtree: Raise ImportError when importing of pyexpat fails

2012-07-15 Thread Arfrever Frehtes Taifersar Arahesis
Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com added the comment: IMHO wrong exception could be treated as a bug, which could be fixed in 3.2 and 3.3. Benjamin Peterson and Georg Brandl: What do you think? P.S. is there any way to create a test for it? You can set

[issue15352] importlib.h should be regenerated when the marshaling code changes

2012-07-15 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Eric, that is a good point, but if someone forgets (like I did) or just hasn't gotten around to bumping the number yet, then the build breaks because the interpreter crashes. I think we should always try to avoid building an interpreter that

[issue15361] venv's Activate.ps1 causes broken prompt with powershell

2012-07-15 Thread Richard Oudkerk
New submission from Richard Oudkerk shibt...@gmail.com: If I create a venv on Windows called py3 then py3/Scripts/Activate.ps1 defines the prompt to be function prompt { Write-Host -NoNewline -ForegroundColor Green [(py3) ] _OLD_VIRTUAL_PROMPT } However this prompt

[issue9374] urlparse should parse query and fragment for arbitrary schemes

2012-07-15 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Removing the module attributes causes third-party code to break. See one example here: http://lists.idyll.org/pipermail/testing-in-python/2012-July/005082.html -- status: closed - open ___ Python

[issue9374] urlparse should parse query and fragment for arbitrary schemes

2012-07-15 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Better link: https://github.com/pypa/pip/issues/552 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9374 ___

[issue15202] followlinks/follow_symlinks/symlinks flags unification

2012-07-15 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: There are versionadded notes in the doc that still use the old names (e.g. symlinks for shutil.copyfile). -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org

[issue15361] venv's Activate.ps1 causes broken prompt with powershell

2012-07-15 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 0b4d0c2173ad by Vinay Sajip in branch 'default': Closes #15361: Corrected venv prompt in PowerShell activation script. http://hg.python.org/cpython/rev/0b4d0c2173ad -- nosy: +python-dev resolution: - fixed

[issue15362] pyport.h includes antiquated UTF handling for FreeBSD

2012-07-15 Thread John Schneider
New submission from John Schneider j...@jschneider.com: Revision 36793 introduced a libc wrapper for FreeBSD 5.x which addressed some UTF issues. Unfortunately, this causes C compilation errors for certain ports. Also reference issues 10910, 1455641 This change is no longer applicable for

[issue12978] Figure out extended attributes on BSDs

2012-07-15 Thread koobs
koobs koobs.free...@gmail.com added the comment: FreeBSD (at least on 7.x, 8.x and 9.x) has the following syscalls available in its API: extattr_{get,set,list,delete}_{fd,file,link} And also has: EXTATTR_MAXNAMELEN

  1   2   >