[ANN] pyspread 0.2.1

2012-03-13 Thread Martin Manns
==
pyspread 0.2.1
==


Pyspread 0.2.1 is released.

The new version improves GPG integration.


About pyspread
==

Pyspread is a non-traditional spreadsheet application that is based on
and written in the programming language Python. 

The goal of pyspread is to be the most pythonic spreadsheet application.
Pyspread is designed for Linux and other GTK platforms.

Pyspread is free software. It is released under the GPL v3.

Project website: http://manns.github.com/pyspread/


What is new in 0.2.1


 * Format menu added
 * Printing bug (first line not printed) fixed
 * GPG key choice dialog added
 * Secret key generation dialog added
 * Password saving in .pyspreadrc is now optional
 * Preferences dialog entries are now validated
 * Toolbar positions are now saved on exit
 * Absolute addressing with mouse changed to Shift + Ctrl
 * Relative addressing with mouse changed to Alt + Ctrl


Enjoy

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

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


Re: PyCrypto builds neither with MSVC nor MinGW

2012-03-13 Thread Alec Taylor
Nope, I have C:\Python27 (and C:\Python27\Scripts) in my PATH.

C:\workingdir\pycryptowhere python
C:\Python27\python.exe

On Tue, Mar 13, 2012 at 4:44 PM, Case Van Horsen cas...@gmail.com wrote:
 On Mon, Mar 12, 2012 at 9:57 PM, Alec Taylor alec.tayl...@gmail.com wrote:
 Hmm, I just tried that method, but the output I got was still:

 C:\workingdir\pycryptopython setup.py install
 running install
 running build
 running build_py
 running build_ext
 building 'Crypto.Random.OSRNG.winrandom' extension
 Traceback (most recent call last):
  File setup.py, line 452, in module
    core.setup(**kw)
  File C:\Python27\lib\distutils\core.py, line 152, in setup
    dist.run_commands()
  File C:\Python27\lib\distutils\dist.py, line 953, in run_commands
    self.run_command(cmd)
  File C:\Python27\lib\distutils\dist.py, line 972, in run_command
    cmd_obj.run()
  File C:\Python27\lib\distutils\command\install.py, line 563, in run
    self.run_command('build')
  File C:\Python27\lib\distutils\cmd.py, line 326, in run_command
    self.distribution.run_command(command)
  File C:\Python27\lib\distutils\dist.py, line 972, in run_command
    cmd_obj.run()
  File C:\Python27\lib\distutils\command\build.py, line 127, in run
    self.run_command(cmd_name)
  File C:\Python27\lib\distutils\cmd.py, line 326, in run_command
    self.distribution.run_command(command)
  File C:\Python27\lib\distutils\dist.py, line 972, in run_command
    cmd_obj.run()
  File setup.py, line 249, in run
    build_ext.run(self)
  File C:\Python27\lib\distutils\command\build_ext.py, line 339, in run
    self.build_extensions()
  File setup.py, line 146, in build_extensions
    build_ext.build_extensions(self)
  File C:\Python27\lib\distutils\command\build_ext.py, line 448, in
 build_extensions
    self.build_extension(ext)
  File C:\Python27\lib\distutils\command\build_ext.py, line 498, in
 build_extension
    depends=ext.depends)
  File C:\Python27\lib\distutils\msvc9compiler.py, line 473, in compile
    self.initialize()
  File C:\Python27\lib\distutils\msvc9compiler.py, line 383, in initialize
    vc_env = query_vcvarsall(VERSION, plat_spec)
  File C:\Python27\lib\distutils\msvc9compiler.py, line 299, in
 query_vcvarsall
    raise ValueError(str(list(result.keys(
 ValueError: [u'path']

 --
 and when I manually run vcvarsall (which is in PATH), I get the
 aforementioned linker errors:
 --

 C:\workingdir\pycryptopython setup.py install
 running install
 running build
 running build_py
 running build_ext
 building 'Crypto.Random.OSRNG.winrandom' extension
 C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c
 /nologo /Ox /MD /W3 /GS- /DNDEBUG -Isrc/ -Isrc/inc-msvc/
 -IC:\Python27\include -IC:\Python27 \PC /Tcsrc/winrand.c
 /Fobuild\temp.win-amd64-2.7\Release\src/winrand.obj winrand.c
 C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\link.exe
 /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Python27\libs
 /LIBPATH:C:\Python27\PCbuild\amd64 ws2 _32.lib advapi32.lib
 /EXPORT:initwinrandom build\temp.win-amd64-2.7\Release\src/
 winrand.obj /OUT:build\lib.win-amd64-2.7\Crypto\Random\OSRNG\winrandom.pyd 
 /IMPL
 IB:build\temp.win-amd64-2.7\Release\src\winrandom.lib
 /MANIFESTFILE:build\temp.win-amd64-2.7\Release\src\winrandom.pyd.manifest
   Creating library build\temp.win-amd64-2.7\Release\src\winrandom.lib
 and object build\temp.win-amd64-2.7\Release\src\winrandom.exp
 winrand.obj : error LNK2019: unresolved external symbol
 __imp__PyObject_Free referenced in function _WRdealloc
 winrand.obj : error LNK2019: unresolved external symbol
 __imp__PyExc_SystemError referenced in function _WRdealloc
 winrand.obj : error LNK2019: unresolved external symbol
 __imp__PyErr_Format referenced in function _WRdealloc
 winrand.obj : error LNK2019: unresolved external symbol
 __imp__PyExc_TypeError referenced in function _WRdealloc
 winrand.obj : error LNK2019: unresolved external symbol
 __imp___PyObject_New referenced in function _winrandom_new
 winrand.obj : error LNK2019: unresolved external symbol
 __imp__PyArg_ParseTupleAndKeywords referenced in function
 _winrandom_new
 winrand.obj : error LNK2019: unresolved external symbol
 __imp__PyString_FromStringAndSize referenced in function _WR_get_bytes
 winrand.obj : error LNK2019: unresolved external symbol
 __imp__PyMem_Free referenced in function _WR_get_bytes
 winrand.obj : error LNK2019: unresolved external symbol
 __imp__PyErr_NoMemory referenced in function _WR_get_bytes
 winrand.obj : error LNK2019: unresolved external symbol
 __imp__PyMem_Malloc referenced in function _WR_get_bytes
 winrand.obj : error LNK2019: unresolved external symbol
 __imp__PyErr_SetString referenced in function _WR_get_bytes
 winrand.obj : error LNK2019: unresolved external symbol
 __imp__PyExc_ValueError referenced in function _WR_get_bytes
 winrand.obj : error LNK2019: unresolved external symbol
 __imp__PyArg_ParseTuple referenced in function _WR_get_bytes
 winrand.obj : error LNK2019: 

Windows Contextmenu

2012-03-13 Thread Szabo, Patrick (LNG-VIE)
Hi, 

 

I wrote the following Script which I want to run from the open with
contextmenu in Windows. 

For that purpose I used py2exe to make an exe out of it. 

 

import sys, time, webbrowser

 

def main():

for para in sys.argv[1:]:

print sys.argv

print ###

print para

url = http://production.lexisnexis.at:8080/cocoon/glp/html/%s;
% str(para).replace(R:\\, ).replace(.xml, .html)

webbrowser.open_new(url)

time.sleep(10)



if __name__ == __main__:

main() 

 

Now the script runs fine but I don't get all arguments from sys.argv.

No mather how many files I mark in the explorer I only get one as an
argument. 

 

Can anyone tell me how to overcome this issue ?

 

Best regards

 

 


. . . . . . . . . . . . . . . . . . . . . . . . . .
Ing. Patrick Szabo
 XSLT Developer 
LexisNexis
A-1030 Wien, Marxergasse 25

mailto:patrick.sz...@lexisnexis.at
Tel.: +43 1 53452 1573 
Fax: +43 1 534 52 146 





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


Re: How to break long method name into more than one line?

2012-03-13 Thread Jean-Michel Pichavant

Chris Angelico wrote:

Just never treat them as laws of physics (in
Soviet Physics, rules break you!).

ChrisA
  


hum ...
I wonder how this political message is relevant to the OP problem.

JM

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


Re: How to break long method name into more than one line?

2012-03-13 Thread Chris Angelico
On Tue, Mar 13, 2012 at 9:30 PM, Jean-Michel Pichavant
jeanmic...@sequans.com wrote:
 Chris Angelico wrote:

 Just never treat them as laws of physics (in
 Soviet Physics, rules break you!).

 hum ...
 I wonder how this political message is relevant to the OP problem.

Ehh, it's a reference to the in Soviet Russia theme of one-liners.
You don't break the laws of physics, they break you. My point is that
rules about function names etc are *not* inviolate, and should be
treated accordingly.

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


Re: Windows Contextmenu

2012-03-13 Thread Tim Golden

On 13/03/2012 09:41, Szabo, Patrick (LNG-VIE) wrote:

I wrote the following Script which I want to run from the open with
contextmenu in Windows.

For that purpose I used py2exe to make an exe out of it.


[... snip ...]



Now the script runs fine but I don’t get all arguments from sys.argv.

No mather how many files I mark in the explorer I only get one as an
argument.


You're missing out vital information:

* How have you attached this code to the context menu? What was
the exact registry entry (or other method) you used?

* Does it work as native Python (ie without the py2exe layer)?

* Presumably the same issue occurs if you simply have: print sys.argv
  on its own (ie it's nothing to do with your loop and later code)

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


Re: are int, float, long, double, side-effects of computer engineering?

2012-03-13 Thread Albert van der Horst
In article 5aaded58-af09-41dc-9afd-56d7b7ced...@d7g2000pbl.googlegroups.com,
Xah Lee  xah...@gmail.com wrote:
SNIP

what i meant to point out is that Mathematica deals with numbers at a
high-level human way. That is, one doesn't think in terms of float,
long, int, double. These words are never mentioned. Instead, you have
concepts of machine precision, accuracy. The lang automatically handle
the translation to hardware, and invoking exact value or infinite
precision as required or requested.

With e.g. a vanderMonde matrix you can easily make Mathematica fail.
If you don't understand what a condition number is, you can't use
Mathematica. And yes condition numbers are fully in the realm
of concepts of machine precisions and accuracy.

Infinite precision takes infinite time. Approaching infinite precious
may take exponentional time.


 Xah

Groetjes Albert

--
-- 
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert@spearc.xs4all.nl =n http://home.hccnet.nl/a.w.m.van.der.horst

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


Re: New Science Discovery: Perl Idiots Remain Idiots After A Decade!New Science Discovery: Perl Idiots Remain Idiots After A Decade!

2012-03-13 Thread Kiuhnm

On 3/12/2012 20:00, Albert van der Horst wrote:

In article4f5df4b3$0$1375$4fafb...@reader1.news.tin.it,
Kiuhnmkiuhnm03.4t.yahoo.it  wrote:

On 3/12/2012 12:27, Albert van der Horst wrote:

Interestingly in mathematics associative means that it doesn't matter
whether you use (a.b).c or a.(b.c).
Using xxx-associativity to indicate that it *does* matter is
a bit perverse, but the Perl people are not to blame if they use
a term in their usual sense.


You may see it this way:
Def1. An operator +:SxS-S is left-associative iff
   a+b+c = (a+b)+c for all a,b,c in S.
Def2. An operator +:SxS-S is right-associative iff
   a+b+c = a+(b+c) for all a,b,c in S.
Def3. An operator +:SxS-S is associative iff it is both left and
right-associative.


I know, but what the mathematicians do make so much more sense:
(a+b)+c = a+(b+c)definition of associative.
Henceforth we may leave out the brackets.


That's Def3. I don't see your point.


Don't leave out the brackets if the operators if the operators is
not associative.


(1 - 1) - 1 != 1 - (1 - 1)
and yet we can leave out the parentheses.


P.S. There is no need for the operators to be SxS-S.
For example a b c may be m by n, n by l, l by k matrices respectively.


Ops, you're right.

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


Re: New Science Discovery: Perl Idiots Remain Idiots After A Decade!New Science Discovery: Perl Idiots Remain Idiots After A Decade!

2012-03-13 Thread Kiuhnm

On 3/12/2012 20:00, Albert van der Horst wrote:

In article4f5df4b3$0$1375$4fafb...@reader1.news.tin.it,
Kiuhnmkiuhnm03.4t.yahoo.it  wrote:

On 3/12/2012 12:27, Albert van der Horst wrote:

Interestingly in mathematics associative means that it doesn't matter
whether you use (a.b).c or a.(b.c).
Using xxx-associativity to indicate that it *does* matter is
a bit perverse, but the Perl people are not to blame if they use
a term in their usual sense.


You may see it this way:
Def1. An operator +:SxS-S is left-associative iff
   a+b+c = (a+b)+c for all a,b,c in S.
Def2. An operator +:SxS-S is right-associative iff
   a+b+c = a+(b+c) for all a,b,c in S.
Def3. An operator +:SxS-S is associative iff it is both left and
right-associative.


I know, but what the mathematicians do make so much more sense:
(a+b)+c = a+(b+c)definition of associative.
Henceforth we may leave out the brackets.


That's Def3. I don't see your point.


Don't leave out the brackets if the operators if the operators is
not associative.


(1 - 1) - 1 != 1 - (1 - 1)
and yet we can leave out the parentheses.


P.S. There is no need for the operators to be SxS-S.
For example a b c may be m by n, n by l, l by k matrices respectively.


Ops, you're right.

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


concatenate function

2012-03-13 Thread ferreirafm
Hi List,
I've coded three functions that I would like to concatenate. I mean, run
them one after another. The third function depends on the results of the
second function, which depends on the results of the first one. When I call
one function after another, python runs them at the same time causing
obvious errors messages. I've tried to call one of them from inside another
but no way. Any clues are appreciated.
Complete code goes here: 
http://ompldr.org/vZDB4OQ



--
View this message in context: 
http://python.6.n6.nabble.com/concatenate-function-tp4574176p4574176.html
Sent from the Python - python-list mailing list archive at Nabble.com.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: concatenate function

2012-03-13 Thread Ian Kelly
On Tue, Mar 13, 2012 at 8:35 AM, ferreirafm ferreir...@lim12.fm.usp.br wrote:
 Hi List,
 I've coded three functions that I would like to concatenate. I mean, run
 them one after another. The third function depends on the results of the
 second function, which depends on the results of the first one. When I call
 one function after another, python runs them at the same time causing
 obvious errors messages. I've tried to call one of them from inside another
 but no way. Any clues are appreciated.
 Complete code goes here:
 http://ompldr.org/vZDB4OQ

They don't look to me like they would run at the same time --
subprocess.call is supposed to wait for the subprocess to finish.
What error messages are you getting?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: New Science Discovery: Perl Idiots Remain Idiots After A Decade!New Science Discovery: Perl Idiots Remain Idiots Af

2012-03-13 Thread Seymour J.
In m0scsu@spenarnc.xs4all.nl, on 03/12/2012
   at 07:00 PM, Albert van der Horst alb...@spenarnc.xs4all.nl said:

I know, but what the mathematicians do make so much more sense:

Not really; Mathematical notation is a matter of convention, and the
conventions owe as much to History as they do to logical necessity.
The conventions aren't even the same from author to author, e.g.,
whether field implies Abelian.

-- 
Shmuel (Seymour J.) Metz, SysProg and JOAT  http://patriot.net/~shmuel

Unsolicited bulk E-mail subject to legal action.  I reserve the
right to publicly post or ridicule any abusive E-mail.  Reply to
domain Patriot dot net user shmuel+news to contact me.  Do not
reply to spamt...@library.lspace.org

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


Re: concatenate function

2012-03-13 Thread Robert Kern

On 3/13/12 2:35 PM, ferreirafm wrote:

Hi List,
I've coded three functions that I would like to concatenate. I mean, run
them one after another. The third function depends on the results of the
second function, which depends on the results of the first one. When I call
one function after another, python runs them at the same time causing
obvious errors messages. I've tried to call one of them from inside another
but no way. Any clues are appreciated.
Complete code goes here:
http://ompldr.org/vZDB4OQ


Just to clarify, the Python functions are indeed running consecutively, not 
concurrently. Your Python functions write scripts and then use subprocess.call() 
to make qsub (an external program) to submit those scripts to a job queue. What 
you are calling a function in your post are these scripts. Please don't call 
them functions. It's confusing.


Python is not running these scripts concurrently. Your job queue is. 
subprocess.call() will wait until qsub returns. However, qsub just submits the 
script to the job queue; it does not wait until the job is completed. Most 
qsub-using job queues can be set up to make jobs depend on the completion of 
other jobs. You will need to read the documentation of your job queue to figure 
out how to do this. Once you figure out the right arguments to give to qsub, 
your Python code is already more or less correct.


--
Robert Kern

I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth.
  -- Umberto Eco

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


Re: concatenate function

2012-03-13 Thread ferreirafm
Hi Ian, 
That what I have:
 burst.py
Your job 46665 (top_n_pdb.qsub) has been submitted
Your job 4 (extr_pdb.qsub) has been submitted
Your job 46667 (combine_top.qsub) has been submitted

The first job runs quite well. The second is still runing and the third
issue the following:
  more combine_top.qsub.e46667
ERROR: Cannot open PDB file S_3MSEB_26_0032.pdb
ERROR:: Exit from: src/core/import_pose/import_pose.cc line: 199



--
View this message in context: 
http://python.6.n6.nabble.com/concatenate-function-tp4574176p4574337.html
Sent from the Python - python-list mailing list archive at Nabble.com.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: concatenate function

2012-03-13 Thread James Elford
On 13/03/12 14:35, ferreirafm wrote:
 Hi List,
 I've coded three functions that I would like to concatenate. I mean, run
 them one after another. The third function depends on the results of the
 second function, which depends on the results of the first one. When I call
 one function after another, python runs them at the same time causing
 obvious errors messages. I've tried to call one of them from inside another
 but no way. Any clues are appreciated.


 Complete code goes here: 
 http://ompldr.org/vZDB4OQ

Do you think you could provide a much shorter example to illustrate what
you need? In general, when you want to run one function on the result of
another, you can do something like:

 def increment_all(l);
... return [i+1 for i in l]

 increment_all(increment_all(range(3))
[2, 3, 4]

Here we apply the function increment_all to the result of the function
increment_all.

If you are talking about the results of each function in terms of it
mutating an object, and then the next function mutating the same object
in a (possibly) different way, then calling the functions in order will
do what you want.

l = [0, 3, 5, 2]
l.append(10)# [0, 3, 5, 2, 10]
l.sort()# [0, 2, 3, 5, 10]
l.append(3) # [0, 2, 3, 5, 10, 3]

James

 
 
 
 --
 View this message in context: 
 http://python.6.n6.nabble.com/concatenate-function-tp4574176p4574176.html
 Sent from the Python - python-list mailing list archive at Nabble.com.

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


Re: concatenate function

2012-03-13 Thread ferreirafm
Hi Robert, 
Thanks for you kind replay and I'm sorry for my semantic mistakes.
Indeed, that's what I'm doing: qsub-ing different cshell scripts. Certainly,
that's not the best approach and the only problem. I've unsuccessfully tried
to set an os.environ and call qsub from it. However, subprocess.Popen seems
not accept to run qsub over a second program. Do you have a over come to
this issue?
Code goes here:
http://ompldr.org/vZDB5YQ

--
View this message in context: 
http://python.6.n6.nabble.com/concatenate-function-tp4574176p4574496.html
Sent from the Python - python-list mailing list archive at Nabble.com.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: concatenate function

2012-03-13 Thread ferreirafm
Hi James, thank you for your replay. Indeed, the problem is qsub. And as
warned by Robert, I don't have functions properly, but just scripts.
 

--
View this message in context: 
http://python.6.n6.nabble.com/concatenate-function-tp4574176p4574511.html
Sent from the Python - python-list mailing list archive at Nabble.com.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Software Engineer -

2012-03-13 Thread Paul Rudin
Chris Withers ch...@simplistix.co.uk writes:

 On 11/03/2012 09:00, Blue Line Talent wrote:
 Blue Line Talent is looking for a mid-level software engineer with
 experience in a combination of

 Please don't spam this list with jobs, use the Python job board instead:

 http://www.python.org/community/jobs/

Just out of interest why do people object to job adverts here? Seems
harmless enough...
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: concatenate function

2012-03-13 Thread James Elford
On 13/03/12 16:02, ferreirafm wrote:
 Hi James, thank you for your replay. Indeed, the problem is qsub. And as
 warned by Robert, I don't have functions properly, but just scripts.
  
 
 --
 View this message in context: 
 http://python.6.n6.nabble.com/concatenate-function-tp4574176p4574511.html
 Sent from the Python - python-list mailing list archive at Nabble.com.

It looks like you're not calling wait() on your subprocesses: you're
effectively launching a bunch of processes, then not waiting for them to
finish before you ask the next process to operate on the same file.

If you haven't given it a good look-over already, the subprocess
documentation [1] is worth taking a little time over.

[1]: http://docs.python.org/library/subprocess.html#popen-objects

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


Re: concatenate function

2012-03-13 Thread Robert Kern

On 3/13/12 3:59 PM, ferreirafm wrote:

Hi Robert,
Thanks for you kind replay and I'm sorry for my semantic mistakes.
Indeed, that's what I'm doing: qsub-ing different cshell scripts. Certainly,
that's not the best approach and the only problem.


It's not a problem to write out a script and have qsub run it. That's a 
perfectly fine thing to do. You need to read the documentation for your job 
queue to find out the right arguments to give to qsub to make it wait until the 
first job finishes before executing the second job. This is not a Python 
problem. You just need to find the right flags to give to qsub.


Alternately, you could just make a single .qsub script running all three of your 
programs in a single job instead of making three separate .qsub scripts.



I've unsuccessfully tried
to set an os.environ and call qsub from it. However, subprocess.Popen seems
not accept to run qsub over a second program. Do you have a over come to
this issue?
Code goes here:
http://ompldr.org/vZDB5YQ


When you report a problem, you should copy-and-paste the output that you got and 
also state the output that you expected. I have no idea what you mean when you 
say subprocess.Popen seems not accept to run qsub over a second program.


--
Robert Kern

I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth.
  -- Umberto Eco

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


Re: New Science Discovery: Perl Idiots Remain Idiots After A Decade!New Science Discovery: Perl Idiots Remain Idiots After A Decade!

2012-03-13 Thread Kiuhnm

On 3/12/2012 20:00, Albert van der Horst wrote:
[...]

Sorry for triple posting. I hadn't noticed the follow up and I was 
blaming my newsserver.

BTW, Python is the next language (right after Perl) I'm going to learn.
Then I'll probably have a look at Ruby...

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


Re: Installing Python Apps on Mac Lion

2012-03-13 Thread dilvanezanardine
Sábado, 25 de Junho de 2011 02h20min49s UTC+1, JKPeck escreveu:
 The Lion version of the OS on the Mac comes with Python 2.7 installed, but it 
 is in /System/Library/Frameworks/..., and this area is not writable by third 
 party apps.
 
 So is there a consensus on what apps that typically install under the Python 
 site-packages directory should do in this situation?  Installing Python from 
 python.org puts it in the writable area /Library/Frameworks/Python.framework.
 
 So, what should a Python app installer do?
 
 Thanks

Hello,

currently I have:

/Library/Python/2.7/
/Library/Frameworks/Python.framework/Versions/2.7/
/Users/user/Library/Python/2.7/

With 3 folders site-packages and do not know why.
What's the difference?

Thanks.

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


Re: Software Engineer -

2012-03-13 Thread Pedro H. G. Souto

On 2012-03-13 12:44 PM, Paul Rudin wrote:

Just out of interest why do people object to job adverts here? Seems
harmless enough...
Wannabe list admins... Or list admins with a need to proof themselves... 
Or none of the above.

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


Re: Software Engineer -

2012-03-13 Thread Neil Cerutti
On 2012-03-13, Pedro H. G. Souto phgso...@gmail.com wrote:
 On 2012-03-13 12:44 PM, Paul Rudin wrote:
 Just out of interest why do people object to job adverts here?
 Seems harmless enough...

 Wannabe list admins... Or list admins with a need to proof
 themselves... Or none of the above.

A job listing here or there would fine. If the discussion were
clogged with them, it would be really annoying.

In addition, it's more efficient to post job listing in a place
where people looking for jobs can easily find them, and it's
annoying and useless to post them in a place where reader not
looking for jobs have to delete them.

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


RE: Windows Contextmenu

2012-03-13 Thread Prasad, Ramit
  Now the script runs fine but I don't get all arguments from sys.argv.
 
  No mather how many files I mark in the explorer I only get one as an
  argument.
 
 You're missing out vital information:
 
 * How have you attached this code to the context menu? What was
 the exact registry entry (or other method) you used?

From a quick Google search, it seems that most of the context menu
entries open a single file. If multiple files are selected then
the command is called once for each file. The workaround seems
to check if the processes is already running and if it is then to
directly send it a open command.

That being said, since you are opening a web browser (or so it
seems to me based on the webbrowser.open), you should not have
an issue because modern web browsers will open each link in a tab.

To answer your question, you will not get more than one as an
argument. That is expected behavior. 

Ramit


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423

--

This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: concatenate function

2012-03-13 Thread ferreirafm

Robert Kern-2 wrote
 
 When you report a problem, you should copy-and-paste the output that you
 got and 
 also state the output that you expected. I have no idea what you mean when
 you 
 say subprocess.Popen seems not accept to run qsub over a second
 program.
 

Code goes here: 
http://ompldr.org/vZDB5YQ

stdout:
$ no_name.py --toplist top_percent.list
Traceback (most recent call last):
  File /home6/psloliveira/ferreirafm/bin/no_name.py, line 73, in module
main()
  File /home6/psloliveira/ferreirafm/bin/no_name.py, line 68, in main
comb_slt(toplist)
  File /home6/psloliveira/ferreirafm/bin/no_name.py, line 55, in comb_slt
subprocess.Popen([cmd, options], env=qsub_env)
  File /share/apps/python/lib/python2.7/subprocess.py, line 679, in
__init__
errread, errwrite)
  File /share/apps/python/lib/python2.7/subprocess.py, line 1228, in
_execute_child
raise child_exception
OSError: [Errno 13] Permission denied

--
View this message in context: 
http://python.6.n6.nabble.com/concatenate-function-tp4574176p4574967.html
Sent from the Python - python-list mailing list archive at Nabble.com.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Installing Python Apps on Mac Lion

2012-03-13 Thread Benjamin Kaplan
On Tue, Mar 13, 2012 at 12:42 PM, dilvanezanard...@gmail.com wrote:

 Sábado, 25 de Junho de 2011 02h20min49s UTC+1, JKPeck escreveu:
  The Lion version of the OS on the Mac comes with Python 2.7 installed,
  but it is in /System/Library/Frameworks/..., and this area is not writable
  by third party apps.
 
  So is there a consensus on what apps that typically install under the
  Python site-packages directory should do in this situation?  Installing
  Python from python.org puts it in the writable area
  /Library/Frameworks/Python.framework.
 
  So, what should a Python app installer do?
 
  Thanks

 Hello,

 currently I have:

 /Library/Python/2.7/
 /Library/Frameworks/Python.framework/Versions/2.7/
 /Users/user/Library/Python/2.7/

 With 3 folders site-packages and do not know why.
 What's the difference?

 Thanks.


If I had to take a guess, having not played too much with Lion:

/Library/Python/2.7 is for user-installed packages for the system
python that are installed for all users.
/Library/Frameworks/... is for the user-installed Python (that's where
it's always gone)
/Users/user/Library... is for user-installed packages for the system
Python that are only installed for the specific user.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Windows Contextmenu

2012-03-13 Thread Terry Reedy

On 3/13/2012 5:41 AM, Szabo, Patrick (LNG-VIE) wrote:

Hi,

I wrote the following Script which I want to run from the open with
contextmenu in Windows.



Now the script runs fine but I don’t get all arguments from sys.argv.

No mather how many files I mark in the explorer I only get one as an
argument.


The right-click contextmenu is not a command line. It is more like a 
list of no-arg* methods to call on the selected file.


* or rather, one input arg, with others having default values set when 
the menu entry is created. Sometimes a second input arg is handled, at 
least in effect, with a second submenu, but I am not familiar with how 
those are done in Windows.


--
Terry Jan Reedy


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


Re: concatenate function

2012-03-13 Thread Robert Kern

On 3/13/12 6:01 PM, ferreirafm wrote:


Robert Kern-2 wrote


When you report a problem, you should copy-and-paste the output that you
got and
also state the output that you expected. I have no idea what you mean when
you
say subprocess.Popen seems not accept to run qsub over a second
program.



Code goes here:
http://ompldr.org/vZDB5YQ

stdout:
$ no_name.py --toplist top_percent.list
Traceback (most recent call last):
   File /home6/psloliveira/ferreirafm/bin/no_name.py, line 73, inmodule
 main()
   File /home6/psloliveira/ferreirafm/bin/no_name.py, line 68, in main
 comb_slt(toplist)
   File /home6/psloliveira/ferreirafm/bin/no_name.py, line 55, in comb_slt
 subprocess.Popen([cmd, options], env=qsub_env)
   File /share/apps/python/lib/python2.7/subprocess.py, line 679, in
__init__
 errread, errwrite)
   File /share/apps/python/lib/python2.7/subprocess.py, line 1228, in
_execute_child
 raise child_exception
OSError: [Errno 13] Permission denied


You need to use a command list like this:

['qsub', 'combine_silent.linuxgccrelease', '-database', 
'/home6/psloliveira/rosetta_database/', ...]


The program to run (qsub, not qsub combine_silent.linuxgccrelease) and each 
individual argument must be a separate string in the list. You cannot combine 
them together with spaces. The reason you get a Permission denied error is 
that it tried to find an executable file named qsub 
combine_silent.linuxgccrelease and, obviously, could not.


--
Robert Kern

I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth.
  -- Umberto Eco

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


Re: concatenate function

2012-03-13 Thread Chris Rebert
On Tue, Mar 13, 2012 at 1:35 PM, Robert Kern robert.k...@gmail.com wrote:
 On 3/13/12 6:01 PM, ferreirafm wrote:
 Robert Kern-2 wrote
 When you report a problem, you should copy-and-paste the output that you
 got and
 also state the output that you expected. I have no idea what you mean
 when
 you
 say subprocess.Popen seems not accept to run qsub over a second
 program.


 Code goes here:
 http://ompldr.org/vZDB5YQ

 stdout:
 $ no_name.py --toplist top_percent.list
 Traceback (most recent call last):
   File /home6/psloliveira/ferreirafm/bin/no_name.py, line 73, inmodule
     main()
   File /home6/psloliveira/ferreirafm/bin/no_name.py, line 68, in main
     comb_slt(toplist)
   File /home6/psloliveira/ferreirafm/bin/no_name.py, line 55, in
 comb_slt
     subprocess.Popen([cmd, options], env=qsub_env)
   File /share/apps/python/lib/python2.7/subprocess.py, line 679, in
 __init__
     errread, errwrite)
   File /share/apps/python/lib/python2.7/subprocess.py, line 1228, in
 _execute_child
     raise child_exception
 OSError: [Errno 13] Permission denied


 You need to use a command list like this:

 ['qsub', 'combine_silent.linuxgccrelease', '-database',
 '/home6/psloliveira/rosetta_database/', ...]

 The program to run (qsub, not qsub combine_silent.linuxgccrelease) and
 each individual argument must be a separate string in the list. You cannot
 combine them together with spaces. The reason you get a Permission denied
 error is that it tried to find an executable file named qsub
 combine_silent.linuxgccrelease and, obviously, could not.

See also the first Note box (and the description of args generally) under
http://docs.python.org/library/subprocess.html#popen-constructor

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


Re: Fast file data retrieval?

2012-03-13 Thread Jorgen Grahn
On Mon, 2012-03-12, MRAB wrote:
 On 12/03/2012 19:39, Virgil Stokes wrote:
 I have a rather large ASCII file that is structured as follows

 header line
 9 nonblank lines with alphanumeric data
 header line
 9 nonblank lines with alphanumeric data
 ...
 ...
 ...
 header line
 9 nonblank lines with alphanumeric data
 EOF

 where, a data set contains 10 lines (header + 9 nonblank) and there can
 be several thousand
 data sets in a single file. In addition,*each header has a* *unique ID
 code*.

 Is there a fast method for the retrieval of a data set from this large
 file given its ID code?

[Responding here since the original is not available on my server.]

It depends on what you want to do. Access a few of the entries (what
you call data sets) from your program? Process all of them?  How fast
do you need it to be?

 Probably the best solution is to put it into a database. Have a look at
 the sqlite3 module.

Some people like to use databases for everything, others never use
them. I'm in the latter crowd, so to me this sounds as overkill, and
possibly impractical. What if he has to keep the text file around? A
database on disk would mean duplicating the data. A database in memory
would not offer any benefits over a hash.

 Alternatively, you could scan the file, recording the ID and the file
 offset in a dict so that, given an ID, you can seek directly to that
 file position.

Mmapping the file (the mmap module) is another option.
But I wonder if this really would improve things.

Several thousand entries is not much these days. If a line is 80
characters, 5000 entries would take ~3MB of memory. The time to move
this from disk to a Python list of 9-tuples of strings would be almost
only disk I/O.

I think he should try to do it the dumb way first: read everything
into memory once.

/Jorgen

-- 
  // Jorgen Grahn grahn@  Oo  o.   . .
\X/ snipabacken.se   O  o   .
-- 
http://mail.python.org/mailman/listinfo/python-list


Enchancement suggestion for argparse: intuit type from default

2012-03-13 Thread Roy Smith
Using argparse, if I write:

parser.add_argument('--foo', default=100)

it seems like it should be able to intuit that the type of foo should
be int (i.e. type(default)) without my having to write:

parser.add_argument('--foo', type=int, default=100)

Does this seem like a reasonable enhancement to argparse?


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


Re: Enchancement suggestion for argparse: intuit type from default

2012-03-13 Thread Ben Finney
r...@panix.com (Roy Smith) writes:

 Using argparse, if I write:

 parser.add_argument('--foo', default=100)

 it seems like it should be able to intuit that the type of foo should
 be int (i.e. type(default))
[…]

-0.5.

That feels too magical to me. I don't see a need to special-case that
usage. There's not much burden in being explicit for the argument type.

-- 
 \   “Value your freedom or you will lose it, teaches history. |
  `\ “Don't bother us with politics,” respond those who don't want |
_o__)to learn.” —Richard M. Stallman, 2002 |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list


[ANN] pyspread 0.2.1

2012-03-13 Thread Martin Manns
==
pyspread 0.2.1
==


Pyspread 0.2.1 is released.

The new version improves GPG integration.


About pyspread
==

Pyspread is a non-traditional spreadsheet application that is based on
and written in the programming language Python. 

The goal of pyspread is to be the most pythonic spreadsheet application.
Pyspread is designed for Linux and other GTK platforms.

Pyspread is free software. It is released under the GPL v3.

Project website: http://manns.github.com/pyspread/


What is new in 0.2.1


 * Format menu added
 * Printing bug (first line not printed) fixed
 * GPG key choice dialog added
 * Secret key generation dialog added
 * Password saving in .pyspreadrc is now optional
 * Preferences dialog entries are now validated
 * Toolbar positions are now saved on exit
 * Absolute addressing with mouse changed to Shift + Ctrl
 * Relative addressing with mouse changed to Alt + Ctrl


Enjoy

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


Re: Adopting ‘lockfile’

2012-03-13 Thread Ben Finney
Chris Withers ch...@simplistix.co.uk writes:

 On 03/03/2012 21:43, Ben Finney wrote:
  I don't see a need to horse around with Git either :-) It's currently in
  Subversion, right? Can you not export the VCS history from Google Code's
  Subversion repository […]

 What's wrong with a git svn clone svn-url-here ?

Thanks for the suggestion. I've imported it from Subversion into Bazaar
(my preferred DVCS), and it went smoothly.

I will proceed with a handover from Skip for maintenance of ‘lockfile’.


This will definitely need more people than me to maintain, though! I am
interested and motivated to work on the Linux platform, but other
platforms will suffer unless I get co-maintainers with experience in the
different file locking semantics there.

-- 
 \  “I find the whole business of religion profoundly interesting. |
  `\ But it does mystify me that otherwise intelligent people take |
_o__)it seriously.” —Douglas Adams |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python-list Digest, Vol 102, Issue 64

2012-03-13 Thread David Shi
I am looking very simple and straightforward open source Python REST and SOAP 
demo modules.

I really need things which are very simple and convincing.   I want to 
demonstrate these to other people.

I want to promote you guys' interest.   I find asp and others frustrating and 
occupy too much in the market and popularity.

Can we do a new tidal wave to win a reasonable portion of the development 
market?

Send me materials to davidg...@yahoo.co.uk

I will give it a go on behalf of the Python community.

Regards.

David



 From: python-list-requ...@python.org python-list-requ...@python.org
To: python-list@python.org 
Sent: Tuesday, 13 March 2012, 20:35
Subject: Python-list Digest, Vol 102, Issue 64
 
- Forwarded Message -

Send Python-list mailing list submissions to
    python-list@python.org

To subscribe or unsubscribe via the World Wide Web, visit
    http://mail.python.org/mailman/listinfo/python-list
or, via email, send a message with subject or body 'help' to
    python-list-requ...@python.org

You can reach the person managing the list at
    python-list-ow...@python.org

When replying, please edit your Subject line so it is more specific
than Re: Contents of Python-list digest...

Today's Topics:

   1. Re: concatenate function (James Elford)
   2. Re: New Science Discovery: Perl Idiots Remain Idiots After A
      Decade!New    Science Discovery: Perl Idiots Remain Idiots After A
      Decade! (Kiuhnm)
   3. Re: Installing Python Apps on  Mac Lion
      (dilvanezanard...@gmail.com)
   4. Re: Software Engineer - (Pedro H. G. Souto)
   5. Re: Software Engineer - (Neil Cerutti)
   6. RE: Windows Contextmenu (Prasad, Ramit)
   7. Re: concatenate function (ferreirafm)
   8. Re: Installing Python Apps on Mac Lion (Benjamin Kaplan)
   9. Re: Windows Contextmenu (Terry Reedy)
  10. Re: concatenate function (Robert Kern)
On 13/03/12 16:02, ferreirafm wrote:
 Hi James, thank you for your replay. Indeed, the problem is qsub. And as
 warned by Robert, I don't have functions properly, but just scripts.
  
 
 --
 View this message in context: 
 http://python.6.n6.nabble.com/concatenate-function-tp4574176p4574511.html
 Sent from the Python - python-list mailing list archive at Nabble.com.

It looks like you're not calling wait() on your subprocesses: you're
effectively launching a bunch of processes, then not waiting for them to
finish before you ask the next process to operate on the same file.

If you haven't given it a good look-over already, the subprocess
documentation [1] is worth taking a little time over.

    [1]: http://docs.python.org/library/subprocess.html#popen-objects

James

On 3/12/2012 20:00, Albert van der Horst wrote:
[...]

Sorry for triple posting. I hadn't noticed the follow up and I was blaming my 
newsserver.
BTW, Python is the next language (right after Perl) I'm going to learn.
Then I'll probably have a look at Ruby...

Kiuhnm

Sábado, 25 de Junho de 2011 02h20min49s UTC+1, JKPeck escreveu:
 The Lion version of the OS on the Mac comes with Python 2.7 installed, but it 
 is in /System/Library/Frameworks/..., and this area is not writable by third 
 party apps.
 
 So is there a consensus on what apps that typically install under the Python 
 site-packages directory should do in this situation?  Installing Python from 
 python.org puts it in the writable area /Library/Frameworks/Python.framework.
 
 So, what should a Python app installer do?
 
 Thanks

Hello,

currently I have:

/Library/Python/2.7/
/Library/Frameworks/Python.framework/Versions/2.7/
/Users/user/Library/Python/2.7/

With 3 folders site-packages and do not know why.
What's the difference?

Thanks.


On 2012-03-13 12:44 PM, Paul Rudin wrote:
 Just out of interest why do people object to job adverts here? Seems
 harmless enough...
Wannabe list admins... Or list admins with a need to proof themselves... Or 
none of the above.

On 2012-03-13, Pedro H. G. Souto phgso...@gmail.com wrote:
 On 2012-03-13 12:44 PM, Paul Rudin wrote:
 Just out of interest why do people object to job adverts here?
 Seems harmless enough...

 Wannabe list admins... Or list admins with a need to proof
 themselves... Or none of the above.

A job listing here or there would fine. If the discussion were
clogged with them, it would be really annoying.

In addition, it's more efficient to post job listing in a place
where people looking for jobs can easily find them, and it's
annoying and useless to post them in a place where reader not
looking for jobs have to delete them.

-- 
Neil Cerutti

  Now the script runs fine but I don't get all arguments from sys.argv.
 
  No mather how many files I mark in the explorer I only get one as an
  argument.
 
 You're missing out vital information:
 
 * How have you attached this code to the context menu? What was
 the exact registry entry (or other method) you used?

From a quick Google search, it seems that most of the context menu
entries open a single file. If multiple 

Re: are int, float, long, double, side-effects of computer engineering?

2012-03-13 Thread John Nagle

On 3/7/2012 2:02 PM, Russ P. wrote:

On Mar 6, 7:25 pm, rusirustompm...@gmail.com  wrote:

On Mar 6, 6:11 am, Xah Leexah...@gmail.com  wrote:



I might add that Mathematica is designed mainly for symbolic
computation, whereas IEEE floating point numbers are intended for
numerical computation. Those are two very different endeavors. I
played with Mathematica a bit several years ago, and I know it can do
numerical computation too. I wonder if it resorts to IEEE floating
point numbers when it does.


   Mathematica has, for some computations, algorithms to determine the
precision of results.  This is different than trying to do infinite
precision arithmetic, which doesn't help as soon as you get to trig
functions.  It's about bounding the error.

   It's possible to do bounded arithmetic, where you carry along an
upper and lower bound on each number.  The problem is what to do
about comparisons.  Comparisons between bounded numbers are
ambiguous when the ranges overlap.  Algorithms have to be designed
to deal with that.  Mathematica has such algorithms for some
operations, especially numerical integration.

   It's a very real issue. I had to deal with this when I was
writing the first ragdoll physics system that worked right,
back in the 1990s.  Everybody else's system blew up on the hard
cases; mine just slowed down.  Correct integration over a force
function that's changing over 18 orders of magnitude is difficult,
but quite possible.

(Here it is, from 1997: http://www.youtube.com/watch?v=5lHqEwk7YHs;)
(A test with a heavy object:
http://www.youtube.com/watch?v=-DaWIHc1VLY;.  Most physics engines
don't do heavy objects well. Everything looks too light. We call
this the boink problem.)

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


[issue14284] unicodeobject error on macosx in build process

2012-03-13 Thread Hervé Coatanhay

New submission from Hervé Coatanhay herve.coatan...@gmail.com:

On a fresh install from mercurial on macosx.

./python -SE -m sysconfig --generate-posix-vars
Could not find platform dependent libraries exec_prefix
Consider setting $PYTHONHOME to prefix[:exec_prefix]
Assertion failed: (compact-utf8_length == 0), function 
_PyUnicode_CheckConsistency, file Objects/unicodeobject.c, line 369.
make: *** [Lib/_sysconfigdata.py] Abort trap: 6

This is reproduced with the following mercurial changesets:

changeset   reproduced
368a5d7d8a15no (3.2 branch)
fafe12f2a030no (3.2 branch)

4a5eafcdde11yes
6b8dd7724ec0yes
0df295d590a8yes
7e576ad85663yes (tip on default)

When compiled with pydebug I've got the following in gdb:

#0  0x7fff86c0282a in __kill ()
#1  0x7fff8e61aa9c in abort ()
#2  0x7fff8e64d5de in __assert_rtn ()
#3  0x0001000d5589 in _PyUnicode_CheckConsistency (op=0x101024c40, 
check_content=0) at unicodeobject.c:369
#4  0x0001000df567 in unicode_dealloc (unicode=0x101024c40) at 
unicodeobject.c:1503
#5  0x00010009f025 in _Py_Dealloc (op=0x101024c40) at object.c:1765
#6  0x00010019df6a in decode_unicode (c=0x7fff5fbf6d58, s=0x10087cc36 ois 
Pinard]\n\nHeaps are arrays for which a[k] = a[2*k+1] and a[k] = a[2*k+2] 
for\nall k, counting elements from 0.  For the sake of 
comparison,\nnon-existing elements are considered to be infinite.  Th..., 
len=4720, rawmode=0, encoding=0x1002c6710 utf-8) at ast.c:3759
#7  0x00010019e3c6 in parsestr (c=0x7fff5fbf6d58, n=0x10103a118, 
bytesmode=0x7fff5fbf6944) at ast.c:3829
#8  0x00010019e839 in parsestrplus (c=0x7fff5fbf6d58, n=0x10103a0d0, 
bytesmode=0x7fff5fbf6944) at ast.c:3874
#9  0x00010019597a in ast_for_atom (c=0x7fff5fbf6d58, n=0x10103a0d0) at 
ast.c:1869
#10 0x00010019744d in ast_for_power (c=0x7fff5fbf6d58, n=0x10103a088) at 
ast.c:2228
#11 0x000100197fa6 in ast_for_expr (c=0x7fff5fbf6d58, n=0x10103a088) at 
ast.c:2428
#12 0x000100198a11 in ast_for_testlist (c=0x7fff5fbf6d58, n=0x1007c1c90) at 
ast.c:2584
#13 0x000100198fbe in ast_for_expr_stmt (c=0x7fff5fbf6d58, n=0x10048b868) 
at ast.c:2680
#14 0x00010019d248 in ast_for_stmt (c=0x7fff5fbf6d58, n=0x10048b868) at 
ast.c:3600
#15 0x000100191530 in PyAST_FromNode (n=0x10048b280, flags=0x7fff5fbf6f60, 
filename=0x100794ee0 
/Users/herve/Documents/workspace/mercurial_repository/python-vanilla/Lib/heapq.py,
 arena=0x10051f8f0) at ast.c:760
#16 0x00010021b86f in PyParser_ASTFromFile (fp=0x7fff77c75140, 
filename=0x100794ee0 
/Users/herve/Documents/workspace/mercurial_repository/python-vanilla/Lib/heapq.py,
 enc=0x0, start=257, ps1=0x0, ps2=0x0, flags=0x7fff5fbf6f60, errcode=0x0, 
arena=0x10051f8f0) at pythonrun.c:1982
#17 0x0001001f6d04 in parse_source_module (pathname=0x1007a5320, 
fp=0x7fff77c75140) at import.c:1186
#18 0x0001001f822d in load_source_module (name=0x1007bd178, 
pathname=0x1007a5320, fp=0x7fff77c75140) at import.c:1509
#19 0x0001001fd345 in load_module (name=0x1007bd178, fp=0x7fff77c75140, 
pathname=0x1007a5320, type=1, loader=0x0) at import.c:2477
#20 0x0001002011f7 in import_submodule (mod=0x100340f80, 
subname=0x1007bd178, fullname=0x1007bd178) at import.c:3338
#21 0x0001001ffb97 in load_next (mod=0x100340f80, altmod=0x100340f80, 
inputname=0x1007bd178, p_outputname=0x7fff5fbf7350, p_prefix=0x7fff5fbf7338) at 
import.c:3149
#22 0x0001001fe5c7 in import_module_level (name=0x1007bd178, 
globals=0x10077cbe8, locals=0x10077cbe8, fromlist=0x100340f80, level=0) at 
import.c:2842
#23 0x0001001feb00 in PyImport_ImportModuleLevelObject (name=0x1007bd178, 
globals=0x10077cbe8, locals=0x10077cbe8, fromlist=0x100340f80, level=0) at 
import.c:2904
#24 0x00010019fd85 in builtin___import__ (self=0x100607420, 
args=0x10079e9f0, kwds=0x0) at bltinmodule.c:195
#25 0x000100096214 in PyCFunction_Call (func=0x100607510, arg=0x10079e9f0, 
kw=0x0) at methodobject.c:84
#26 0x000100010656 in PyObject_Call (func=0x100607510, arg=0x10079e9f0, 
kw=0x0) at abstract.c:2150
#27 0x0001001c597d in PyEval_CallObjectWithKeywords (func=0x100607510, 
arg=0x10079e9f0, kw=0x0) at ceval.c:3932
#28 0x0001001ba572 in PyEval_EvalFrameEx (f=0x10052f5d0, throwflag=0) at 
ceval.c:2332
#29 0x0001001c3681 in PyEval_EvalCodeEx (_co=0x1007b9dc0, 
globals=0x10077cbe8, locals=0x10077cbe8, args=0x0, argcount=0, kws=0x0, 
kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at ceval.c:3426
#30 0x0001001aaf0b in PyEval_EvalCode (co=0x1007b9dc0, globals=0x10077cbe8, 
locals=0x10077cbe8) at ceval.c:771
#31 0x0001001f2d62 in PyImport_ExecCodeModuleObject (name=0x10077b9e0, 
co=0x1007b9dc0, pathname=0x10060ed60, cpathname=0x10060ed60) at import.c:868
#32 0x0001001f820e in load_source_module (name=0x10077b9e0, 
pathname=0x1004bbbf8, fp=0x7fff77c750a8) at import.c:1505
#33 0x0001001fd345 in load_module (name=0x10077b9e0, fp=0x7fff77c750a8, 
pathname=0x1004bbbf8, type=1, loader=0x0) at 

[issue14284] unicodeobject error on macosx in build process

2012-03-13 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

See #13241.

--
nosy: +ezio.melotti
resolution:  - duplicate
stage:  - committed/rejected
status: open - closed
superseder:  - llvm-gcc-4.2 miscompiles Python (XCode 4.1 on Mac OS 10.7)

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



[issue14285] Traceback wrong on ImportError while executing a package

2012-03-13 Thread Marc Schlaich

New submission from Marc Schlaich marc.schla...@googlemail.com:

It is very simple to reproduce this error. 
There is an executable package:

package/
__init__.py
__main__.py

The __init__ imports a missing module:

import missing_module

And the __main__ imports from it:

from . import missing_module

Now I get the following output which is not what I am expecting:

C:\Python27\python.exe: No module named missing_module; 'package' is 
a package and cannot be directly executed

--
messages: 155574
nosy: ms4py
priority: normal
severity: normal
status: open
title: Traceback wrong on ImportError while executing a package
type: behavior
versions: Python 2.7

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



[issue14257] minor error in glossary wording regarding __hash__

2012-03-13 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 0f146020d8e9 by Senthil Kumaran in branch '3.2':
closes issue14257 - Grammatical fix
http://hg.python.org/cpython/rev/0f146020d8e9

New changeset c5833f277258 by Senthil Kumaran in branch 'default':
closes issue14257 - Grammatical fix
http://hg.python.org/cpython/rev/c5833f277258

New changeset f3c8bdbe2cf3 by Senthil Kumaran in branch '2.7':
closes issue14257 - Grammatical fix
http://hg.python.org/cpython/rev/f3c8bdbe2cf3

--
resolution:  - fixed
status: open - closed

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



[issue14246] Accelerated ETree XMLParser cannot handle io.StringIO

2012-03-13 Thread Stefan Behnel

Stefan Behnel sco...@users.sourceforge.net added the comment:

FWIW, lxml also has support for parsing Unicode strings. It doesn't encode the 
input, however, but parses straight from the underlying buffer (after detecting 
the buffer layout etc. at module init time - and yes, I still haven't fixed 
this up for PEP393).

There is one problem that I see with encoding it to UTF-8 first, even 
disregarding the obvious inefficiency in terms of both memory and processing 
time. At least for string parsing, lxml has an additional check in place that 
rejects Unicode string input containing an encoding declaration, because that 
would be very unlikely to match the buffer encoding on a given platform.

In your case, it would be good to have something similar, because when you get 
a Unicode string with, say, an ISO8859-1 encoding declaration, encoding it to 
UTF-8 and then passing that to pyexpat will silently generate incorrect content 
- unless you can safely enforce a specific encoding regardless of the 
declaration, don't know how expat handles this (you are clearly not handling it 
in your patch, which, I take it, only adapts the behaviour to what pyET 
currently does).

The problem here is that it's not so easy to do this for file-like objects, 
because they may return text that contains ?xml version='1.0', then a 
billion whitespace characters, and then encoding='latin1'?. The XML parser 
could handle this, but doing it in a preprocessing step would be some work.

In any case, silently returning broken data is not a good idea. Maybe it would 
work to check the encoding that the parser uses against the one we expect? If 
the parser switches encodings at some point even though we are sure it *must* 
be utf-8 (in whatever spelling), we can still raise an error at that point. 
I'll consider letting lxml do this check as well, it sounds more efficient than 
what it currently does.

--

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



[issue5758] fileinput.hook_compressed returning bytes from gz file

2012-03-13 Thread Tatiana Al-Chueyr

Tatiana Al-Chueyr tatiana.alchu...@gmail.com added the comment:

Improved patch, according to eric.araujo's suggestions and mnewman's guidance.

--
Added file: 
http://bugs.python.org/file24815/issue5758_fileinput_gzip_with_encoding_v2.patch

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



[issue12890] cgitb displays p tags when executed in text mode

2012-03-13 Thread Jeff McNeil

Jeff McNeil j...@jmcneil.net added the comment:

Did this ever get committed? Is there anything left for me to do here?

--

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



[issue14246] Accelerated ETree XMLParser cannot handle io.StringIO

2012-03-13 Thread Eli Bendersky

Eli Bendersky eli...@gmail.com added the comment:

Stefan,

Thanks a lot for taking the time to review the patch. As you correctly say, the 
current pathch's goal is just to align with existing behavior in the Python 
implementation of ET.

I understand the problem you are describing, but at least it's not a regression 
vs. previous behavior, while the original problem this issue complains about 
*is* a regression.

I propose to commit this to fix the regression and open a separate issue with 
the insight you provided. One easy solution could be to just require the 
encoding to be UTF-8 when passing unicode to the module, and to document it 
explicitly. Another solution would be to actually fix it in the module itself.

If there is a decision to fix it, the fix should then cover both the C and 
Python implementations, in all possible places (all functions reading XML from 
strings will also suffer from the same problem, since they get passed to 
xmlparse_Parse in pyexpat, which just uses PyArg_ParseTuple with the s# 
format - encoding unicode in utf-8 without looking at the XML encoding itself).

--

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



[issue1666318] shutil.copytree doesn't give control over directory permissions

2012-03-13 Thread Jeff McNeil

Jeff McNeil j...@jmcneil.net added the comment:

I made the change suggested in the last comment, patch is attached. Trying to 
clean up any bugs I've got my name on!

--
keywords: +patch
Added file: http://bugs.python.org/file24816/makedirs_function.patch

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



[issue14281] Add unit test for cgi.escape method

2012-03-13 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 757afb3af762 by Senthil Kumaran in branch '2.7':
Fix closes Issue14281 - Test for cgi.escape by Brian Landers
http://hg.python.org/cpython/rev/757afb3af762

New changeset 13922f6d87f2 by Senthil Kumaran in branch '3.2':
3.2 - Fix closes Issue14281 - Test for cgi.escape by Brian Landers
http://hg.python.org/cpython/rev/13922f6d87f2

New changeset 70712a806bdb by Senthil Kumaran in branch 'default':
merge to 3.3 - Fix closes Issue14281 - Test for cgi.escape by Brian Landers
http://hg.python.org/cpython/rev/70712a806bdb

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

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



[issue12365] URLopener should support context manager protocol

2012-03-13 Thread Jeff McNeil

Jeff McNeil j...@jmcneil.net added the comment:

Documentation patch to outline the use of context manager protocol attached. 
Trying to cleanup any bugs with my name on them.

--
keywords: +patch
Added file: http://bugs.python.org/file24817/urllib_request_doc.patch

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



[issue10050] urllib.request still has old 2.x urllib primitives

2012-03-13 Thread Jeff McNeil

Changes by Jeff McNeil j...@jmcneil.net:


--
nosy:  -mcjeff

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



[issue14262] Allow using decimals as arguments to `timedelta`

2012-03-13 Thread STINNER Victor

STINNER Victor victor.stin...@gmail.com added the comment:

The PEP 410 was rejected. See also the issue #13882.

--

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



[issue14273] distutils2: logging handler not properly initialized

2012-03-13 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

I cannot reproduce this, and in fact couldn't find anywhere in packaging in the 
default branch where a distutils2 logger is set up. I used grep to look for 
getLogger.*(distutils2|__name__), could some other logic be in use to 
construct the logger name?

Looking at packaging.run.main() - it calls Dispatcher(args), and any exception 
in Dispatcher.__init__() before the call to _set_logger could lead to a logging 
call being made before a handler is set up.

Suggestion: set the handler as early as possible, perhaps in main() where the 
other handlers logic is, and just set the level later (as that is the only 
thing that depends on verbosity settings passed in via command line flags).

A couple of things I don't quite understand:

1. Why are the packaging logger's handlers are saved and restored en masse - 
all that is happening is that a handler is being added in 
Dispatcher._set_logger, so it would seem to be enough to call removeHandler().

2. There should normally be no need to set both the logger's *and* and 
handler's level to the same value - if the event fails the logger's level test, 
it will not be passed to handlers anyway. In packaging code I found no 
reference to any other loggers than packaging - i.e. no child loggers whose 
events might need to be blocked at the handler level.

--

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



[issue1429] FD leak in SocketServer

2012-03-13 Thread Jeff McNeil

Jeff McNeil j...@jmcneil.net added the comment:

In an effort to walk through bugs in my nosy list, I dug into this and tried to 
reproduce it to no avail. 

Also, as the handle_error method is supposed to handle problems gracefully, 
calling shutdown on handle_error exception is probably questionable. I'd be 
happy to submit a patch to do just that if those smarter than I think it is 
worthwhile, but I don't so much believe it is.

--

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



[issue14272] ast.c: windows compile error

2012-03-13 Thread Stefan Krah

Stefan Krah stefan-use...@bytereef.org added the comment:

Looks fixed in 6bee4eea1efa.

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

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



[issue14262] Allow using decimals as arguments to `timedelta`

2012-03-13 Thread Ram Rachum

Ram Rachum r...@rachum.com added the comment:

I'm not proposing that `timedelta` will use `Decimal` internally, but that it 
would handle the conversion to `float` itself, instead of the user having to do 
it.

--

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



[issue14286] xxlimited.obj: unresolved external symbol __imp__PyObject_New

2012-03-13 Thread Stefan Krah

New submission from Stefan Krah stefan-use...@bytereef.org:

Linking fails on Windows 64-bit. Perhaps Py_LIMITED_API ifdefs
are missing.

   Creating library C:\Users\stefan\hg\cpython\PCbuild\\amd64\\xxlimited.lib 
and object C:\Users\stefan\hg\c
python\PCbuild\\amd64\\xxlimited.exp

xxlimited.obj : error LNK2001: unresolved external symbol __imp__PyObject_New   

xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyType_FromSpec 

xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyDict_New  

xxlimited.obj : error LNK2001: unresolved external symbol 
__imp_PyDict_DelItemString
xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyDict_GetItem  

xxlimited.obj : error LNK2001: unresolved external symbol 
__imp_PyObject_GenericGetAttr 
xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyUnicode_Type  

xxlimited.obj : error LNK2001: unresolved external symbol 
__imp_PyExc_AttributeError
xxlimited.obj : error LNK2001: unresolved external symbol __imp__Py_NoneStruct  

xxlimited.obj : error LNK2001: unresolved external symbol 
__imp_PyArg_ParseTuple
xxlimited.obj : error LNK2001: unresolved external symbol 
__imp__Py_NotImplementedStruct
xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyObject_Free   

xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyErr_SetString 

xxlimited.obj : error LNK2001: unresolved external symbol 
__imp_PyModule_Create2
xxlimited.obj : error LNK2001: unresolved external symbol 
__imp_PyErr_NewException  
xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyLong_FromLong 

xxlimited.obj : error LNK2001: unresolved external symbol 
__imp_PyBaseObject_Type   
xxlimited.obj : error LNK2001: unresolved external symbol 
__imp_PyType_GenericNew   
xxlimited.obj : error LNK2001: unresolved external symbol 
__imp_PyModule_AddObject  
xxlimited.obj : error LNK2001: unresolved external symbol 
__imp_PyDict_SetItemString
C:\Users\stefan\hg\cpython\PCbuild\\amd64\\xxlimited.pyd : fatal error LNK1120: 
20 unresolved externals

--
components: Build
messages: 155588
nosy: brett.cannon, skrah
priority: normal
severity: normal
stage: needs patch
status: open
title: xxlimited.obj: unresolved external symbol __imp__PyObject_New
type: compile error
versions: Python 3.3

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



[issue1762561] unable to serialize Infinity or NaN on ARM using marshal

2012-03-13 Thread Nir Soffer

Nir Soffer nir...@gmail.com added the comment:

As someone who has to develop on ARM OABI, I find this won't fix policy rather 
frustrating.

If you happen to need this patch on 2.7, this is the same patch as 
arm-float2.diff, which can be applied cleanly to release 2.7.2.

Changes from arm-float2.diff:
- Remove whitespace only changes
- Replace tabs with spaces
- Fixed indentation in changed code

Enjoy.

--
nosy: +nirs
Added file: http://bugs.python.org/file24818/arm-oabi-float-2.7.patch

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



[issue13889] str(float) and round(float) issues with FPU precision

2012-03-13 Thread Stefan Krah

Stefan Krah stefan-use...@bytereef.org added the comment:

I've looked at the latest patch: It seems that new_387controlword is
not set if old_387controlword already has the desired precision and
rounding mode.

Attached is a revised patch that uses the same logic as the Linux
version. A couple of remarks:

  - It would be possible to negate (_PC_53|_RC_NEAR) instead of
enumerating (_MCW_DN|_MCW_EM|_MCW_IC). I found it nice to
see all possibilities listed.

  - Technically we might need to use #pragma fenv_access (on). I'm not sure
where though: If it is set in pyport.h, VS complains that Py_MATH_PI / 180.0
is not constant.


The patch is tested on win32/x64. Additionally, the patch is tested
with setting the rounding mode to _PC_64 in main.c. Then, the
patch is tested with replacing the 'if' bodies by 'abort()'. This
shows that in the regular build (_PC_53 on startup) the bodies of
the if statements are never executed.

Finally, inserting an #error after #if defined(_MSC_VER)  !defined(_WIN64)
on the x64 build shows that !defined(_WIN64) really does its job.

--
Added file: http://bugs.python.org/file24819/issue13889.diff

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



[issue10945] bdist_wininst depends on MBCS codec, unavailable on non-Windows

2012-03-13 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

The proposition of using other C functions and changing the bdist_wininst code 
looks risky to me, especially as I don’t know how compatibility would be 
affected (see my previous message).  We are free to improve the wininst code in 
distutils2, or discuss a replacement (Jeremy Kloth was working on something 
with all the features of MSI and wininst), but for distutils I would very much 
prefer the simplest fix that could possibly works.

bdist_msi decodes data read from setup.py with MBCS on Windows; on other OSes, 
couldn’t the locale preferred encoding be used?

--
priority: high - normal

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



[issue8954] wininst regression: errors when building on linux

2012-03-13 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Sean: In msg135902 I am merely explaining why I removed 2.6 from the list of 
versions.  Only 2.7, 3.2 and 3.3 can get fixed.

If you look at my previous message or the list of dependencies, you can see 
that #10945 needs to be fixed first before I can review the patch provided for 
this issue.

--
components: +Distutils2
nosy: +alexis
priority: critical - normal
versions: +3rd party, Python 3.3 -Python 3.1

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



[issue14260] re.groupindex available for modification and continues to work, having incorrect data inside it

2012-03-13 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

 I can get code from anywhere
I am afraid I don’t understand.  Could you start again and explain what bug you 
ran into, i.e. what behavior does not match what the docs say?  At present this 
report looks like it is saying “when I put random things in an internal data 
structures then bad things happen”, and I don‘t think Python promises to not 
break when people do random editions to internal data structures.

--

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



[issue14282] lib2to3.fixer_util.touch_import('__future__', ...) can lead to SyntaxError in code

2012-03-13 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

I think that's actually a bug in python-modernize, not in touch_import - or, 
rather, touch_import shouldn't be used to add future imports.

Instead, I think there should be a touch_future function which adds a future 
import, taking into account that future imports need to go before all other 
imports, but after a possible docstring.

--
nosy: +loewis

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



[issue5758] fileinput.hook_compressed returning bytes from gz file

2012-03-13 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Thanks.  Unless another core dev wants to do a complementary review I will 
slightly tweak the patch and commit it.  I need to finish waking up and eat 
some food before I do that :)

Technically adding a new argument means that this is a new feature and cannot 
be applied to the stable 3.2 version, but something needs to be done for this 
bug in 3.2 too, like a recipe in the docs for a hook_compressed that returns 
strings (i.e. a function that calls fileinput.hook_compressed and wraps it in a 
TextIOWrapper), or at least a note to warn about this bug.

--
assignee:  - eric.araujo
versions: +Python 3.3 -Python 3.1

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



[issue12890] cgitb displays p tags when executed in text mode

2012-03-13 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

I’ll apply it shortly.

--
assignee:  - eric.araujo

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



[issue14267] TimedRotatingFileHandler chooses wrong file name due to daylight saving time spring forward

2012-03-13 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset a5c4b8ccca8b by Vinay Sajip in branch '2.7':
Closes #14267: Corrected computation of rollover filename.
http://hg.python.org/cpython/rev/a5c4b8ccca8b

New changeset a1d9466441ff by Vinay Sajip in branch '3.2':
Closes #14267: Corrected computation of rollover filename.
http://hg.python.org/cpython/rev/a1d9466441ff

New changeset 30fe8a62046e by Vinay Sajip in branch 'default':
Closes #14267: Merged fix from 3.2.
http://hg.python.org/cpython/rev/30fe8a62046e

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

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



[issue14202] The docs of xml.dom.pulldom are almost nonexistent

2012-03-13 Thread Eli Bendersky

Eli Bendersky eli...@gmail.com added the comment:

I reviewed the patch in http://bugs.python.org/review/14202/show

--

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



[issue13885] CVE-2011-3389: _ssl module always disables the CBC IV attack countermeasure

2012-03-13 Thread Tomas Hoger

Tomas Hoger tho...@redhat.com added the comment:

Is the final patch going to enable empty fragments unconditionally and will 
ofter no way to disable them?

curl did that recently and ended up adding option to allow users to disable 
empty fragments when they break compatibility:

http://curl.haxx.se/docs/adv_20120124B.html
http://thread.gmane.org/gmane.comp.web.curl.library/34659
http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTSSLOPTIONS
http://curl.haxx.se/docs/manpage.html#--ssl-allow-beast

--
nosy: +thoger

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



[issue14180] Factorize code to convert int/float to time_t, timeval or timespec

2012-03-13 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 1e9cc1a03365 by Victor Stinner in branch 'default':
Close #14180: Factorize code to convert a number of seconds to time_t, timeval 
or timespec
http://hg.python.org/cpython/rev/1e9cc1a03365

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

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



[issue14180] Factorize code to convert int/float to time_t, timeval or timespec

2012-03-13 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset ed73006bac42 by Victor Stinner in branch 'default':
Issue #14180: Remove commented code
http://hg.python.org/cpython/rev/ed73006bac42

--

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



[issue14262] Allow using decimals as arguments to `timedelta`

2012-03-13 Thread STINNER Victor

STINNER Victor victor.stin...@gmail.com added the comment:

Attached patch changes timedelta constructor to accept decimal.Decimal.

See also the issue #14180.

--
keywords: +patch
Added file: http://bugs.python.org/file24820/timedelta_decimal.patch

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



[issue10945] bdist_wininst depends on MBCS codec, unavailable on non-Windows

2012-03-13 Thread STINNER Victor

STINNER Victor victor.stin...@gmail.com added the comment:

 Would the proposed change mean that a bdist_wininst built
 with 3.2.0 won’t work with a patched 3.2.3?

The installer doesn't use distutils to read its configuration, so such binary 
runs with any installed Python version.

 bdist_msi decodes data read from setup.py with MBCS on Windows;
 on other OSes, couldn’t the locale preferred encoding be used?

It would be worse: Linux doesn't use Windows code page. Most modern OSes are 
now using UTF-8 locale encoding, whereas Windows never use UTF-8 as the ANSI 
code page.

--

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



[issue10148] st_mtime differs after shutil.copy2

2012-03-13 Thread STINNER Victor

STINNER Victor victor.stin...@gmail.com added the comment:

This issue is a duplicate of #14127.

--
nosy: +haypo
resolution:  - duplicate
status: open - closed

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



[issue14127] os.stat and os.utime: allow preserving exact metadata

2012-03-13 Thread STINNER Victor

STINNER Victor victor.stin...@gmail.com added the comment:

I'm lost in all issues related to os.stat/utime and nanosecond, here is a list:
 - #10148: duplicate
 - #11457: closed (was related the the rejected PEP 410)
 - #12904: closed, it was the first step to fix os.stat/os.utime
 - #13882: closed (implementation of the PEP 410)
 - #13964: duplicate
 - #14127: this issue, open :-)

--
nosy: +eric.araujo, maubp, python-dev, shaurz

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



[issue13964] os.utimensat() and os.futimes() should accept (sec, nsec), drop os.futimens()

2012-03-13 Thread STINNER Victor

STINNER Victor victor.stin...@gmail.com added the comment:

This issue is a duplicate of #14127.

--
resolution:  - duplicate
status: open - closed

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



[issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-03-13 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
title: os.stat and os.utime: allow preserving exact metadata - add st_*time_ns 
fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a 
number of nanoseconds

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



[issue14282] lib2to3.fixer_util.touch_import('__future__', ...) can lead to SyntaxError in code

2012-03-13 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

Instead of changing touch_import, I propose to add a function similar to

https://github.com/loewis/python-modernize/commit/0db885e616807d0cc6859b4035d81fd260b06a67

--

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



[issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-03-13 Thread STINNER Victor

STINNER Victor victor.stin...@gmail.com added the comment:

The following changes has to be done to fix this issue:

 - add st_atime_ns, st_mtime_ns and st_ctime_ns fileds to os.stat() result: 
number of nanoseconds since Epoch (1970.1.1), an integer
 - change os.*utime*() functions (see below)
 - shutil.copystat() should use os.utime(ns=...) and os.ltime(ns=...)

List of the os.*utime*() functions:

 - os.futimes(): use futimens() or futimes()
 - os.futimens(): use futimens(); UTIME_NOW and UTIME_OMIT flags
 - os.futimesat(): use utimensat() or futimesat()
 - os.lutimes(): use futimesat(AT_SYMLINK_NOFOLLOW) or lutimes()
 - os.utime(): use SetFileTime() (Windows), utimensat(), utimes() or utime()
 - os.utimensat(): use utimensat(); UTIME_NOW and UTIME_OMIT flags

Changes on the os.*utime*() functions:

 - add ns keyword to:

   * os.futimes()
   * os.futimesat()
   * os.lutimes()
   * os.utime()

 - except a number of nanoseconds instead of a number of seconds:

   * os.futimens()
   * os.utimensat()

The ns keyword is an exclusive parameter with existing times parameter. 
Examples:

   * seconds: os.utime(name, (1, 2))
   * seconds: os.utime(name, times=(1, 2))
   * nanoseconds: os.utime(name, ns=(1, 2))
   * INVALID! os.utime(name, (1, 2), ns=(1, 2))
   * INVALID! os.utime(name, times=(1, 2), ns=(1, 2))

I don't want to remove os.futimens() and os.utimensat() because they add a 
feature: UTIME_NOW and UTIME_OMIT flags.

--

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



[issue14262] Allow using decimals as arguments to `timedelta`

2012-03-13 Thread Ram Rachum

Ram Rachum r...@rachum.com added the comment:

Thanks for the patch!

--

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



[issue13889] str(float) and round(float) issues with FPU precision

2012-03-13 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

BTW, the MSDN documentation at

http://msdn.microsoft.com/en-us/library/e9b52ceh(v=vs.100).aspx

is a bit confusing.  Question 1:  when doing __control87_2(new, mask, old, 
NULL), does the resulting value in old reflect the *new* FPU state or the old 
one?

Question 2:  in the example near the bottom of that page, there's code like:

control_word_x87 = __control87_2(_PC_24, MCW_PC,
 control_word_x87, 0);

This looks very odd: we're assigning to control_word_x87, *and* passing it as 
an output parameter to the call.  Moreover, from the documentation  the return 
value from __control87_2 is always 1 to indicate success, so I'm not sure why 
it's being assigned to control_word_x87.

Am I the only person who's confused by this?

--

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



[issue14217] text output pretends to be code

2012-03-13 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

This issue does not apply to 2.7 docs because they lack the local/nonlocal 
assignment example; do you agree it would be good to backport that?

Tshepang, if you find more instances of the same problem, please report them.  
Thanks!

--

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



[issue14287] sys.stdin.readline and KeyboardInterrupt on windows

2012-03-13 Thread Musashi Tamura

New submission from Musashi Tamura yuri.musashi.miwa.tam...@gmail.com:

I run z.py and press Ctrl-C. 

''
Traceback (most recent call last):
  File z.py, line 7, in module
print(repr(x))
KeyboardInterrupt

I think '' should not be printed. This sometimes occurs on Python 3.2.2 and 
2.7.2 AMD64 on Windows7, but doesn't occur on ubuntu.

--
components: Windows
files: z.py
messages: 155612
nosy: miwa
priority: normal
severity: normal
status: open
title: sys.stdin.readline and KeyboardInterrupt on windows
type: behavior
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file24821/z.py

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



[issue1666318] shutil.copytree doesn't give control over directory permissions

2012-03-13 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Patch looks good.

I don’t know if I should fix this in 3.3 with your patch or go back to the 
first idea of adding a copystat(src, dst) after the mkdir call.  I just don’t 
know if it’s important that this behavior does not change in stable versions, 
or if it’s clearly a bug and we can change it.

--

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



[issue14273] distutils2: logging handler not properly initialized

2012-03-13 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

We didn’t give enough info, sorry.  This bug is not reproducible with 
packaging, it only shows when using the distutils2 repository with Python 2.5, 
2.6 or 3.1.  I think it’s related to the absence of built-in handler of last 
resort.

(packaging’s logger is named “packaging” and d2’s is “distutils2”, that’s why 
your grep did not find it.  This is one of the few differences between both 
codebases that I will fix before the betas.)

 Looking at packaging.run.main() - it calls Dispatcher(args), and any 
 exception in Dispatcher.__init__()
 before the call to _set_logger could lead to a logging call being made before 
 a handler is set up.
 Suggestion: set the handler as early as possible, perhaps in main() where the 
 other handlers logic is, and
 just set the level later (as that is the only thing that depends on verbosity 
 settings passed in via
 command line flags).
Thanks, I will try that!

 1. Why are the packaging logger's handlers are saved and restored en masse - 
 all that is happening is that
 a handler is being added in Dispatcher._set_logger, so it would seem to be 
 enough to call removeHandler().
Tarek added that in d53e813ffe58 to fix regrtest warnings about test_packaging 
modifying logging._handlers.

 2. There should normally be no need to set both the logger's *and* and 
 handler's level to the same value -
 if the event fails the logger's level test, it will not be passed to handlers 
 anyway. In packaging code I
 found no reference to any other loggers than packaging - i.e. no child 
 loggers whose events might need to
 be blocked at the handler level.
Yes, the whole package only uses one logger, and we don’t want to stop 
messages: the application (pysetup, pip, etc.) must be able to set the level.  
I’ll remove the code that sets a level on the logger and write a test to make 
sure that a client can get all messages.

--
priority: high - normal

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



[issue12365] URLopener should support context manager protocol

2012-03-13 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Thanks for the patch.
 
-   This function returns a file-like object with two additional methods from
+   This function returns a file-like object that supports the Context Manager 
+   protocol, with two additional methods from

The capitalization seems unneeded to me.  Also, in my opinion saying 
“file-like” implies support for the context manager protocol, even if not all 
file-likes do, and anyway not all users share my assumption.  What do you think 
about this wording:

This function returns a file-like object that works as a :term:`context 
manager`
and has two additional methods from the :mod:`urllib.response` module

The term role creates a link to the glossary.  (BTW the entry for context 
manager could be improved to give open as example; I’ll do that.)

+It is also possible to achieve the same result using a context manager
+approach. ::

I would rather use with statements everywhere, or if it makes sense to have 
examples both with and without with, to put the example with with first.

--

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



[issue14180] Factorize code to convert int/float to time_t, timeval or timespec

2012-03-13 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 1eaf6e899f02 by Victor Stinner in branch 'default':
Issue #14180: Fix select.select() compilation on BSD and a typo in 
kqueue_queue_control()
http://hg.python.org/cpython/rev/1eaf6e899f02

--

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



[issue13889] str(float) and round(float) issues with FPU precision

2012-03-13 Thread Stefan Krah

Stefan Krah stefan-use...@bytereef.org added the comment:

Mark Dickinson rep...@bugs.python.org wrote:
 http://msdn.microsoft.com/en-us/library/e9b52ceh(v=vs.100).aspx
 Question 1:  when doing __control87_2(new, mask, old, NULL), does the
 resulting value in old reflect the *new* FPU state or the old one?

The new one, but I had to test that manually (see below).

 Question 2:  in the example near the bottom of that page, there's code like:
 
 control_word_x87 = __control87_2(_PC_24, MCW_PC,
  control_word_x87, 0);
 
 This looks very odd: we're assigning to control_word_x87, *and* passing it as 
 an output parameter to the call.  Moreover, from the documentation  the 
 return value from __control87_2 is always 1 to indicate success, so I'm not 
 sure why it's being assigned to control_word_x87.
 
 Am I the only person who's confused by this?

I was confused as well. I'm positive that it's a cut-and-paste bug in the docs:
Probably they had _control87() in that place before, which *does* return the
new control word. As you say, the example above clobbers the value that was set
via the pointer reference, so the result is always 1. :)

--

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



[issue5758] fileinput.hook_compressed returning bytes from gz file

2012-03-13 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

For 3.2 could we use the same fix, but without exposing the ability to *change* 
the encoding?  That is, we use TextIOWrapper but always with the default None 
for encoding.

It also occurs to me that this really exposes a weakness in the design.  What 
if the user wants to specify other open parameters?  I wonder if we should say 
that for better future-proofing openhooks should always take **kw.  You could 
even envision fileinput accepting **kw and passing them along to the openhook.  
I think charset is the most important open paramenter in this context, though, 
so I don't think we have to solve the general problem in this fix.

--

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



[issue13889] str(float) and round(float) issues with FPU precision

2012-03-13 Thread Stefan Krah

Stefan Krah stefan-use...@bytereef.org added the comment:

Stefan Krah rep...@bugs.python.org wrote:
 
 Stefan Krah stefan-use...@bytereef.org added the comment:
 
 Mark Dickinson rep...@bugs.python.org wrote:
  http://msdn.microsoft.com/en-us/library/e9b52ceh(v=vs.100).aspx
  Question 1:  when doing __control87_2(new, mask, old, NULL), does the
  resulting value in old reflect the *new* FPU state or the old one?
 
 The new one, but I had to test that manually (see below).

Well of course, unless both new and mask are 0, in which case it's
the existing state.

--

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



[issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-03-13 Thread Guido van Rossum

Guido van Rossum gu...@python.org added the comment:

Larry, are you sprinting on this? I'd love to help.

--

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



[issue14273] distutils2: logging handler not properly initialized

2012-03-13 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

 Yes, the whole package only uses one logger, and we don’t want to stop 
 messages: 

 the application (pysetup, pip, etc.) must be able to set the level.  I’ll 
 remove 
 the code that sets a level on the logger and write a test to make sure that a 
 client can get all messages.

I think you might mean sets a level on the handler - the logger should still 
have the level set, I think.

--

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



[issue5758] fileinput.hook_compressed returning bytes from gz file

2012-03-13 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

It also occurs to me that this fix makes the charset hook look rather odd.  We 
could render it redundant by passing charset to open in the non-openhook case, 
and mark it deprecated.

There is also a bug in the hook_encoding docs.  It says the file is opened with 
codecs.open, but that is not the case, regular open is used.

--

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



[issue14273] distutils2: logging handler not properly initialized

2012-03-13 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

 I think you might mean sets a level on the handler - the logger should 
 still have the level set
IIUC the logger should be set to DEBUG, otherwise even if e.g. pip wants to get 
INFO messages it won’t see them.  Is that right?

--

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



[issue5758] fileinput.hook_compressed returning bytes from gz file

2012-03-13 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

 For 3.2 could we use the same fix, but without exposing the ability to 
 *change* the encoding?
 That is, we use TextIOWrapper but always with the default None for encoding.
Yes!

 It also occurs to me that this really exposes a weakness in the design.  What 
 if the user wants to
 specify other open parameters?  I wonder if we should say that for better 
 future-proofing openhooks
 should always take **kw.  You could even envision fileinput accepting **kw 
 and passing them along
 to the openhook.  I think charset is the most important open paramenter in 
 this context, though, so
 I don't think we have to solve the general problem in this fix.
I concur.  I’ve never had to care about buffering for example, but mode is 
another parameter of open that people may want to give.  I’ll commit the 
minimal fix to 3.2 and merge in 3.3, and then we can discuss on a new RFE bug 
about adding encoding vs. **kwargs for 3.3.

Agreed on deprecating the charset hook when it becomes redundant.

Will fix the doc bug about codecs.open too.

--

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



[issue14180] Factorize code to convert int/float to time_t, timeval or timespec

2012-03-13 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset cb1c877a27f2 by Victor Stinner in branch 'default':
Issue #14180: Fix another typo in kqueue_queue_control()
http://hg.python.org/cpython/rev/cb1c877a27f2

--

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



[issue14288] Make iterators pickleable

2012-03-13 Thread Kristján Valur Jónsson

New submission from Kristján Valur Jónsson krist...@ccpgames.com:

A common theme in many talks last year about cloud computing was the need to 
suspend execution, pickle state, and resume it on a different node.  This patch 
is the result of last year's stackless sprint at pycon, finally completed and 
submitted for review.

Python does not currently support pickling of many run-time structures, but 
pickling for things like iterators is trivial.
A large piece of Stackless' branch is to make sure that various run-time 
constructs are pickleable, including function objects.  While this patch does 
not do that, it does add pickling for dictiter, and the lot.
This makes it possible to have compilcated data sets, iterate through them, and 
pickle them in a semi-consumed state.

Please note that a slight hack is needed to pickle some iterators.  Many of 
these classes are namely hidden and there is no way to access their 
constructors by name.  instead, an unpickling trick is to invoke iter on an 
object of the target type instead.  Not the most elegant solution but I didn't 
want to complicate matters by adding iterator classes into namespaces.  Where 
should stringiter live for example?  Be a builtin like str?

We also didn't aim to make all iterators copy.copy-able using the __reduce__ 
protocol.  Some iterators actually use internal iterators themselves, and if a 
(non-deep) copy were to happen, we would have to shallow copy those internal 
objects.  Instead, we just return the internal iterator object directly from 
__reduce__ and allow recursive pickling to proceed.

--
files: pickling.patch
keywords: patch
messages: 155626
nosy: krisvale, loewis, michael.foord
priority: normal
severity: normal
status: open
title: Make iterators pickleable
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file24822/pickling.patch

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



[issue14262] Allow using decimals as arguments to `timedelta`

2012-03-13 Thread Alexander Belopolsky

Alexander Belopolsky alexander.belopol...@gmail.com added the comment:

I am -0 on the feature and -1 on the implementation.  Conversion from Decimal 
to float is explicit by design.  Decimal gives the user fine control over 
rounding issues allowing for either exact arithmetics (trapping inexact 
operation) or one of several rounding modes.

This said, timedelta(decimal) is not much worse than float(decimal), so I 
will be only -0 if the implementation is such that (1) timedelta(decimal) 
does no loose precision over the entire range of timedelta and rounding is 
documented; and (2) implementaton does not require an explicit import decimal 
inside the datetime  module.

--
type:  - enhancement

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



[issue1666318] shutil.copytree doesn't give control over directory permissions

2012-03-13 Thread Jeff McNeil

Jeff McNeil j...@jmcneil.net added the comment:

Ah, understood. I kind of like the idea of having the added functionality 
behind a custom callable, but if it's generally just a bug then copystat is a 
good solution, too.

--

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



[issue14062] UTF-8 Email Subject problem

2012-03-13 Thread Tatiana Al-Chueyr

Tatiana Al-Chueyr tatiana.alchu...@gmail.com added the comment:

Hi msladek!

I tried to reproduce your bug using Python 3.2.2 on MacOS X, but didn't manage 
- all worked fine. I used gmail both to send and receive the message, on SSL:
smtpPort = '465'
smtpSrv = 'smtp.gmail.com'

As I'm no SMPTP nor email expert, I asked r.david.murray to review the email 
message code received and it looks fine.

Could you provide a smaller example of code that causes the same problem?

I just extracted your code to help other people trying to reproduce the bug. It 
is attached.

--
nosy: +tati_alchueyr
Added file: http://bugs.python.org/file24823/issue14062_buggy_email_subject.py

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



[issue8536] Support new features of ZLIB 1.2.4

2012-03-13 Thread Jason Killen

Jason Killen jsnk...@gmail.com added the comment:

Given this is marked as good for a newbie and easy I figured I'd take a crack 
at it but I'm confused.  As example I don't see where inflateReset2 would be 
useful.  I don't see anywhere inflateReset is used and would need to be 
replaced by inflateReset2.  I also don't see where the action of inflateReset2 
(End then Init) is currently used.  What am I missing?

--
nosy: +Jason.Killen

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



[issue14180] Factorize code to convert int/float to time_t, timeval or timespec

2012-03-13 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 760cf150bb99 by Victor Stinner in branch 'default':
Issue #14180: Fix pythoncore.vcproj, Modules/_time.[ch] have been removed
http://hg.python.org/cpython/rev/760cf150bb99

--

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



[issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-03-13 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

 I don't want to remove os.futimens() and os.utimensat() because they add a 
 feature: UTIME_NOW and UTIME_OMIT flags.

I'm not sure how this could work: UTIME_NOW and UTIME_OMIT have 
typically values such as ((1l  30) - 2l) which could be mistaken
as a time stamp if there is a flat nanosecond value.

There would be ways to solve this, of course: not passing the
value should be considered as UTIME_OMIT, and passing -1 may
be treated as UTIME_NOW.

--
title: add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), 
os.*utimens*() expects a number of nanoseconds - add st_*time_ns fileds to 
os.stat(),  add ns keyword to os.*utime*(), os.*utimens*() expects a number 
of nanoseconds

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



  1   2   3   >