StoryText 3.8 - GUI testing tool

2012-10-06 Thread Geoff Bache
Hi all,

The 3.8 release features the following:
- The NameChooser UI has been generalised and enhanced, offering a
hierarchical view and the possibility to create shortcuts.
- Added retry loop when replayed events fail, means some application
events aren't needed
- New file-polling mechanism added for synchronising on external events
- Possibilities to filter out certain widget types from the description
- Many improvements to SWT/Eclipse RCP/GEF support which continues to mature
- Some improvements and fixes for Swing also
- Support for PyGTK apps using gtk.Builder added

Regards,
Geoff Bache

A bit more detail:

StoryText is an unconventional GUI testing tool for PyGTK, Tkinter,
wxPython, Swing and SWT along with a Python framework for testing GUIs
in general.

Instead of recording GUI mechanics directly, it asks the user for
descriptive names and hence builds up a domain language along with a
UI map file that translates this language into actions on the
current GUI widgets. The point is to reduce coupling, allow very
expressive tests, and ensure that GUI changes mean changing the UI map
file but not all the tests.

Instead of an assertion mechanism, it auto-generates a log of the
GUI appearance and changes to it. The point is then to use that as a
baseline for text-based testing, using TextTest.

It also includes support for instrumenting code so that waits can be
recorded, making it far easier for a tester to record correctly
synchronized tests without having to explicitly plan for this.

Homepage: http://www.texttest.org/index.php?page=ui_testing
Download: http://sourceforge.net/projects/pyusecase
Mailing list: https://lists.sourceforge.net/lists/listinfo/texttest-users
Bugs: https://bugs.launchpad.net/storytext/
Source: https://code.launchpad.net/storytext/
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


TextTest 3.24 - blackbox testing tool

2012-10-06 Thread Geoff Bache
Dear all,

There are many enhancements and bug fixes, notably
- Tests run in parallel if run locally on a multicore machine
- Improved handling of knownbugs
- New possibility to split up long result files with many different
changes present.

Regards,
Geoff Bache

TextTest is a tool for automatic text-based functional testing. This
means running a batch-mode executable in lots of different ways from
the command line, and using the text output produced as a means of
controlling the behavior of that application. As well as being usable
standalone, it is an extendable framework for black-box testing
written in Python. It's also useful as a test management tool wrapping
some other test tool as a test runner.

Homepage: http://www.texttest.org
Download: http://sourceforge.net/projects/texttest
Mailing list: https://lists.sourceforge.net/lists/listinfo/texttest-users
Bugs: https://bugs.launchpad.net/texttest
Source: https://code.launchpad.net/texttest
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


try/except KeyError vs if name in ...

2012-10-06 Thread Manuel Pégourié-Gonnard
Hi,

I was looking at the example found here [1] which begins with:

[1] http://docs.python.org/py3k/library/imp.html#examples

def __import__(name, globals=None, locals=None, fromlist=None):
# Fast path: see if the module has already been imported.
try:
return sys.modules[name]
except KeyError:
pass

I was wondering if the formulation

if name in sys.modules:
return sys.modules[name]

would be equivalent. IOW, is using try/except here only a matter of
style or a necessity?

I'm suspecting that maybe, in multithreaded environments, the second
option may be subject to a race condition, if another thread removes
name frome sys.modules between the if and the return, but as I'm not
very familiar (yet) with Python threads, I'm not sure it is a real
concern here.

And maybe there are other reasons I'm completely missing for prefering
EAFP over LBYL here?

Thanks in advance for your comments.

-- 
Manuel Pégourié-Gonnard - http://people.math.jussieu.fr/~mpg/


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: write binary with struct.pack_into

2012-10-06 Thread Chris Angelico
On Sat, Oct 6, 2012 at 1:27 PM, palmeira palme...@gmail.com wrote:
 import struct
 bloco='%df' %(252)  #Binary format

 # READ
 fa=open('testIN.bin')
 my_array=struct.unpack_from(bloco,fa.read()[0*4:251*4])# my_aray = 252
 elements array
 ## This read is OK!

 #WRITE
 fb=open('testOUT.bin')
 test=struct.pack_into(bloco,fb.write()[0*4:251*4])  # ERROR in this WRITE

You have a beautiful parallel here, but I think that's where your
problem is. In the READ section, you have fa.read() which will read
the whole file, and then you slice the resulting string. That's pretty
inefficient for large files, but it'll work.

But when you write, that completely does not work. (Even assuming
you've opened read/write, per Dennis's comment.)
 fb.write()
Traceback (most recent call last):
  File pyshell#37, line 1, in module
fb.write()
TypeError: write() takes exactly 1 argument (0 given)

It needs an argument of what to write out, it doesn't return a
writable buffer suitable for pack_into.

I recommend you completely rewrite your file handling to use actual
seeks and file writes. Also, you'll want (I think) to use binary mode
on your files; character encodings don't mean much when you're working
with arrays of numbers.

Finally, when you post issues, ERROR in this WRITE isn't very
helpful. Please please post the full traceback (like in my trivial
example above), as problems will be much more visible.

Hope that's of some value!

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Executing untrusted scripts in a sandboxed environment

2012-10-06 Thread Chris Angelico
On Sat, Oct 6, 2012 at 8:22 AM, Robin Krahl m...@robin-krahl.de wrote:
 Hi all,

 I need to execute untrusted scripts in my Python application. To avoid 
 security issues, I want to use a sandboxed environment. This means that the 
 script authors have no access to the file system. They may only access 
 objects, modules and classes that are flagged or approved for scripting.

 I read that I will not be able to do this with Python scripts. (See 
 SandboxedPython page in the Python wiki [0] and several SE.com questions, e. 
 g. [1].) So my question is: What is the best way to embed a script engine 
 in a sandboxed environment that has access to the Python modules and classes 
 that I provide?

With extreme difficulty. A while back (couple years maybe? I don't
remember), I ignored everyone's warnings and tried to make a sandboxed
Python, embedded in a C++ application. It failed in sandboxing. With
just some trivial tinkering using Python's introspection facilities, a
couple of python-list people managed to read and write files, and
other equally dangerous actions. Shortly thereafter, we solved the
problem completely... by switching to JavaScript.

Embedding CPython in an application simply doesn't afford sandboxing.
To what extent do you actually need to run untrusted Python? Can you,
for instance, sandbox the entire process (which wasn't an option for
what we were doing)? Perhaps chrooting the Python interpreter will do
what you need. But there may still be leaks, I don't know.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Coexistence of Python 2.x and 3.x on same OS

2012-10-06 Thread wxjmfauth
Using Python on Windows is a dream.

Python uses and needs the system, but the system does
not use Python.

Every Python version is installed in its own isolated
space, site-packages included and without any defined
environment variable. Every Python can be seen as a
different application.
Knowing this, it is a no-problem to use the miscellaneous
versions; can be with the console, with an editor, with
.bat or .cmd files, with the Windows start menu launcher,
... like any application.

The file extension is a double sword. Do not use it or
unregister it, the msi installer allows to do this.
It is the same task/problem as with any file, .txt, .png, ...

The new Python launcher is a redondant tool.

A point of view from a multi-users desktop user.



In my mind, it is a mistake to deliver a ready
preconfigurated installation.

TeX (I may say, as usual) is doing fine. A TeX
installation consists usually only in TeX engines
installation/configuration. It let the user work the
way he wishes.

jmf
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: write binary with struct.pack_into

2012-10-06 Thread Peter Otten
palmeira wrote:

 Dear pythonists,
 
 I'm having a problem with read/write binary in python.
 I have a binary file that I need to read information, extract a array,
 modify this array and put these values into file again in same binary
 format.
 I need to use unpack_from and pack_into because sometimes gonna need
 read/write in the middle of file.

Use pack/unpack and file.seek() instead.
 
 Script:
 
 import struct
 bloco='%df' %(252)  #Binary format
 
 # READ
 fa=open('testIN.bin')
 my_array=struct.unpack_from(bloco,fa.read()[0*4:251*4])# my_aray = 252
 elements array
 ## This read is OK!
 
 #WRITE
 fb=open('testOUT.bin')
 test=struct.pack_into(bloco,fb.write()[0*4:251*4])  # ERROR in this WRITE

However, I think you have picked the wrong API. So:

# untested

import sys
import array

offset = 0
N = 252

a = array.array(f)
with open(testIN.bin, rb) as f:
f.seek(offset)
a.read(f, N)
if sys.byteorder == little:
a.byteswap()

# process a

if sys.byteorder == little:
a.byteswap()
with open(testOUT.bin, wb) as f:
f.seek(offset)
a.write(f)


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: try/except KeyError vs if name in ...

2012-10-06 Thread Steven D'Aprano
On Sat, 06 Oct 2012 08:27:25 +0200, Manuel Pégourié-Gonnard wrote:

 Hi,
 
 I was looking at the example found here [1] which begins with:
 
 [1] http://docs.python.org/py3k/library/imp.html#examples
 
 def __import__(name, globals=None, locals=None, fromlist=None):
 # Fast path: see if the module has already been imported. try:
 return sys.modules[name]
 except KeyError:
 pass
 
 I was wondering if the formulation
 
 if name in sys.modules:
 return sys.modules[name]
 
 would be equivalent. IOW, is using try/except here only a matter of
 style or a necessity?

Mostly style, but not entirely.

If you expect that most of the time the module will be found, the 
try...except version will be faster. If you expect that most of the time 
the module will not be found, the if name in version will be faster.

But see also:

 I'm suspecting that maybe, in multithreaded environments, the second
 option may be subject to a race condition, if another thread removes
 name frome sys.modules between the if and the return, but as I'm not
 very familiar (yet) with Python threads, I'm not sure it is a real
 concern here.

In practice, no, it would be very unusual for another thread to remove 
the name from sys.modules. So don't do that :)

But in principle, yes, it is a race condition and yes it is a (small) 
concern. Since it is so easy to avoid even this tiny risk, why not use 
the try...except version and avoid it completely?



-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: try/except KeyError vs if name in ...

2012-10-06 Thread Günther Dietrich
Manuel Pégourié-Gonnard m...@elzevir.fr wrote:

Hi,
I was looking at the example found here [1] which begins with:

[1] http://docs.python.org/py3k/library/imp.html#examples

def __import__(name, globals=None, locals=None, fromlist=None):
# Fast path: see if the module has already been imported.
try:
return sys.modules[name]
except KeyError:
pass

I was wondering if the formulation

if name in sys.modules:
return sys.modules[name]

would be equivalent. IOW, is using try/except here only a matter of
style or a necessity?

Somewhere I read a text regarding 'try:' versus 'if'. If you take the 
probabitility into consideration, how many times the test will fail or 
succeed, there are two possibilities:
- If the test will fail only on very rare occasions: Use 'try:'. When 
the statement(s) in the try-path succeed, the try:/except: construct 
will not consume additional execution time (not even for the test). The 
statements will just be executed as they are. Only in the (rare) case of 
failure, the exception handling will take additional execution time (a 
considerably big amount). The fact, that in python it is not named 
'error handling', but 'exception handling' reflects this. The failure 
should be the exception, also in matters of occurrence.
- If the relation between success and failure is not predictable, or if 
the case of failure will be frequent, use 'if'. The failure of a 'try:' 
gives you a penalty in form of consumption of a high amount of execution 
time. So, in these constellations, it is better to accept the relatively 
small amount of execution time taken by the explicit test.

Obviously, you can use 'try:' only, if there is the possibility to 
produce an exception on failure. In the other cases you must use the 
explicit test by 'if'.


I'm suspecting that maybe, in multithreaded environments, the second
option may be subject to a race condition, if another thread removes
name frome sys.modules between the if and the return, but as I'm not
very familiar (yet) with Python threads, I'm not sure it is a real
concern here.

Your idea sounds reasonable, but I also am not yet familiar with threads.


And maybe there are other reasons I'm completely missing for prefering
EAFP over LBYL here?

One reason might be what I described above.



Best regards,

Günther
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Executing untrusted scripts in a sandboxed environment

2012-10-06 Thread Ramchandra Apte
On Saturday, 6 October 2012 04:00:08 UTC+5:30, Robin Krahl  wrote:
 Hi all,
 
 I need to execute untrusted scripts in my Python application. To avoid 
 security issues, I want to use a sandboxed environment. This means that the 
 script authors have no access to the file system. They may only access 
 objects, modules and classes that are flagged or approved for scripting.
 
 I read that I will not be able to do this with Python scripts. (See 
 SandboxedPython page in the Python wiki [0] and several SE.com questions, e. 
 g. [1].) So my question is: What is the best way to embed a script engine 
 in a sandboxed environment that has access to the Python modules and classes 
 that I provide?
 
 Thanks for your help.
 
 Best regards,
 Robin
 
 [0] http://wiki.python.org/moin/SandboxedPython
 [1] 
 http://stackoverflow.com/questions/3068139/how-can-i-sandbox-python-in-pure-python
From http://wiki.python.org/moin/SandboxedPython
The Java and CLR/.NET runtimes support restricted execution, and these can be 
utilised through the Jython and IronPython variants of Python (as well as by 
other languages, obviously).
You can also check out http://doc.pypy.org/en/latest/sandbox.html for PyPy's 
sandbox
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Executing untrusted scripts in a sandboxed environment

2012-10-06 Thread Ramchandra Apte
On Saturday, 6 October 2012 12:49:29 UTC+5:30, Chris Angelico  wrote:
 On Sat, Oct 6, 2012 at 8:22 AM, Robin Krahl m...@robin-krahl.de wrote:
 
  Hi all,
 
 
 
  I need to execute untrusted scripts in my Python application. To avoid 
  security issues, I want to use a sandboxed environment. This means that the 
  script authors have no access to the file system. They may only access 
  objects, modules and classes that are flagged or approved for scripting.
 
 
 
  I read that I will not be able to do this with Python scripts. (See 
  SandboxedPython page in the Python wiki [0] and several SE.com questions, 
  e. g. [1].) So my question is: What is the best way to embed a script 
  engine in a sandboxed environment that has access to the Python modules and 
  classes that I provide?
 
 
 
 With extreme difficulty. A while back (couple years maybe? I don't
 
 remember), I ignored everyone's warnings and tried to make a sandboxed
 
 Python, embedded in a C++ application. It failed in sandboxing. With
 
 just some trivial tinkering using Python's introspection facilities, a
 
 couple of python-list people managed to read and write files, and
 
 other equally dangerous actions. Shortly thereafter, we solved the
 
 problem completely... by switching to JavaScript.
 
 
 
 Embedding CPython in an application simply doesn't afford sandboxing.
 
 To what extent do you actually need to run untrusted Python? Can you,
 
 for instance, sandbox the entire process (which wasn't an option for
 
 what we were doing)? Perhaps chrooting the Python interpreter will do
 
 what you need. But there may still be leaks, I don't know.
 
 
 
 ChrisA

Something like ast.literal_eval may be useful.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Executing untrusted scripts in a sandboxed environment

2012-10-06 Thread Chris Angelico
On Sat, Oct 6, 2012 at 7:10 PM, Ramchandra Apte maniandra...@gmail.com wrote:
 On Saturday, 6 October 2012 12:49:29 UTC+5:30, Chris Angelico  wrote:
 On Sat, Oct 6, 2012 at 8:22 AM, Robin Krahl m...@robin-krahl.de wrote:
  What is the best way to embed a script engine in a sandboxed environment 
  that has access to the Python modules and classes that I provide?

 With extreme difficulty.

 Something like ast.literal_eval may be useful.

Not really; it's hardly sufficient. That sort of feature is handy for
making an expression evaluator; for instance, you could implement a
powerful calculator with it. But it's far too limited for most
applications.

The main problem is permitting some of the basic builtins (like True,
False, len(), etc), without those objects being used as gateways. Did
you know, for instance, that len.__self__.open() can be used to read
and write files on the file system?

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: try/except KeyError vs if name in ...

2012-10-06 Thread Manuel Pégourié-Gonnard
Günther Dietrich scripsit :

 Somewhere I read a text regarding 'try:' versus 'if'. If you take the 
 probabitility into consideration, how many times the test will fail or 
 succeed, there are two possibilities: [...]

Ok, thanks for the details!

-- 
Manuel Pégourié-Gonnard - http://people.math.jussieu.fr/~mpg/


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: try/except KeyError vs if name in ...

2012-10-06 Thread Manuel Pégourié-Gonnard
Steven D'Aprano scripsit :

 If you expect that most of the time the module will be found, the 
 try...except version will be faster. If you expect that most of the time 
 the module will not be found, the if name in version will be faster.

Ok.

In the particular case of __import__, I guess speed is not crucial since
I doubt import often happen within a program's inner loop. But I'll
remember that point for other cases anyway.

 I'm suspecting that maybe, in multithreaded environments, the second
 option may be subject to a race condition, if another thread removes
 name frome sys.modules between the if and the return, but as I'm not
 very familiar (yet) with Python threads, I'm not sure it is a real
 concern here.

 In practice, no, it would be very unusual for another thread to remove 
 the name from sys.modules. So don't do that :)

That wasn't my intention. But sometimes other people may be creative :)

 But in principle, yes, it is a race condition and yes it is a (small) 
 concern. Since it is so easy to avoid even this tiny risk, why not use 
 the try...except version and avoid it completely?

Ok.

Thanks for your explanations.

-- 
Manuel Pégourié-Gonnard - http://people.math.jussieu.fr/~mpg/


-- 
http://mail.python.org/mailman/listinfo/python-list


Unpaking Tuple

2012-10-06 Thread sajuptpm
Hi,

I am using python 2.6.

I need a way to make following code working without any ValueError .
 a, b, c, d = (1,2,3,4)
 a, b, c, d = (1,2,3).

Note: Number of values in the tuple will change dynamically.


I know in python 3, you can do `a, b, c, *d = (1, 2, 3)` and then d will 
contain any elements that didn't fit into a,b,c.

Regards,
Saju
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unpaking Tuple

2012-10-06 Thread Chris Rebert
On Sat, Oct 6, 2012 at 3:09 AM, sajuptpm sajup...@gmail.com wrote:
 Hi,

 I am using python 2.6.

 I need a way to make following code working without any ValueError .
 a, b, c, d = (1,2,3,4)
 a, b, c, d = (1,2,3).

 Note: Number of values in the tuple will change dynamically.

Then you arguably want a list, not a tuple.

But at any rate:
shortfall = 4 - len(your_tuple)
your_tuple += (None,) * shortfall # assuming None is a suitable default
a, b, c, d = your_tuple

If you also need to handle the too many items case, use slicing:
a, b, c, d = your_tuple[:4]

Cheers,
Chris
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Executing untrusted scripts in a sandboxed environment

2012-10-06 Thread Mark Lawrence

On 05/10/2012 23:22, Robin Krahl wrote:

Hi all,

I need to execute untrusted scripts in my Python application. To avoid security issues, I want to 
use a sandboxed environment. This means that the script authors have no access to the file system. 
They may only access objects, modules and classes that are flagged or 
approved for scripting.

I read that I will not be able to do this with Python scripts. (See SandboxedPython page 
in the Python wiki [0] and several SE.com questions, e. g. [1].) So my question is: What 
is the best way to embed a script engine in a sandboxed environment that has 
access to the Python modules and classes that I provide?

Thanks for your help.

Best regards,
 Robin

[0] http://wiki.python.org/moin/SandboxedPython
[1] 
http://stackoverflow.com/questions/3068139/how-can-i-sandbox-python-in-pure-python



As good a starting point as any 
http://www.velocityreviews.com/forums/t716131-challenge-escape-from-the-pysandbox.html 
?


Also throw python experimental sandbox into your search engine and 
follow your nose, something might come up smelling of roses :)


--
Cheers.

Mark Lawrence.

--
http://mail.python.org/mailman/listinfo/python-list


Re: try/except KeyError vs if name in ...

2012-10-06 Thread Dave Angel
On 10/06/2012 02:27 AM, Manuel Pégourié-Gonnard wrote:
 Hi,

 I was looking at the example found here [1] which begins with:

 [1] http://docs.python.org/py3k/library/imp.html#examples

 def __import__(name, globals=None, locals=None, fromlist=None):
 # Fast path: see if the module has already been imported.
 try:
 return sys.modules[name]
 except KeyError:
 pass

 I was wondering if the formulation

 if name in sys.modules:
 return sys.modules[name]

 would be equivalent. IOW, is using try/except here only a matter of
 style or a necessity?

 I'm suspecting that maybe, in multithreaded environments, the second
 option may be subject to a race condition, if another thread removes
 name frome sys.modules between the if and the return, but as I'm not
 very familiar (yet) with Python threads, I'm not sure it is a real
 concern here.

 And maybe there are other reasons I'm completely missing for prefering
 EAFP over LBYL here?

 Thanks in advance for your comments.


Guidelines for writing library code may very well be different than for
writing your application.  And if your application is trying to do
something similar with *import*, chances are that it's calling a library
function that already starts with the test against sys.modules.  So if
this is an application question, the answer is probably don't do either
one, just do the import, checking for the exceptions that it may throw.

The distinction in performance between the success and failure modes of
the try/catch isn't nearly as large as one of the other responses might
lead you to believe.  For example, a for loop generally terminates with
a raise (of StopIteration exception), and that doesn't convince us to
replace it with a while loop.  Besides, in this case, the except code
effectively includes the entire import, which would completely swamp the
overhead of the raise.

If we assume the question was more generally about EAFT vs. LBYL, and
not just about the case of accessing the system data structure
sys.modules, then the issues change somewhat.

If we do a LBYL, we have to know that we've covered all interesting
cases with our test.  Multithreading is one case where we can get a race
condition.  There are times when we might be able to know either that
there are not other threads, or that the other threads don't mess with
the stuff we're testing.  For example, there are enough problems with
import and threads that we might just have a development policy that (in
this program) we will do all our imports before starting any additional
threads, and that we will never try to unload an import, single threaded
or not.  But for other conditions, we might be affected either by the
system or by other processes within it.  Or even affected by other
asynchronous events over a network.

If we do an EAFP, then we have to figure out what exceptions are
possible.  However, adding more exceptions with different treatments is
quite easy, and they don't all have to be done at the same level.  Some
may be left for our caller to deal with.  I think the major thing that
people mind about try/catch is that it seems to break up the program
flow.  However, that paradigm grows on you as you get accustomed to it.

-- 

DaveA

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: sum function

2012-10-06 Thread Ramchandra Apte
On Saturday, 6 October 2012 02:09:56 UTC+5:30, Dave Angel  wrote:
 On 10/05/2012 04:09 PM, Mike wrote:
 
  Terry,
 
 
 
  I am not using the mail client. I am just posting on the site.
 
 
 
 And which site would that be (that you're using)?  There are a few.  I'm
 
 guessing you use google-groups.  And all of them get gatewayed to the
 
 actual list, with differing numbers of bugs. 
 
 
 
 I use email to access it directly.  I solve one of the duplicate-message
 
 problems with google groups by automatically deleting any message
 
 addressed to google-groups.  There are about 100 such messages each month.
 
 
 
 Another problem is that lots of these gateways post to both the
 
 newsgroup and to the python-list.

I found out earlier that this was why my posts was being double-posted in 
Google Groups.
 
 
 
 
  Something wrong with this site. When you do individual reply, it does the 
  double posting which it shouldn't. See Ramachandra Apte's reply. It is 
  posted twice too.
 
 
 
  Thanks
 
 
 
 
 
 
 
 
 
 
 
 -- 
 
 
 
 DaveA

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unpaking Tuple

2012-10-06 Thread Roy Smith
In article mailman.1898.1349519275.27098.python-l...@python.org,
 Chris Rebert c...@rebertia.com wrote:

 But at any rate:
 shortfall = 4 - len(your_tuple)
 your_tuple += (None,) * shortfall # assuming None is a suitable default
 a, b, c, d = your_tuple
 
 If you also need to handle the too many items case, use slicing:
 a, b, c, d = your_tuple[:4]

I usually handle both of those cases at the same time:

 a, b, c, d = (my_tuple + (None,) * 4)[:4]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Executing untrusted scripts in a sandboxed environment

2012-10-06 Thread Rodrick Brown
On Oct 5, 2012, at 6:32 PM, Robin Krahl m...@robin-krahl.de wrote:

 Hi all,

 I need to execute untrusted scripts in my Python application. To avoid 
 security issues, I want to use a sandboxed environment. This means that the 
 script authors have no access to the file system. They may only access 
 objects, modules and classes that are flagged or approved for scripting.

 I read that I will not be able to do this with Python scripts. (See 
 SandboxedPython page in the Python wiki [0] and several SE.com questions, e. 
 g. [1].) So my question is: What is the best way to embed a script engine 
 in a sandboxed environment that has access to the Python modules and classes 
 that I provide?

Checkout udacity.com I think there is a writeup on stackoverflow on
how they accomplished their sandbox runtime env.


 Thanks for your help.

 Best regards,
Robin

 [0] http://wiki.python.org/moin/SandboxedPython
 [1] 
 http://stackoverflow.com/questions/3068139/how-can-i-sandbox-python-in-pure-python
 --
 http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: write binary with struct.pack_into

2012-10-06 Thread Grant Edwards
On 2012-10-06, Dennis Lee Bieber wlfr...@ix.netcom.com wrote:
 On Fri, 5 Oct 2012 20:27:36 -0700 (PDT), palmeira palme...@gmail.com
 declaimed the following in gmane.comp.python.general:

 
 #WRITE
 fb=open('testOUT.bin')

   Unless you specify otherwise, open() defaults to read-only

It also defaults to 'text' mode which does cr/lf translaction.  That
will break both reads and writes on any binary file containing 0x0a
and 0x0d bytes.

-- 
Grant
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: write binary with struct.pack_into

2012-10-06 Thread Chris Angelico
On Sat, Oct 6, 2012 at 11:26 PM, Grant Edwards invalid@invalid.invalid wrote:
 On 2012-10-06, Dennis Lee Bieber wlfr...@ix.netcom.com wrote:
 On Fri, 5 Oct 2012 20:27:36 -0700 (PDT), palmeira palme...@gmail.com
 declaimed the following in gmane.comp.python.general:


 #WRITE
 fb=open('testOUT.bin')

   Unless you specify otherwise, open() defaults to read-only

 It also defaults to 'text' mode which does cr/lf translaction.  That
 will break both reads and writes on any binary file containing 0x0a
 and 0x0d bytes.

And, in Python 3, it'll be returning Unicode characters too, unless
the decode fails. You definitely want binary mode.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Combinations of lists

2012-10-06 Thread Joshua Landau
On 4 October 2012 16:12, Steen Lysgaard boxeakast...@gmail.com wrote:

 2012/10/4 Joshua Landau joshua.landau...@gmail.com:
  On 3 October 2012 21:15, Steen Lysgaard boxeakast...@gmail.com wrote:
 
  Hi,
 
  thanks for your interest. Sorry for not being completely clear, yes
  the length of m will always be half of the length of h.
 
 
  (Please don't top post)
 
  I have a solution to this, then.
  It's not short or fast, but it's a lot faster than yours.


snip

  This is quite naive, because I don't know how to properly implement
  force_unique_combinations, but it runs. I hope this is right. If you need
  significantly more speed your best chance is probably Cython or C,
 although
  I don't doubt 10x more speed may well be possible from within Python.
 
 
  Also, 8 Dihedral is a bot, or at least pretending like crazy to be
 one.

 Great, I've now got a solution much faster than what I could come up with.
 Thanks to the both of you.


Don't use it though :P. I've something better, now I've used a few
sanity-points up [it's much more interesting to solve *other* people's
problems].

Please note that my implementations (old and new) return duplicates when
the second list contains duplicates. It's fixable, but I'll only bother if
you need it fixed.

It runs in a very consistent 55% of the time, but it is longer. Here y'are.

Super algorithm.

 from itertools import combinations
 from collections import Counter

 def multiples(counter):
 Counter - set.

 Returns the set of values that occur multiple times.
  
 multiples = set()

 for item, number in counter.items():
  if number  1:
 multiples.add(item)

 return multiples

 #@profile
 def pairwise_combinations(counter, countermultiples, counterset, length,
 charmap):
 # length is a LIE!
 Get the permutations of two lists.

 Do not call this directly unless you want to hassle yourself.
 Use the wrapper provided, list_permute, instead.
  

 # We will do the combinations in pairs, as each pair will not have order
 and so
  # [1, 2, 3, 4] is equivilant to [2, 1, 4, 3] but not [1, 3, 2, 4].

 # This means that we get the full permutations without ever filtering.

 # Each pair along is a combination.
 # We are combination-ing a set to prevent dulicates.
  # As the combinations are of length 2, the only ones this will
 # miss are of the type [x, x] (two of the same).
  # This is accounted for by countermultiples.
 pairs = combinations(counterset, 2)

 # Prepend with this
  length -= 1
 prefix_char = charmap[length]

 # There's not reason to recurse, so don't bother with a lot of stuff
  if not length:
 for p_a, p_b in pairs:
 yield [prefix_char+p_a, prefix_char+p_b]
  for p in countermultiples:
 yield [prefix_char+p, prefix_char+p]
 return

 for p_a, p_b in pairs:
 # Edit scope
 # The recursion wont be able to use items we've already used
  counter[p_a] -= 1
 counter_p_a = counter[p_a] # Quickref
 if   counter_p_a == 0: counterset.remove(p_a) # None left
  elif counter_p_a == 1: countermultiples.remove(p_a) # Not plural

 counter[p_b] -= 1
 counter_p_b = counter[p_b] # Quickref
  if   counter_p_b == 0: counterset.remove(p_b) # None left
 elif counter_p_b == 1: countermultiples.remove(p_b) # Not plural

 # Recurse
 # Do the same, but for the next pair along
 own_yield = [prefix_char+p_a, prefix_char+p_b]
  for delegated_yield in pairwise_combinations(counter, countermultiples,
 counterset, length, charmap):
 yield own_yield + delegated_yield

 # Reset scope
 counter[p_a] += 1
 if   counter_p_a == 0: counterset.add(p_a)
  elif counter_p_a == 1: countermultiples.add(p_a)

 counter[p_b] += 1
 if   counter_p_b == 0: counterset.add(p_b)
  elif counter_p_b == 1: countermultiples.add(p_b)


 # Now do the same for countermultiples
  # This is not itertools.chain'd because this way
 # is faster and I get to micro-optomize inside
  for p in countermultiples:
 # Edit scope
 # The recursion wont be able to use items we've already used
  counter[p] -= 2
 counter_p = counter[p] # Quickref

 if   counter_p == 0:
  counterset.remove(p) # None left
 countermultiples.remove(p) # Must have been in countermultiples, none left

 elif counter_p == 1:
 countermultiples.remove(p) # Not plural

 # Recurse
  # Do the same, but for the next pair along
 own_yield = [prefix_char+p, prefix_char+p]
 for delegated_yield in pairwise_combinations(counter, countermultiples,
 counterset, length, charmap):
  yield own_yield + delegated_yield

 # Reset scope
 counter[p] += 2

 if   counter_p == 0:
 counterset.add(p)
 countermultiples.add(p)

 elif counter_p == 1:
 countermultiples.add(p)

 def list_permute(first, second):
 Get the permutations of two lists as according to what you want, which
 isn't really the
  permutations of two lists but something close to it. It does what it
 needs to, I think.

 This DOES NOT work when second contains duplicates, as the result has
 duplicates. The other
  of mine does not work either. If this is a problem, it should be
 fixable: sort second
 and when you 

Re: write binary with struct.pack_into

2012-10-06 Thread Alexander Blinne
First, you should consider reading the documentation of
struct.unpack_from and struct.pack_into at
http://docs.python.org/library/struct.html quite carefully. It says,
that these commands take a parameter called offset, which names the
location of the data in a buffer (e.g. an opened file).

example:

bloco='%df' % (252)# Format string (252 floats)
fa = open('testIN.bin', 'rb')   # open for reading in binary mode
off = 0   # suppose i want to read block at beginning of file
my_array=struct.unpack_from(bloco, fa, off)  #read data


now write them to another file:

fb = open('testOUT.bin', 'r+b')   # open for updating in binary mode
off = 0   # suppose i want to write block at beginning of file
struct.pack_into(bloco, fb, off, *my_array)  #write data to testOUT


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: parse an environment file

2012-10-06 Thread Jason Friedman
 The only canned solution for parsing a bash script is bash. Think
 about it the other way around: If you wanted to have a Python variable
 made available to a bash script, the obvious thing to do is to invoke
 Python. It's the same thing.

I scratched my own itch:
http://code.activestate.com/recipes/578280-parse-profile/.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: parse an environment file

2012-10-06 Thread Chris Angelico
On Sun, Oct 7, 2012 at 4:14 AM, Jason Friedman ja...@powerpull.net wrote:
 The only canned solution for parsing a bash script is bash. Think
 about it the other way around: If you wanted to have a Python variable
 made available to a bash script, the obvious thing to do is to invoke
 Python. It's the same thing.

 I scratched my own itch:
 http://code.activestate.com/recipes/578280-parse-profile/.

And there you have it! A subset of bash syntax and a Python parser. Job done!

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


I am just trying to find out if there is any relevant/current research in the production of a generic quality assurance tool for my PhD.

2012-10-06 Thread Darryl Owens
I am currently starting my PhD in software quality assurance and have been 
doing a lot of reading round this subject. I am just trying to find out if 
there is any relevant/current research in the production of a generic quality 
assurance tool i.e. a tool/methodology that can accept many languages for the 
following areas:
•   Problems in code/coding errors
•   Compiler bugs
•   Language bugs
•   Users mathematical model
I would greatly appreciate any input and advice in this area, feel free to 
repost on this topic and/or contact me at: owens.darryl@gmail.com

Thank you in advance

Darryl Owens
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: fmap(), inverse of Python map() function

2012-10-06 Thread vasudevram
On Saturday, October 6, 2012 5:01:40 AM UTC+5:30, Devin Jeanpierre wrote:
 On Fri, Oct 5, 2012 at 7:24 PM, Ian Kelly  wrote:
 
  I realize that.  My point is that the function *feels* more like a
 
  variant of reduce than of map.
 
 
 
  If it's meant as a complaint, it's a poor one.
 
 
 
  It's not.
 
 
 
 Fair enough all around. Sorry for misunderstanding.
 
 
 
 -- Devin

Thanks to all who replied. Always good to learn something new.

- Vasudev
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: try/except KeyError vs if name in ...

2012-10-06 Thread Terry Reedy

On 10/6/2012 7:36 AM, Dave Angel wrote:


The distinction in performance between the success and failure modes of
the try/catch isn't nearly as large as one of the other responses might
lead you to believe.  For example, a for loop generally terminates with
a raise (of StopIteration exception), and that doesn't convince us to
replace it with a while loop.


For statement generally loop many times, up to millions of times, 
without an exception being raised, whereas while statements test the 
condition each time around the loop. So the rule 'if failure is rare 
(less than 10-20%) use try', applies here. For if/them versus 
try/except, I don't worry too much about it.


--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list


[ann] pysha3 0.2.1 released

2012-10-06 Thread Christian Heimes
Hello,

today I've released pysha3 0.2.1 [1]. It's a standalone version of the
SHA-3 extension that I merged into CPython's development branch (future
3.4) a couple of hours ago. It provides the Keccak [2] cryptographic
hashing algorithm that was officially selected as SHA-3 by NIST a four
days ago. The module implements 224, 256, 384 and 512 bits digest size.
Arbitrarily-long output is not supported by the module as it's not part
of the NIST interface.

pysha3 is available for Python 2.6, 2.7, 3.2 and 3.3. It has been tested
on Linux (X86, X86_64 with gcc 4.6 and clang), FreeBSD and Windows (X86,
X86_64). 32 and 64bit Windows binaries for all supported Python versions
are available on PyPI, too.

Have fun,
Christian

[1] http://pypi.python.org/pypi/pysha3
[2] http://keccak.noekeon.org/

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: fmap(), inverse of Python map() function

2012-10-06 Thread vasudevram
 
 Thanks to all who replied. Always good to learn something new.

P.S. A reader posted a good comment with Scala as well as Python code for a 
compose function (basically same functionality as fmap, or more - the compose 
once, run many times thing). It's the 4th comment on my blog post.

- Vasudev
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Are ABCs an anti-pattern?

2012-10-06 Thread Demian Brecht

On 12-10-05 12:58 PM, Trent Nelson wrote:

I like them.  In particular, I like that I can enumerate all the
subclasses that happen to implement the ABC via the metaclass's
__subclasses__() method.
As long as you have a common base class (which in your case is a 
requirement), then __subclasses__ works for introspecting child classes. 
It doesn't *really* have anything to do with abcs.



I also like that I can trust Python
not to instantiate a subclass of an ABC unless it meets all the
interface criteria I've stipulated.
Another way to read this is that you don't trust those using your code 
to be bright enough to understand what your code is doing and what it 
requires. In my mind, this seems to somewhat contradict the philosophy 
of we're all consenting adults here. Whether you utilize interfaces or 
not, code should be documented. Your documentation would be responsible 
for laying out the expected interface (again, whether you're using the 
interfaces or not). Code would fail at some point if a requirement on an 
interface hasn't been filled. The *one* nice thing is that it'll error 
on import rather than execution time, but to me, if your code is unit 
tested, then all these things should be caught almost immediately anyway.


From my experience (again, *only* talking about Python here), it seem 
to me that less is generally more. Less code means less things to read 
and tie together, making it easier to grok overall (not to mention less 
overhead for the interpreter, but that's virtually moot due to the 
*very* little overhead in 99% of cases of uses features such as abcs). 
Using abcs not only lends itself to code bloat, but it also leads to 
over-engineering as once you fall into old OOP habits, you start getting 
back to un-Pythonic code (pretty subjective statement, I know :)).



Again, please don't misunderstand my intentions here. I'm not arguing 
the need for abstract base classes in a strict OOP world. I'm arguing 
them as not genuinely being Pythonic.



Thanks for your the feedback so far.

--
Demian Brecht
@demianbrecht
http://demianbrecht.github.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: [ann] pysha3 0.2.1 released

2012-10-06 Thread Ethan Furman

Christian Heimes wrote:
today I've released pysha3 0.2.1 [1]. 


pysha3 is available for Python 2.6, 2.7, 3.2 and 3.3. It has been tested
on Linux (X86, X86_64 with gcc 4.6 and clang), FreeBSD and Windows (X86,
X86_64). 32 and 64bit Windows binaries for all supported Python versions
are available on PyPI, too.

[1] http://pypi.python.org/pypi/pysha3
[2] http://keccak.noekeon.org/


Nice!  Thanks!

~Ethan~

--
http://mail.python.org/mailman/listinfo/python-list


Re: Why is pylaucher in Python 3.3 being installed in Windows folder?

2012-10-06 Thread Mark Hammond

On 5/10/2012 2:40 AM, Oscar Benjamin wrote:

Having them on PATH means that you can do:

  py script.py

and the effect will be analogous to (in a unix shell):

 $ ./script.py

Of course the idea with the launcher is that you just do

  script.py


Unless you want a specific version - particularly for testing - eg:

% py -3.2 script.py

Mark

--
http://mail.python.org/mailman/listinfo/python-list


Re: Coexistence of Python 2.x and 3.x on same OS

2012-10-06 Thread Ian Kelly
On Sat, Oct 6, 2012 at 1:27 AM,  wxjmfa...@gmail.com wrote:
 Using Python on Windows is a dream.

 Python uses and needs the system, but the system does
 not use Python.

 Every Python version is installed in its own isolated
 space, site-packages included and without any defined
 environment variable. Every Python can be seen as a
 different application.
 Knowing this, it is a no-problem to use the miscellaneous
 versions; can be with the console, with an editor, with
 .bat or .cmd files, with the Windows start menu launcher,
 ... like any application.

 The file extension is a double sword. Do not use it or
 unregister it, the msi installer allows to do this.
 It is the same task/problem as with any file, .txt, .png, ...

 The new Python launcher is a redondant tool.

Yes, because all scripts are only ever run by the person who wrote
them.  The main benefit here is for distribution of Python scripts
with version requirements.  Just because you can rely on your Python
installation to be in C:\Python27 doesn't mean you can rely on
somebody else's installation to be there, or on their file
associations to be configured for the correct version.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: try/except KeyError vs if name in ...

2012-10-06 Thread Ramchandra Apte
On Sunday, 7 October 2012 01:12:56 UTC+5:30, Terry Reedy  wrote:
 On 10/6/2012 7:36 AM, Dave Angel wrote:
 
 
 
  The distinction in performance between the success and failure modes of
 
  the try/catch isn't nearly as large as one of the other responses might
 
  lead you to believe.  For example, a for loop generally terminates with
 
  a raise (of StopIteration exception), and that doesn't convince us to
 
  replace it with a while loop.
 
 
 
 For statement generally loop many times, up to millions of times, 
 
 without an exception being raised, whereas while statements test the 
 
 condition each time around the loop. So the rule 'if failure is rare 
 
 (less than 10-20%) use try', applies here. For if/them versus 
 
 try/except, I don't worry too much about it.
 
 
 
 -- 
 
 Terry Jan Reedy

I use try and except when I need to raise exceptions e.g.:

try:
value = vm.variables[name]
except KeyError:
raise NameError(variable name not defined in VM's variables)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: I am just trying to find out if there is any relevant/current research in the production of a generic quality assurance tool for my PhD.

2012-10-06 Thread Ramchandra Apte
On Sunday, 7 October 2012 00:13:58 UTC+5:30, Darryl Owens  wrote:
 I am currently starting my PhD in software quality assurance and have been 
 doing a lot of reading round this subject. I am just trying to find out if 
 there is any relevant/current research in the production of a generic quality 
 assurance tool i.e. a tool/methodology that can accept many languages for the 
 following areas:
 
 • Problems in code/coding errors
 
 • Compiler bugs
 
 • Language bugs
 
 • Users mathematical model
 
 I would greatly appreciate any input and advice in this area, feel free to 
 repost on this topic and/or contact me at: owens.darryl@gmail.com
 
 
 
 Thank you in advance
 
 
 
 Darryl Owens

Does this have anything to do with Python?

Banned from #python-offtopic till Christmas
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: I am just trying to find out if there is any relevant/current research in the production of a generic quality assurance tool for my PhD.

2012-10-06 Thread rusi
On Oct 7, 9:15 am, Ramchandra Apte maniandra...@gmail.com wrote:
 On Sunday, 7 October 2012 00:13:58 UTC+5:30, Darryl Owens  wrote:
  I am currently starting my PhD in software quality assurance and have been 
  doing a lot of reading round this subject. I am just trying to find out if 
  there is any relevant/current research in the production of a generic 
  quality assurance tool i.e. a tool/methodology that can accept many 
  languages for the following areas:

  •        Problems in code/coding errors

  •        Compiler bugs

  •        Language bugs

  •        Users mathematical model

  I would greatly appreciate any input and advice in this area, feel free to 
  repost on this topic and/or contact me at: owens.darryl@gmail.com

  Thank you in advance

  Darryl Owens

 Does this have anything to do with Python?

Why not?


 Banned from #python-offtopic till Christmas

Did you wait for an answer?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: I am just trying to find out if there is any relevant/current research in the production of a generic quality assurance tool for my PhD.

2012-10-06 Thread Ramchandra Apte
On Sunday, 7 October 2012 10:32:45 UTC+5:30, rusi  wrote:
 On Oct 7, 9:15 am, Ramchandra Apte maniandra...@gmail.com wrote:
 
  On Sunday, 7 October 2012 00:13:58 UTC+5:30, Darryl Owens  wrote:
 
   I am currently starting my PhD in software quality assurance and have 
   been doing a lot of reading round this subject. I am just trying to find 
   out if there is any relevant/current research in the production of a 
   generic quality assurance tool i.e. a tool/methodology that can accept 
   many languages for the following areas:
 
 
 
   •        Problems in code/coding errors
 
 
 
   •        Compiler bugs
 
 
 
   •        Language bugs
 
 
 
   •        Users mathematical model
 
 
 
   I would greatly appreciate any input and advice in this area, feel free 
   to repost on this topic and/or contact me at: owens.darryl@gmail.com
 
 
 
   Thank you in advance
 
 
 
   Darryl Owens
 
 
 
  Does this have anything to do with Python?
 
 
 
 Why not?
 
 
 
 
 
  Banned from #python-offtopic till Christmas
 
 
 
 Did you wait for an answer?

no
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: I am just trying to find out if there is any relevant/current research in the production of a generic quality assurance tool for my PhD.

2012-10-06 Thread Dwight Hutto
On Sun, Oct 7, 2012 at 1:02 AM, rusi rustompm...@gmail.com wrote:
 On Oct 7, 9:15 am, Ramchandra Apte maniandra...@gmail.com wrote:
 On Sunday, 7 October 2012 00:13:58 UTC+5:30, Darryl Owens  wrote:
  I am currently starting my PhD in software quality assurance and have been 
  doing a lot of reading round this subject. I am just trying to find out if 
  there is any relevant/current research in the production of a generic 
  quality assurance tool i.e. a tool/methodology that can accept many 
  languages for the following areas:

  •Problems in code/coding errors

  •Compiler bugs

  •Language bugs

  •Users mathematical model

The main tests for python is:

 http://docs.python.org/library/unittest.html


For other languages, and even in python, you can roll your own.

I'd begin by algorithming each particular language's calls(based on
the statistical probabilities of languages that are utilized, and
designed in a hierarchical order of the utilization), language bugs,
and mathematical models needed performed, then perform the necessary
function calls/series of calls.

Pass data, and check the returns.

CMD errors in some cases, and checking for error logs from URL calls.

I'd suggest the bug repositories for the OS, browser, or app framework
the language is launched in(version/build #, etc), or some form of url
scraping the data from these in order to correct/check known problems.


-- 
Best Regards,
David Hutto
CEO: http://www.hitwebdevelopment.com
-- 
http://mail.python.org/mailman/listinfo/python-list


[issue13290] get vars for object with __slots__

2012-10-06 Thread Michele Orrù

Michele Orrù added the comment:

As a reference, linking the discussion on python-dev. 
http://mail.python.org/pipermail/python-dev/2012-October/122011.html

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13290
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16112] platform.architecture does not correctly escape argument to /usr/bin/file

2012-10-06 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

Jesús Cea Avión wrote:
 
 Antoine, I agree. I beg your pardon. This patch was suppose to be quite 
 trivial, and test_platform passes just fine on my Linux and Solaris 
 computers. And the four buildbots I was monitoring, the testsuite passed.
 
 The suggestion of Marc-Andre of simply adding an os.access() to check for 
 file existence first is quite sensible and would be enough and compatible in 
 all platforms and python releases.
 
 I am for backing out my patches so far and push a simple os.access() check. 
 What do you think?.

At least for Python 2.7, I think that would be a nice and simple
solution.

 Marc-Andre, I was wondering if you could elaborate a bit why 2.7 platform.py 
 file should be able to run fine in 2.3 :-?

That only applies to the version in Python 2.x. Python 2.3 is perhaps
a bit extreme and I'd be fine with bumping it to 2.4.

The main reason for keeping the compatibility is that the module is
also being used outside the stdlib for Python versions starting from
2.4 and later. I don't want to maintain two separate versions.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Oct 06 2012)
 Python Projects, Consulting and Support ...   http://www.egenix.com/
 mxODBC.Zope/Plone.Database.Adapter ...   http://zope.egenix.com/
 mxODBC, mxDateTime, mxTextTools ...http://python.egenix.com/

2012-09-27: Released eGenix PyRun 1.1.0 ...   http://egenix.com/go35
2012-09-26: Released mxODBC.Connect 2.0.1 ... http://egenix.com/go34
2012-09-25: Released mxODBC 3.2.1 ... http://egenix.com/go33
2012-10-23: Python Meeting Duesseldorf ... 17 days to go

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
   Registered at Amtsgericht Duesseldorf: HRB 46611
   http://www.egenix.com/company/contact/

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16112
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11643] Use |version| instead of X.Y in the doc

2012-10-06 Thread Mike Hoy

Mike Hoy added the comment:

Here is a patch after talking with Ezio on irc tonight. The rules I (attempted) 
to follow are:

Within a :file: you should have {X.Y}
In a text/paragraph area you can use |version|
Within anything else just leave it as X.Y

As stated by Éric I ignored install and distutils.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11643
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11643] Use |version| instead of X.Y in the doc

2012-10-06 Thread Mike Hoy

Changes by Mike Hoy mho...@gmail.com:


--
keywords: +patch
Added file: http://bugs.python.org/file27446/issue11643-xy_v1.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11643
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1520818] fcntl.ioctl fails to copy back exactly-1024 buffer

2012-10-06 Thread G2P

G2P added the comment:

The bug still exists in Python 2.6 (2.6.7-4ubuntu2). Python 2.7 
(2.7.3-5ubuntu4) works correctly. I don't have Python 2.5 on hand to check.

Here is a very simple test case:

import array, fcntl
buf = array.array('B', [0]*1024)
fcntl.ioctl(0, termios.TIOCGPGRP, buf, 1)
assert any(by != 0 for by in buf)

--
nosy: +G2P

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1520818
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1520818] fcntl.ioctl fails to copy back exactly-1024 buffer

2012-10-06 Thread G2P

G2P added the comment:

Also happens in 2.5.2-2ubuntu6 and 2.4.5-1ubuntu4.2, FWIW.

--
versions: +Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1520818
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15767] add ModuleNotFoundError

2012-10-06 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


--
nosy: +maker

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15767
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16148] Implement PEP 424

2012-10-06 Thread Alex Gaynor

New submission from Alex Gaynor:

The attached patch implements PEP 424. The implementation of this demonstrated 
a need for a few small modifications to the PEP, they will follow shortly.

--
components: Interpreter Core
files: length_hint.diff
keywords: patch
messages: 172176
nosy: alex
priority: normal
severity: normal
status: open
title: Implement PEP 424
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file27447/length_hint.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16148
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13896] Make shelf instances work with 'with' as context managers

2012-10-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3c1df1ede882 by Andrew Svetlov in branch 'default':
Issue #13896: Make shelf instances work with 'with' as context managers.
http://hg.python.org/cpython/rev/3c1df1ede882

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13896
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13896] Make shelf instances work with 'with' as context managers

2012-10-06 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Committed. Thanks.
Please fill Python Contributor Agreement: http://www.python.org/psf/contrib/

--
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13896
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15641] Clean up importlib for Python 3.4

2012-10-06 Thread Andrew Svetlov

Andrew Svetlov added the comment:

What's about Finder?
Do you want to remove it also?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15641
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15631] Python 3.3/3.4 installation issue on OpenSUSE lib/lib64 folders

2012-10-06 Thread Matthias Klose

Matthias Klose added the comment:

the proposed patch has still some issues:

 - it breaks the installation on 64bit platforms on Debian and Ubuntu.
   Please test the patch on one of these platforms too.

 - it hardcodes more platform information in the sys modules, which
   makes it difficult to overwrite for cross builds. If these macros
   are needed then they should be taken from the sysconfig module,
   using the _sysconfigdata module.

 - use the host macros in the configure instead of uname

 - LIB shouldn't be necessary when configuring --with-libdir

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15631
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3636] Managing dual 2.x and 3.0 installations on Windows

2012-10-06 Thread Georg Brandl

Changes by Georg Brandl ge...@python.org:


--
assignee: georg.brandl - 

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3636
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8416] python 2.6.5 documentation can't search

2012-10-06 Thread Georg Brandl

Georg Brandl added the comment:

searchindex.js is now present in 2.6.5 too.

--
resolution:  - fixed
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8416
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8525] Display exception's subclasses in help()

2012-10-06 Thread Georg Brandl

Changes by Georg Brandl ge...@python.org:


--
assignee: georg.brandl - 

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8525
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16149] Decimal(2) != float(2) documentation bug

2012-10-06 Thread Michele Orrù

New submission from Michele Orrù:

Follows from the discussion on python-dev:
http://mail.python.org/pipermail/python-dev/2012-September/121871.html

--
assignee: docs@python
components: Documentation
messages: 172182
nosy: docs@python, maker, terry.reedy
priority: normal
severity: normal
status: open
title: Decimal(2) != float(2) documentation bug
versions: Python 3.3, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16149
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7336] traceback module not properly printing exceptions on interpreter shutdown

2012-10-06 Thread Georg Brandl

Changes by Georg Brandl ge...@python.org:


--
assignee: georg.brandl - 

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7336
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3022] mailbox module, two small fixes

2012-10-06 Thread Georg Brandl

Changes by Georg Brandl ge...@python.org:


--
assignee: georg.brandl - 

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3022
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16148] Implement PEP 424

2012-10-06 Thread Alex Gaynor

Alex Gaynor added the comment:

patch updated fully with respect to the updates georg pushed to the PEP

--
Added file: http://bugs.python.org/file27448/length_hint.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16148
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16148] Implement PEP 424

2012-10-06 Thread Alex Gaynor

Changes by Alex Gaynor alex.gay...@gmail.com:


Removed file: http://bugs.python.org/file27447/length_hint.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16148
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16148] Implement PEP 424

2012-10-06 Thread Alex Gaynor

Alex Gaynor added the comment:

Updated version of the patch with fewer memory leaks.

--
Added file: http://bugs.python.org/file27449/length_hint.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16148
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16148] Implement PEP 424

2012-10-06 Thread Alex Gaynor

Changes by Alex Gaynor alex.gay...@gmail.com:


Removed file: http://bugs.python.org/file27448/length_hint.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16148
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16148] Implement PEP 424

2012-10-06 Thread Alex Gaynor

Alex Gaynor added the comment:

All memory leaks resolved, yay!

--
Added file: http://bugs.python.org/file27450/length_hint.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16148
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16148] Implement PEP 424

2012-10-06 Thread Alex Gaynor

Changes by Alex Gaynor alex.gay...@gmail.com:


Removed file: http://bugs.python.org/file27449/length_hint.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16148
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11710] Landing pages in docs for standard library packages

2012-10-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1141648fa655 by Georg Brandl in branch '3.3':
Closes #11710: create landing pages (/library/package.html) for those 
packages that have no documented content themselves, e.g. urllib or http.
http://hg.python.org/cpython/rev/1141648fa655

--
nosy: +python-dev
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11710
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16149] Decimal(2) != float(2) documentation bug

2012-10-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ee71d8023f1b by Georg Brandl in branch '3.3':
Closes #16149: remove now-false statement about the inability to compare 
Decimal and float objects.
http://hg.python.org/cpython/rev/ee71d8023f1b

--
nosy: +python-dev
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16149
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1598083] Top-level exception handler writes to stdout unsafely

2012-10-06 Thread Georg Brandl

Changes by Georg Brandl ge...@python.org:


--
assignee: georg.brandl - 

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1598083
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8401] Strange behavior of bytearray slice assignment

2012-10-06 Thread Georg Brandl

Changes by Georg Brandl ge...@python.org:


--
assignee: georg.brandl - ezio.melotti

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8401
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16148] Implement PEP 424

2012-10-06 Thread Alex Gaynor

Alex Gaynor added the comment:

Added documentation.

--
Added file: http://bugs.python.org/file27451/length_hint.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16148
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16148] Implement PEP 424

2012-10-06 Thread Alex Gaynor

Changes by Alex Gaynor alex.gay...@gmail.com:


Removed file: http://bugs.python.org/file27450/length_hint.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16148
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16148] Implement PEP 424

2012-10-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a7ec0a1b0f7c by Armin Ronacher in branch 'default':
Issue #16148: implemented PEP 424
http://hg.python.org/cpython/rev/a7ec0a1b0f7c

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16148
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16148] Implement PEP 424

2012-10-06 Thread Armin Ronacher

Armin Ronacher added the comment:

Reviewed and applied.  Looks good.

--
nosy: +aronacher

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16148
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16148] Implement PEP 424

2012-10-06 Thread Armin Ronacher

Changes by Armin Ronacher armin.ronac...@active-4.com:


--
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16148
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15631] Python 3.3/3.4 installation issue on OpenSUSE lib/lib64 folders

2012-10-06 Thread Skip Montanaro

Skip Montanaro added the comment:

 the proposed patch has still some issues:

  - it breaks the installation on 64bit platforms on Debian and Ubuntu.
Please test the patch on one of these platforms too.

  - it hardcodes more platform information in the sys modules, which
makes it difficult to overwrite for cross builds. If these macros
are needed then they should be taken from the sysconfig module,
using the _sysconfigdata module.

  - use the host macros in the configure instead of uname

  - LIB shouldn't be necessary when configuring --with-libdir

Sorry, I don't have access to anything but the OpenSUSE systems at
work.  I was just verifying that it solved my installation problems.
I'll see if I can nudge some of the other things forward.

--
title: Python 3.3/3.4 installation issue  on OpenSUSE lib/lib64 folders - 
Python 3.3/3.4 installation issue on OpenSUSE lib/lib64 folders

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15631
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8478] tokenize.untokenize first token missing failure case

2012-10-06 Thread Georg Brandl

Georg Brandl added the comment:

Attaching patch.  Actually both versions of untokenize() were broken; the 
version used for full input (5-tuples) had a flipped inequality sign in an 
assert.

Other changes in the patch:

* Docs fixed to describe both modes
* Tests fixed to exercise both modes

--
keywords: +patch
Added file: http://bugs.python.org/file27452/untokenize.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8478
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16110] Provide logging.config.configParserConfig

2012-10-06 Thread Thomas Bach

Thomas Bach added the comment:

Yeah, the change you suggest sounds reasonable.

Thanks for reconsidering the case!

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16110
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16115] test that executable arg to Popen() takes precedence over args

2012-10-06 Thread Kushal Das

Kushal Das added the comment:

On Saturday, October 6, 2012, Andrew Svetlov wrote:


 Andrew Svetlov added the comment:

 Committed. Thank you, Kushal Das.
 BTW, please fill http://www.python.org/psf/contrib/ as contributor of
 Python project.
 We would to get that agreement from everybody who has pushed any patch.
 Thanks again.

Hi,
I already filled and sent it. Thanks for the commit.

Kushal

--
title: test that executable arg to Popen() takes precedence over args[0] arg - 
test that executable arg to Popen() takes precedence over args

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16115
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8109] Server-side support for TLS Server Name Indication extension

2012-10-06 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Daniel, I'll take a look.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8109
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15422] Get rid of PyCFunction_New macro

2012-10-06 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Attached patch for the issue.
BTW PyCFunction_New/PyCFunction_NewEx are part of Stable ABI but never 
mentioned in the documentation.

--
keywords: +patch
Added file: http://bugs.python.org/file27453/issue15422.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15422
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15422] Get rid of PyCFunction_New macro

2012-10-06 Thread Andrew Svetlov

Changes by Andrew Svetlov andrew.svet...@gmail.com:


--
stage: needs patch - patch review

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15422
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16120] Use |yield from| in stdlib

2012-10-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7d8868c13b95 by Andrew Svetlov in branch 'default':
Issue #16120: Use |yield from| in stdlib.
http://hg.python.org/cpython/rev/7d8868c13b95

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16120
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16120] Use |yield from| in stdlib

2012-10-06 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Thanks, Berker.

--
assignee:  - nobody
nosy: +asvetlov, nobody
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16120
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16113] Add SHA-3 (Keccak) support

2012-10-06 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


--
nosy: +maker

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16113
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16145] Abort in _csv module

2012-10-06 Thread Stefan Krah

Stefan Krah added the comment:

Here's a patch.


Victor, I guess I have a feature request for fusil: It would be nice
if fusil also generated legacy strings (or does it already do so?).

--
keywords: +patch
Added file: http://bugs.python.org/file27454/issue16145.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16145
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16145] Abort in _csv module

2012-10-06 Thread Stefan Krah

Stefan Krah added the comment:

 The PEPs and doc said the C API would remain backwards compatible.

Roger: Yes, you don't need to change anything. I was misled by the
PyUnicode_AsUnicode() docs, thinking that the responsibility to call
PyUnicode_READY() also applies if the generated Unicode Object is
passed to the C-API.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16145
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16149] Decimal(2) != float(2) documentation bug

2012-10-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think the fix should be applied to 2.7 and 3.2 too. See issue2531 which 
allowed comparing decimals and floats.

--
nosy: +mark.dickinson, serhiy.storchaka
status: closed - open
versions: +Python 2.7, Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16149
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16025] Minor corrections to the zipfile documentation

2012-10-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
keywords: +needs review
versions: +Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16025
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16149] Decimal(2) != float(2) documentation bug

2012-10-06 Thread Georg Brandl

Georg Brandl added the comment:

Ah, sorry, I thought this was a 3.3 thing.

--
nosy: +georg.brandl

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16149
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16148] Implement PEP 424

2012-10-06 Thread Stefan Krah

Stefan Krah added the comment:

a7ec0a1b0f7c broke the Windows buildbots: In Visual Studio variables
can only be declared at the top of a block.

--
nosy: +skrah

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16148
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16150] Implement generator interface in itertools.chain.

2012-10-06 Thread pyos

New submission from pyos:

Since yield from made it into Python 3.3, I think it would be useful to chain 
multiple generators and still get a generator, not an iterator. That is, the 
following code:

def f():
yield from itertools.chain(A, B, C)

should be (at least roughly) equivalent to

def f():
yield from A
yield from B
yield from C

while still allowing to send() values to whichever subgenerator is currently 
running or throw() exceptions inside them.

The attached patch adds this functionality to itertools.chain objects.

--
components: Extension Modules
files: itertools-chain-send-throw-and-close.diff
keywords: patch
messages: 172204
nosy: pyos, rhettinger
priority: normal
severity: normal
status: open
title: Implement generator interface in itertools.chain.
versions: Python 3.3, Python 3.4, Python 3.5
Added file: 
http://bugs.python.org/file27455/itertools-chain-send-throw-and-close.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16150
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16150] Implement generator interface in itertools.chain.

2012-10-06 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +ncoghlan
stage:  - patch review
type:  - enhancement
versions:  -Python 3.3, Python 3.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16150
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16150] Implement generator interface in itertools.chain.

2012-10-06 Thread pyos

Changes by pyos pyos100...@gmail.com:


--
versions: +Python 3.3, Python 3.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16150
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16150] Implement generator interface in itertools.chain.

2012-10-06 Thread pyos

Changes by pyos pyos100...@gmail.com:


--
versions:  -Python 3.3, Python 3.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16150
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16150] Implement generator interface in itertools.chain.

2012-10-06 Thread pyos

Changes by pyos pyos100...@gmail.com:


Added file: http://bugs.python.org/file27456/itertools-chain-doc.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16150
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2012-10-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ping.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1470548
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16025] Minor corrections to the zipfile documentation

2012-10-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2c398a78dba8 by Andrew Svetlov in branch '2.7':
Issue #16025: Minor corrections to the zipfile documentation.
http://hg.python.org/cpython/rev/2c398a78dba8

New changeset 3d54d17a637b by Andrew Svetlov in branch '3.2':
Issue #16025: Minor corrections to the zipfile documentation.
http://hg.python.org/cpython/rev/3d54d17a637b

New changeset 2e7a57cdd961 by Andrew Svetlov in branch '3.3':
Issue #16025: Minor corrections to the zipfile documentation.
http://hg.python.org/cpython/rev/2e7a57cdd961

New changeset 7fd068d4ded8 by Andrew Svetlov in branch 'default':
Issue #16025: Minor corrections to the zipfile documentation.
http://hg.python.org/cpython/rev/7fd068d4ded8

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16025
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16025] Minor corrections to the zipfile documentation

2012-10-06 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Committed. Please close the issue if all work done.
Thanks.

--
nosy: +asvetlov

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16025
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5815] locale.getdefaultlocale() missing corner case

2012-10-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
versions: +Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5815
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16148] Implement PEP 424

2012-10-06 Thread Christian Heimes

Christian Heimes added the comment:

I've taken care of the issue in f56a49e74178 and 895f9fddb8e3.

--
nosy: +christian.heimes
resolution:  - fixed
stage:  - committed/rejected

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16148
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >