Re: Python deadlock using subprocess.popen and communicate

2011-09-23 Thread Nobody
On Thu, 22 Sep 2011 11:19:28 -0700, Atherun wrote:

 I suggest obtaining a copy of Process Explorer, and using it to
 investigate the state of both processes (but especially the child) at the
 point that the deadlock seems to occur.
 
 In the one case I can easily reproduce, its in a p4.exe call that I'm
 making both python and p4.exe have nearly the same stack for their
 threads:
 python:

 kernel32.dll!WaitForSingleObject+0x12
 python26.dll!_Py_svnversion+0xcf8

I haven't a clue how this happens. _Py_svnversion just returns a string:

_Py_svnversion(void)
{
/* the following string can be modified by subwcrev.exe */
static const char svnversion[] = SVNVERSION;
if (svnversion[0] != '$')
return svnversion; /* it was interpolated, or passed on command line */
return Unversioned directory;
}

It doesn't even 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python deadlock using subprocess.popen and communicate

2011-09-23 Thread Chris Angelico
On Fri, Sep 23, 2011 at 3:59 PM, Nobody nob...@nowhere.com wrote:
 It doesn't even


You intrigue me, sir. Does it odd?

What is the remainder of this aborted sentence?

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


TestFixtures 2.0.0 Released!

2011-09-23 Thread Chris Withers

Hi All,

I'm happy to announce a new release major release of TestFixtures.
This release is 99% backwards compatible, but a lot has changed under 
the hood and there's some major new functionality, so thought it was 
time for a bump.


The big changes are:

- compare now uses a registry of comparers in the same way that
  unitest2's assertEquals does. You can register your own globally,
  register the default comparers for your own types and use a specific
  registry for a specific call to compare.

- The handling of timezones has been reworked in `test_datetime` again.
  (did anyone ever mention that timezones are hard ;-) )
  It feels more intuitive now, but it is backwards incompatible in
  the case where the `tzinfo` parameter to the `test_datetime`
  constructor was used.

  For details, read:

  http://packages.python.org/testfixtures/datetime.html#timezones

The full list of changes can be found here:

http://packages.python.org/testfixtures/changes.html

The package is on PyPI and a full list of all the links to docs, issue 
trackers and the like can be found here:


http://www.simplistix.co.uk/software/python/testfixtures

cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python 2.5 zlib trouble

2011-09-23 Thread Steven D'Aprano
Jesramz wrote:

 Hello,
 
 I am trying to deploy an app on google app engine using bottle, a
 micro-framework, similar to flask.
[...]
 ImportError: No module named zlib


What happens if you explicitly launch Python2.5 and then try to import zlib?



-- 
Steven

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


extending class

2011-09-23 Thread Andrea Crotti
I wanted to add a couple of parameters to a class from a given library 
(paste-script), but without changing the original code.
So I thought, I create a wrapper class which adds what I need, and then 
dispatch all the calls to the super class.


My following attempt gives, however, a recursion error, but why?

class PSIVar(object):
Extend var implementation from the paste-script, to add the
ability of correlating variables
 v = var(name, desc)
 v.name == 'name'
True
 v1 = PSIVar(v)
 v1.name == 'name'
True

def __init__(self, first_var, other=None, fun=None):
# this is of type defined there
self.first_var = first_var
if other is not None:
self.other = other
self.fun = fun
assert callable(self.fun)

# now try to dispatch every method call to the other class
# must probably call the super class
def __getattribute__(self, attr):
return self.first_var.__getattribute__(attr)

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


Re: Python Mixins

2011-09-23 Thread Duncan Booth
Matt mattj.morri...@gmail.com wrote:

 I'm curious about what people's opinions are about using mixins in
 Python. I really like, for example, the way that class based views
 were implemented in Django 1.3 using mixins. It makes everything
 extremely customizable and reusable. I think this is a very good
 practice to follow, however, in Python mixins are achieved by using
 (or perhaps misusing) inheritance and often multiple inheritance.
 

I think Mixins are great, in moderation, but wait until you have to debug 
code on an object with 70 base classes.

Reinout van Rees wrote a very insightful article recently about Django's 
use of multiple inheritance:

http://reinout.vanrees.org/weblog/2011/08/23/class-based-views.html

He points out the problems that arise from overuse of mixins; why Zope went 
through so much upheaval to get away from mixins everywhere and switched to 
a component architecture instead; and suggests that Django will do the same 
in a few years time.


-- 
Duncan Booth http://kupuguy.blogspot.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: extending class

2011-09-23 Thread Peter Otten
Andrea Crotti wrote:

 I wanted to add a couple of parameters to a class from a given library
 (paste-script), but without changing the original code.
 So I thought, I create a wrapper class which adds what I need, and then
 dispatch all the calls to the super class.
 
 My following attempt gives, however, a recursion error, but why?

Inside __getattribute__() you ask for self.first_var which triggers another 
__getattribute__() call that once again trys to determine the first_var 
attribute before it returns...

Try using __getattr__() instead which is only triggered for non-existent 
attributes 

def __getattr__(self, name):
return getattr(self.first_var, name)

or check for the attributes you don't want to delegate explicitly:

def __getattribute__(self, name):
if name == first_var:
return super(PSIVar, self).__getattribute__(name)
return getattr(self.first_var, name)

 class PSIVar(object):
  Extend var implementation from the paste-script, to add the
  ability of correlating variables
   v = var(name, desc)
   v.name == 'name'
  True
   v1 = PSIVar(v)
   v1.name == 'name'
  True
  
  def __init__(self, first_var, other=None, fun=None):
  # this is of type defined there
  self.first_var = first_var
  if other is not None:
  self.other = other
  self.fun = fun
  assert callable(self.fun)
 
  # now try to dispatch every method call to the other class
  # must probably call the super class
  def __getattribute__(self, attr):
  return self.first_var.__getattribute__(attr)


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


Re: extending class

2011-09-23 Thread Andrea Crotti

On 09/23/2011 10:31 AM, Peter Otten wrote:


Inside __getattribute__() you ask for self.first_var which triggers another
__getattribute__() call that once again trys to determine the first_var
attribute before it returns...

Try using __getattr__() instead which is only triggered for non-existent
attributes

def __getattr__(self, name):
 return getattr(self.first_var, name)

or check for the attributes you don't want to delegate explicitly:

def __getattribute__(self, name):
 if name == first_var:
 return super(PSIVar, self).__getattribute__(name)



Right thanks a lot it works perfectly.
I don't like too much, however, to mess around in this way, maybe it's 
better if I just fork the project

and patch the original code.

In this way maybe I can also contribute to it with patches (if they are 
accepted)...

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


Re: PyEval_EvalCodeEx return value

2011-09-23 Thread Mateusz Loskot

On 23/09/11 00:47, Mark Hammond wrote:

On 20/09/2011 8:34 PM, Mateusz Loskot wrote:


I'm trying to dig out details about what exactly is the return
value the of PyEval_EvalCodeEx function in Python 3.x
The documentation is sparse, unfortunately.

Perhaps I'm looking at wrong function.
My aim is simple, I need to execute Python code using Python interpreter
embedded in my C++ application.
The Python code is a simple script that always returns single value.
For example:

#! /usr/bin/env python
def foo(a, b):
return a + b
f = foo(2, 3)

But, f can be of different type for different script: one returns
numeric value, another returns a sequence, so the type is not
possible to be determined in advance.

I know how to capture Python stdout/stderr.

I also know how to access the f attribute using
PyObject_GetAttrString and then I can convert f value to C++ type
depending on PyObject type.

However, I guess there shall be a way to access f value
directly from PyEval_EvalCode return object:

PyObject* evalRet = ::PyEval_EvalCode(...);

But, I can't find any details what the evalRet actually is.


Eval is to eval an expression. If you simply eval the expression f in
the context of the module you should get the result returned. Obviously
though it is designed to eval more complex expressions and in your
specific example, doing the getattr thing will also work fine.


Hi Mark,

So, the result of PyEval_EvalCode strictly depends on the code being 
evaluated. It makes sense.


Thanks for help!

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org
Member of ACCU, http://accu.org
--
http://mail.python.org/mailman/listinfo/python-list


cProfile and name spaces.

2011-09-23 Thread Gelonida N
Hi

I have following piece of code in file f1.py

# f1.py starts here ###
def f():
pass

def main():
import profile
profile.run('f()')

if __name__ == '__main__':
main()
# -- end of f1.py 


executing f1.py works as expected.

Now I have a file f2.py
# f2.py starts here ###
import f1
f1.main()
# -- end of f2.py 


If I run f2.py

I get the error message:
. . . .
   File C:\Python26\lib\profile.py, line 70, in run
 prof = prof.run(statement)
   File C:\Python26\lib\profile.py, line 456, in run
 return self.runctx(cmd, dict, dict)
   File C:\Python26\lib\profile.py, line 462, in runctx
 exec cmd in globals, locals
   File string, line 1, in module
 NameError: name 'f' is not defined

So  cProfile doesn't find my function f any more.

I can fix this by changing the code in f1.py to

profile.run('f1.f()')

However now I can't run f1.py anymore.


Is it intentional, that cProfile always uses the name space of the
initial module?

I consider it surprising especially as I did not find any mentioning of
this particularity in the documentation, which states:


 cProfile.run(command[, filename])
 
 This function takes a single argument that can be passed to the exec
 statement, and an optional file name. In all cases this routine attempts
 to exec its first argument, and gather profiling statistics from the
 execution. If no file name is present, then this function automatically
 prints a simple profiling report, sorted by the standard name string
 (file/line/function-name) that is presented in each line. The following
 is a typical output from such a call:


I'm using python 2.6.5

The reason why I don't profile at the top level is, that I do not want
to profile some parts of the code and as I want to
conditionally profile  a cetain function within different contexts /
applications

WI have also difficulties implementing something like this in a module,
which
is not the main module.

arg1 = f(1)
arg2 = f2()
if do_profile:
CProfile('result = function_name(arg1, arg2)', fname)
else:
result = function_name(arg1, arg2)


Any tips / suggestions??










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


Develop inter-dependent eggs

2011-09-23 Thread Andrea Crotti

Develop inter-dependent eggs:

On a Linux machine I have many eggs to develop, for example

- egg1
- egg2
...

Now the eggs depend from each other, so running
python setup.py develop in order, doesn't work, because if the 
dependency required is not already installed then easy_install tries to 
fetch it from PyPi.


I looked around everywhere, but I can't find any feasible option, how do 
I tell easy_install to install the dependencies needed from a filesystem 
position and not from the PyPi server?

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


Need help with file encoding-decoding

2011-09-23 Thread Yaşar Arabacı
Hi,

I'am trying to write a mass html downloader, and it processes files after it
downloaded them. I have problems with encodings, and decodings. Sometimes I
get UnicodeDecodeErrors, or
I get half-pages in after processing part. Or more generally, some things
don't feel right. Can you check my approach, and provide me some feedback
please? Here is what I am doing.

1) send a HEAD request to file's source to get file encoding, set encoding
variable accordingly.
2) if server doesn't provide an encoding, set encoding variable as utf-8
3) read html page from internet, read it to a variable let's say content.
4) in this step, I need to parse the content I get, because I will search
for further links \
I feed content to parser (subclass of HTMLParser.HTMLParser) like
this - content.decode(encoding)
5) open a file in binary mod open(file_path,wb)
6) I write as I read without modifing.

##
# After processing part
##

(Note: encoding variable is same as the downloading part)

1) open local file in binary mod for reading file_name =
open(file_path,rb)
2) decode the file contents into a variable = decoded_content =
file_name.read().decode(encoding)
3) send decoded content to a parser, parser contstruct new html content. (as
str)
4) open same file for writing, in binary mod, write parsers output like
this: file_name.write(parser.output.encode(encoding))
-- 
http://yasar.serveblog.net/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: [TIP] TestFixtures 2.0.0 Released!

2011-09-23 Thread Chris Withers

On 23/09/2011 08:46, Chris Withers wrote:

I'm happy to announce a new release major release of TestFixtures.
This release is 99% backwards compatible, but a lot has changed under
the hood and there's some major new functionality, so thought it was
time for a bump.


Of course, a 2.0.0 release wouldn't be complete without a fairly 
show-stopping lack of backwards compatibility... Thankfully, I've 
managed to return the case (comparison of generators with iterators) to 
its previous state with the 2.0.1 release I've just pushed out...


cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk
--
http://mail.python.org/mailman/listinfo/python-list


Re: python install on locked down windows box?

2011-09-23 Thread python
Hi Matt,

Enjoyed your list options :)

I'm a consultant and have to do what your subject line asks at
most clients I work at.

Here's the technique I recommend:

Install Python for the ***current user*** on another workstation
with the appropriate priviledges. Then xcopy this Python folder
to a USB drive. Then xcopy this folder from your USB drive to a
matching folder on your locked down workstation.

The xcopy-ed version of Python will run without problems when you
start the python.exe executable from a command line with a python
script as a command line parameter. The only thing you won't be
able to do is click on .py* files and have them automatically
invoke the Python interpreter because file associations require
admin rights to update the registery. I don't consider this a big
deal.

Good luck!

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


Re: Need help with file encoding-decoding

2011-09-23 Thread Philip Semanchuk

On Sep 23, 2011, at 7:44 AM, Yaşar Arabacı wrote:

 Hi,
 
 I'am trying to write a mass html downloader, and it processes files after it
 downloaded them. I have problems with encodings, and decodings. Sometimes I
 get UnicodeDecodeErrors, or
 I get half-pages in after processing part. Or more generally, some things
 don't feel right. Can you check my approach, and provide me some feedback
 please? Here is what I am doing.
 
 1) send a HEAD request to file's source to get file encoding, set encoding
 variable accordingly.

Hi Yaşar
This is a pretty optimistic algorithm, at least by the statistics from 2008 
(see below). 


 2) if server doesn't provide an encoding, set encoding variable as utf-8

This is statistically a good guess but it doesn't follow the HTTP specification.


 4) in this step, I need to parse the content I get, because I will search
 for further links \
I feed content to parser (subclass of HTMLParser.HTMLParser) like

Does HTMLParser.HTMLParser handle broken HTML? Because there's lots of it out 
there.

I used to run an automated site validator, and I wrote a couple of articles you 
might find interesting. One is about how to get the encoding of a Web page:
http://NikitaTheSpider.com/articles/EncodingDivination.html

I also wrote an article examining the statistics I'd seen run through the 
crawler/validator. One thing I saw was that almost 2/3 of Web pages specified 
the encoding in the META HTTP-EQUIV Content-Type tag rather than in the HTTP 
Content-Type header. Mind you, this was three years ago so the character of the 
Web has likely changed since then, but probably not too dramatically.
http://NikitaTheSpider.com/articles/ByTheNumbers/fall2008.html

You can also do some straightforward debugging. Save the raw bytes you get from 
each site, and when you encounter a decode error, check the raw bytes. Are they 
really in the encoding specified? Webmasters make all kinds of mistakes. 


Hope this helps
Philip



 this - content.decode(encoding)
 5) open a file in binary mod open(file_path,wb)
 6) I write as I read without modifing.
 
 ##
 # After processing part
 ##
 
 (Note: encoding variable is same as the downloading part)
 
 1) open local file in binary mod for reading file_name =
 open(file_path,rb)
 2) decode the file contents into a variable = decoded_content =
 file_name.read().decode(encoding)
 3) send decoded content to a parser, parser contstruct new html content. (as
 str)
 4) open same file for writing, in binary mod, write parsers output like
 this: file_name.write(parser.output.encode(encoding))
 -- 
 http://yasar.serveblog.net/
 -- 
 http://mail.python.org/mailman/listinfo/python-list

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


Re: extending class

2011-09-23 Thread Jean-Michel Pichavant

Andrea Crotti wrote:

On 09/23/2011 10:31 AM, Peter Otten wrote:


Inside __getattribute__() you ask for self.first_var which triggers 
another

__getattribute__() call that once again trys to determine the first_var
attribute before it returns...

Try using __getattr__() instead which is only triggered for non-existent
attributes

def __getattr__(self, name):
 return getattr(self.first_var, name)

or check for the attributes you don't want to delegate explicitly:

def __getattribute__(self, name):
 if name == first_var:
 return super(PSIVar, self).__getattribute__(name)



Right thanks a lot it works perfectly.
I don't like too much, however, to mess around in this way, maybe it's 
better if I just fork the project

and patch the original code.

In this way maybe I can also contribute to it with patches (if they 
are accepted)...
Did you consider subclassing your Var class ? This is how you extend a 
class behavior in OOP.


class PSIVar(var):
   def __init__(self, name, desc, other=None, fun=None):
   var.__init__(self, name, desc)
   if other is not None:
   self.other = other
   self.fun = fun
   assert callable(self.fun)

v1 = PSIVar('name', 'desc')

that's it.

By the way, don't create instance attribute conditionally. Your PSIVar 
instance should always have a 'other' attribute, its value can be None 
though.




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


Re: Odd behavior with imp.reload and logging

2011-09-23 Thread Andrew Berg
On 2011.09.22 03:12 AM, Chris Angelico wrote:
 In theory, this should mean that you load it fresh every time - I
 think. If not, manually deleting entries from sys.modules might help,
 either with or without the list of modules.
I've played around with sys.modules, and it seems there are issues with
logging being reloaded (not sure if it's fair to call it a bug), not my
module. The only reliable way I've found to start fresh is to delete at
least logging from sys.modules (I can even do this from within my
module). Even if the module that imports logging is deleted, things in
logging persist (I can confirm at least handlers and handles to log
files; the latter requiring garbage collection as well to free up).
However, this would probably wreak havoc on other code that uses logging
(although, I could always import logging as something else).

On a side note, this actually gives me a good way to detect that the
module is reloaded (I can't think of any other way to detect it, at
least not off the top of my head).
-- 
CPython 3.2.2 | Windows NT 6.1.7601.17640 | Thunderbird 6.0.2
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: extending class

2011-09-23 Thread Andrea Crotti
Jean-Michel Pichavant jeanmic...@sequans.com writes:

 Did you consider subclassing your Var class ? This is how you extend a
 class behavior in OOP.

 class PSIVar(var):
def __init__(self, name, desc, other=None, fun=None):
var.__init__(self, name, desc)
if other is not None:
self.other = other
self.fun = fun
assert callable(self.fun)

 v1 = PSIVar('name', 'desc')

 that's it.

 By the way, don't create instance attribute conditionally. Your PSIVar
 instance should always have a 'other' attribute, its value can be None
 though.



 JM


Yes thanks, first I tried that, but I didn't want to have to change my
class definition if the one from the library changes.  So I started to
mess with *args and **kwargs and it was really not beautiful ;)

Anyway since I want to other and more deep changes I just forked the
project and start work on that...
-- 
http://mail.python.org/mailman/listinfo/python-list


Could anybody tell me how to make a version of Nokia Symbian os

2011-09-23 Thread gmszone
I like the Python in my mobile phone.But a don't have the enough money
to buy a new phone.And my mobile type is Nokia N72 which is a part of
S60v2.And I could program in some boring classes.But the version of my
mobile's python is to old.So I hope I coule learn how to  compile it
for my N72.My notebook has the Windows 7 and Ubuntu GNU/Linux.Ask for
help.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: extending class

2011-09-23 Thread Steven D'Aprano
Andrea Crotti wrote:

 I wanted to add a couple of parameters to a class from a given library
 (paste-script), but without changing the original code.
 So I thought, I create a wrapper class which adds what I need, and then
 dispatch all the calls to the super class.

You don't need to use a wrapper class if all you want is to add additional
attributes to an instance.

 class Spam(object):
... def __init__(self):
... self.x = 1
...
 s = Spam()
 s.name = Fred
 s.name
'Fred'


 My following attempt gives, however, a recursion error, but why?

Here is an old recipe showing how to do automatic delegation correctly:

http://code.activestate.com/recipes/52295/



-- 
Steven

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


pyWin build 216

2011-09-23 Thread python
I have used pyWin for several years now with out issue.   I recently
installed build 216 for python 2.7 on windows XP pro.   The program
crashes every time I exit a wxPython program and has crashed a few
other times.  I does not seem that pyWin has been updated since
February of this year.   Is there a direction change for the windows
extensions?  Is it time I make the move to 3.x?  Mark Hammond has
given much to the Python community and I do not intend for this post
to be negative in any way.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: pyWin build 216

2011-09-23 Thread Brian Curtin
On Fri, Sep 23, 2011 at 09:25, python w.g.sned...@gmail.com wrote:
 I have used pyWin for several years now with out issue.   I recently
 installed build 216 for python 2.7 on windows XP pro.   The program
 crashes every time I exit a wxPython program and has crashed a few
 other times.  I does not seem that pyWin has been updated since
 February of this year.   Is there a direction change for the windows
 extensions?  Is it time I make the move to 3.x?  Mark Hammond has
 given much to the Python community and I do not intend for this post
 to be negative in any way.

pywin32 has been available for 3.x for some time, but you wouldn't be
able to use it since you're currently using wxPython.

You may want to post a more detailed question to
http://mail.python.org/mailman/listinfo/python-win32 -- Mark hangs out
there and there are plenty of pywin32 experts around who could help as
well.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python deadlock using subprocess.popen and communicate

2011-09-23 Thread Atherun
On Sep 23, 12:08 am, Chris Angelico ros...@gmail.com wrote:
 On Fri, Sep 23, 2011 at 3:59 PM, Nobody nob...@nowhere.com wrote:
  It doesn't even

 You intrigue me, sir. Does it odd?

 What is the remainder of this aborted sentence?

 ChrisA

That is odd, I also find it odd that it deadlocks the entire python
system, even threads that have nothing to do with the subprocess stop
working, the entire thing just stops. I may not have pasted the full
stack trace looking at it again, I'll double check in a few.

I was able to repro this on a tool I have the source for, when I
attach to it to debug visual studio tells me the threads are
deadlocked and the only stack trace I have available to me is a low
level os call to a WriteFile function.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python 2.5 zlib trouble

2011-09-23 Thread Jesramz
Python 2.5.6 (r256:88840, Sep 22 2011, 13:45:58)
[GCC 4.5.2] on linux2
Type help, copyright, credits or license for more information.
 import zlib
Traceback (most recent call last):
  File stdin, line 1, in module
ImportError: No module named zlib


But if I run Python2.7 I get:

Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24)
[GCC 4.5.2] on linux2
Type help, copyright, credits or license for more information.
 import zlib


It seems to work.

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


Re: python install on locked down windows box?

2011-09-23 Thread Chris Withers

Hi Steve

On 22/09/2011 13:58, Steven D'Aprano wrote:

(7) If all else fails, as an absolute last resort, simply run the Windows
installer as a regular, unprivileged user, after selecting the option for a
Non-Admin Install under Advanced Options first.


Thanks for this, will send on to my friend in need...
Hadn't seen this before, but it's a long time since I've run the Windows 
installer ;-)


Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python deadlock using subprocess.popen and communicate

2011-09-23 Thread Atherun
On Sep 23, 7:58 am, Atherun athe...@gmail.com wrote:
 On Sep 23, 12:08 am, Chris Angelico ros...@gmail.com wrote:

  On Fri, Sep 23, 2011 at 3:59 PM, Nobody nob...@nowhere.com wrote:
   It doesn't even

  You intrigue me, sir. Does it odd?

  What is the remainder of this aborted sentence?

  ChrisA

 That is odd, I also find it odd that it deadlocks the entire python
 system, even threads that have nothing to do with the subprocess stop
 working, the entire thing just stops. I may not have pasted the full
 stack trace looking at it again, I'll double check in a few.

 I was able to repro this on a tool I have the source for, when I
 attach to it to debug visual studio tells me the threads are
 deadlocked and the only stack trace I have available to me is a low
 level os call to a WriteFile function.

Ya heres the full python stack:


ntoskrnl.exe!memset+0x64a
ntoskrnl.exe!KeWaitForMultipleObjects+0xd52
ntoskrnl.exe!KeWaitForMutexObject+0x19f
ntoskrnl.exe!__misaligned_access+0xba4
ntoskrnl.exe!__misaligned_access+0x1821
ntoskrnl.exe!KeWaitForMultipleObjects+0xf5d
ntoskrnl.exe!KeWaitForMutexObject+0x19f
ntoskrnl.exe!NtWaitForSingleObject+0xde
ntoskrnl.exe!KeSynchronizeExecution+0x3a43
wow64cpu.dll!TurboDispatchJumpAddressEnd+0x6c0
wow64cpu.dll!TurboDispatchJumpAddressEnd+0x4a8
wow64.dll!Wow64SystemServiceEx+0x1ce
wow64.dll!Wow64LdrpInitialize+0x429
ntdll.dll!RtlUniform+0x6e6
ntdll.dll!RtlCreateTagHeap+0xa7
ntdll.dll!LdrInitializeThunk+0xe
ntdll.dll!ZwWaitForSingleObject+0x15
kernel32.dll!WaitForSingleObjectEx+0x43
kernel32.dll!WaitForSingleObject+0x12
python26.dll!_Py_svnversion+0xcf8
python26.dll!PyObject_AsReadBuffer+0x46d
python26.dll!PyEval_EvalCodeEx+0x738
python26.dll!PyEval_EvalFrameEx+0x467
python26.dll!PyObject_Realloc+0x90
python26.dll!PyEval_EvalCodeEx+0x8ef
python26.dll!PyEval_EvalFrameEx+0x467
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: Urwid 1.0.0 - Console UI Library

2011-09-23 Thread Michael P. Soulier
On 22/09/11 Ian Ward said:

 Announcing Urwid 1.0.0
 --

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


Re: Python deadlock using subprocess.popen and communicate

2011-09-23 Thread Nobody
On Fri, 23 Sep 2011 06:59:12 +0100, Nobody wrote:

 kernel32.dll!WaitForSingleObject+0x12
 python26.dll!_Py_svnversion+0xcf8
 
 I haven't a clue how this happens. _Py_svnversion just returns a string:

In retrospect, I think that's a red herring. 0xcf8 seems like too large an
offset for such a small function. I think that it's more likely to be in a
non-exported function, and _Py_svnversion just happens to be the last
exported symbol prior to that point in the code.

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


Re: Python deadlock using subprocess.popen and communicate

2011-09-23 Thread Atherun
On Sep 23, 10:47 am, Nobody nob...@nowhere.com wrote:
 On Fri, 23 Sep 2011 06:59:12 +0100, Nobody wrote:
  kernel32.dll!WaitForSingleObject+0x12
  python26.dll!_Py_svnversion+0xcf8

  I haven't a clue how this happens. _Py_svnversion just returns a string:

 In retrospect, I think that's a red herring. 0xcf8 seems like too large an
 offset for such a small function. I think that it's more likely to be in a
 non-exported function, and _Py_svnversion just happens to be the last
 exported symbol prior to that point in the code.

I have the call stacks for each python thread running up until the
dead lock:

# ThreadID: 992
  out, err = proc.communicate(change: new\ndescription: %s
\n%changelistDesc)
File: c:\src\extern\python\lib\subprocess.py, line 689, in
communicate
  return self._communicate(input)
File: c:\src\extern\python\lib\subprocess.py, line 903, in
_communicate
  stdout_thread.join()
File: c:\src\extern\python\lib\threading.py, line 637, in join
  self.__block.wait()
File: c:\src\extern\python\lib\threading.py, line 237, in wait
  waiter.acquire()

# ThreadID: 5516
File: c:\src\extern\python\lib\threading.py, line 497, in
__bootstrap
  self.__bootstrap_inner()
File: c:\src\extern\python\lib\threading.py, line 525, in
__bootstrap_inner
  self.run()
File: c:\src\extern\python\lib\threading.py, line 477, in run
  self.__target(*self.__args, **self.__kwargs)
File: c:\src\extern\python\lib\subprocess.py, line 877, in
_readerthread
  buffer.append(fh.read())

# ThreadID: 2668
File: c:\src\extern\python\lib\threading.py, line 497, in
__bootstrap
  self.__bootstrap_inner()
File: c:\src\extern\python\lib\threading.py, line 525, in
__bootstrap_inner
  self.run()
File: c:\src\scripts\auto\Autobuilder\StackTracer.py, line 69, in
run
  self.stacktraces()
File: c:\src\scripts\auto\Autobuilder\StackTracer.py, line 86, in
stacktraces
  fout.write(stacktraces())
File: c:\src\scripts\auto\Autobuilder\StackTracer.py, line 26, in
stacktraces
  for filename, lineno, name, line in traceback.extract_stack(stack):

# ThreadID: 3248
  out, err = proc.communicate(change: new\ndescription: %s
\n%changelistDesc)
File: c:\src\extern\python\lib\subprocess.py, line 689, in
communicate
  return self._communicate(input)
File: c:\src\extern\python\lib\subprocess.py, line 903, in
_communicate
  stdout_thread.join()
File: c:\src\extern\python\lib\threading.py, line 637, in join
  self.__block.wait()
File: c:\src\extern\python\lib\threading.py, line 237, in wait
  waiter.acquire()


# ThreadID: 7700
File: c:\src\extern\python\lib\threading.py, line 497, in
__bootstrap
  self.__bootstrap_inner()
File: c:\src\extern\python\lib\threading.py, line 525, in
__bootstrap_inner
  self.run()
File: c:\src\extern\python\lib\threading.py, line 477, in run
  self.__target(*self.__args, **self.__kwargs)
File: c:\src\extern\python\lib\subprocess.py, line 877, in
_readerthread
  buffer.append(fh.read())

# ThreadID: 8020
  out, err = proc.communicate(change: new\ndescription: %s
\n%changelistDesc)
File: c:\src\extern\python\lib\subprocess.py, line 689, in
communicate
  return self._communicate(input)
File: c:\src\extern\python\lib\subprocess.py, line 903, in
_communicate
  stdout_thread.join()
File: c:\src\extern\python\lib\threading.py, line 637, in join
  self.__block.wait()
File: c:\src\extern\python\lib\threading.py, line 237, in wait
  waiter.acquire()

# ThreadID: 4252
File: c:\src\extern\python\lib\threading.py, line 497, in
__bootstrap
  self.__bootstrap_inner()
File: c:\src\extern\python\lib\threading.py, line 525, in
__bootstrap_inner
  self.run()
File: c:\src\extern\python\lib\threading.py, line 477, in run
  self.__target(*self.__args, **self.__kwargs)
File: c:\src\extern\python\lib\subprocess.py, line 877, in
_readerthread
  buffer.append(fh.read())

The StackTracer thread freezes trying to update my output file, and
yes I'm trying to 3 tasks in parallel which each one starts by
creating a changelist in perforce.  This is just an easy repro case
for me, it happens with commands other then p4.  This almost looks
like a threading issue more then the output deadlock.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: comments on runpy module

2011-09-23 Thread Alexey Luchko

Example script.py: 
def f(arg):
return g(arg)

def g(arg):
return arg




Reading the Lib/runpy.py I've found, that the temporary module created
inside the run_path() calls, is destroyed right after the script.py code
executed in the resulting namespace.


I've got an idea.  It would be nice if there existed such a way to use it:
with runpy.run_path(script.py) as a_namespace:
  a_namespace[f](abc)

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


comments on runpy module

2011-09-23 Thread Alexey Luchko

Hi!

I've just had fun with the runpy module in Python 2.7.  I'm writing to 
share it :)


What I've tried is to load a python script using runpy.run_path(), take a 
function from the resulting namespace and call it with arbitrary arguments.


All the functions in the namespace seem to be ok.  repr(namespace[f]) 
gives function f at 0x005531F0.


But if the f() is referring the modules namespace (I supposed it is the 
same as the returned one), all the values appear to be None.


Example script.py: 
def f(arg):
   return g(arg)

def g(arg):
   return arg


Then running main.py: 
import runpy

namespace = runpy.run_path(./script.py)
print namespace[f]
print namespace[g]

print namespace[f](abc)


gives such an output 
function f at 0x005524F0
function g at 0x023F0830
Traceback (most recent call last):
  File main.py, line 7, in module
print namespace[f](abc)
  File ./script.py, line 2, in f
return g(arg)
TypeError: 'NoneType' object is not callable


Reading the Lib/runpy.py I've found, that the temporary module created 
inside the run_path() calls, is destroyed right after the script.py code 
executed in the resulting namespace.


I suppose that it is ether an issue or a feature that should be documented :)

--
Have a good time and a good mood!

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


strange behavior from recursive generator

2011-09-23 Thread Dr. Phillip M. Feldman

A few weeks ago, I wrote a class that creates an iterator for solving the
general unlabeled-balls-in-labeled boxes occupancy problem. Chris Rebert
converted my code to a generator, which made the code cleaner, and I
subsequently simplified it somewhat further.

My problem is the following: All of these versions of the code work fine for
very small problems, but do not produce the full set of occupancy
distributions for larger problems. The following sample input and output
show what happens with two balls and two boxes (to keep things simple, I've
made the boxes large enough so that each box can hold both balls).

In [6]: x= balls_in_labeled_boxes(2,[2,2])

In [7]: list(x)
balls=2, box_sizes=[2, 2]
About to make recursive call.  balls_in_other_boxes=0, box_sizes=[2]
i=0, distribution_other=(0,)
About to make recursive call.  balls_in_other_boxes=1, box_sizes=[2]
i=0, distribution_other=(1,)
About to make recursive call.  balls_in_other_boxes=2, box_sizes=[2]
i=0, distribution_other=(2,)
Out[7]: [(2, 0), (1, 1), (0, 2)]

Note that Out[7] above gives the correct result, showing all three possible
distributions. Now lets try the same thing with three boxes.

In [8]: x= balls_in_labeled_boxes(2,[2,2,2])

In [9]: list(x)
balls=2, box_sizes=[2, 2, 2]
About to make recursive call.  balls_in_other_boxes=0, box_sizes=[2, 2]
i=0, distribution_other=(0, 0)
About to make recursive call.  balls_in_other_boxes=1, box_sizes=[2, 2]
i=0, distribution_other=(1, 0)
About to make recursive call.  balls_in_other_boxes=2, box_sizes=[2, 2]
i=0, distribution_other=(2, 0)
i=1, distribution_other=(1, 1)
Out[9]: [(2, 0, 0), (1, 1, 0), (0, 2, 0), (0, 1, 1)]

When there are no balls in the initial box, the recursive call should
produce the same three occupancy distributions that we saw above, but one of
them is now missing. If someone can shed light on why this is happening, I'd
be grateful.

Phillip

http://old.nabble.com/file/p32503886/balls_in_labeled_boxes.py
balls_in_labeled_boxes.py 
-- 
View this message in context: 
http://old.nabble.com/strange-behavior-from-recursive-generator-tp32503886p32503886.html
Sent from the Python - python-list mailing list archive at Nabble.com.

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


Re: strange behavior from recursive generator

2011-09-23 Thread Arnaud Delobelle
On 23 September 2011 21:09, Dr. Phillip M. Feldman
phillip.m.feld...@gmail.com wrote:

 A few weeks ago, I wrote a class that creates an iterator for solving the
 general unlabeled-balls-in-labeled boxes occupancy problem. Chris Rebert
 converted my code to a generator, which made the code cleaner, and I
 subsequently simplified it somewhat further.

 My problem is the following: All of these versions of the code work fine for
 very small problems, but do not produce the full set of occupancy
 distributions for larger problems. The following sample input and output
 show what happens with two balls and two boxes (to keep things simple, I've
 made the boxes large enough so that each box can hold both balls).

 In [6]: x= balls_in_labeled_boxes(2,[2,2])

 In [7]: list(x)
 balls=2, box_sizes=[2, 2]
 About to make recursive call.  balls_in_other_boxes=0, box_sizes=[2]
 i=0, distribution_other=(0,)
 About to make recursive call.  balls_in_other_boxes=1, box_sizes=[2]
 i=0, distribution_other=(1,)
 About to make recursive call.  balls_in_other_boxes=2, box_sizes=[2]
 i=0, distribution_other=(2,)
 Out[7]: [(2, 0), (1, 1), (0, 2)]

 Note that Out[7] above gives the correct result, showing all three possible
 distributions. Now lets try the same thing with three boxes.

 In [8]: x= balls_in_labeled_boxes(2,[2,2,2])

 In [9]: list(x)
 balls=2, box_sizes=[2, 2, 2]
 About to make recursive call.  balls_in_other_boxes=0, box_sizes=[2, 2]
 i=0, distribution_other=(0, 0)
 About to make recursive call.  balls_in_other_boxes=1, box_sizes=[2, 2]
 i=0, distribution_other=(1, 0)
 About to make recursive call.  balls_in_other_boxes=2, box_sizes=[2, 2]
 i=0, distribution_other=(2, 0)
 i=1, distribution_other=(1, 1)
 Out[9]: [(2, 0, 0), (1, 1, 0), (0, 2, 0), (0, 1, 1)]

 When there are no balls in the initial box, the recursive call should
 produce the same three occupancy distributions that we saw above, but one of
 them is now missing. If someone can shed light on why this is happening, I'd
 be grateful.

Line 46:

 for distribution_other in _balls_in_unlabeled_boxes(

Should be:


 for distribution_other in _balls_in_labeled_boxes(

HTH

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


Re: Python 2.5 zlib trouble

2011-09-23 Thread Christian Heimes
Am 23.09.2011 17:41, schrieb Jesramz:
 Python 2.5.6 (r256:88840, Sep 22 2011, 13:45:58)
 [GCC 4.5.2] on linux2
 Type help, copyright, credits or license for more information.
 import zlib
 Traceback (most recent call last):
   File stdin, line 1, in module
 ImportError: No module named zlib

Are you running a self-compiled installation of Python 2.5 on recent
Debian or Ubuntu? Check out my blog
http://lipyrary.blogspot.com/2011/05/how-to-compile-python-on-ubuntu-1104.html

Christian

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


Re: Python 2.5 zlib trouble

2011-09-23 Thread Jesramz

Thank You Christian

Im running on Ubuntu Natty and I am not running a self-compiled
install, its a regular release. In order to do this:

  $ make distclean
   $ export LDFLAGS=-L/usr/lib/$(dpkg-architecture -
qDEB_HOST_MULTIARCH)
   $ ./configure
   $ make
   $ make install
   $ unset LDFLAGS

If you can, can you explain the steps for this, can I run this in a
regular release of Python2.5?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: strange behavior from recursive generator

2011-09-23 Thread Phillip Feldman
I don't know how many times I stared at that code without seeing the error.

Thanks so much!

Phillip

On Fri, Sep 23, 2011 at 1:26 PM, Arnaud Delobelle arno...@gmail.com wrote:

 On 23 September 2011 21:09, Dr. Phillip M. Feldman
 phillip.m.feld...@gmail.com wrote:
 
  A few weeks ago, I wrote a class that creates an iterator for solving the
  general unlabeled-balls-in-labeled boxes occupancy problem. Chris Rebert
  converted my code to a generator, which made the code cleaner, and I
  subsequently simplified it somewhat further.
 
  My problem is the following: All of these versions of the code work fine
 for
  very small problems, but do not produce the full set of occupancy
  distributions for larger problems. The following sample input and output
  show what happens with two balls and two boxes (to keep things simple,
 I've
  made the boxes large enough so that each box can hold both balls).
 
  In [6]: x= balls_in_labeled_boxes(2,[2,2])
 
  In [7]: list(x)
  balls=2, box_sizes=[2, 2]
  About to make recursive call.  balls_in_other_boxes=0, box_sizes=[2]
  i=0, distribution_other=(0,)
  About to make recursive call.  balls_in_other_boxes=1, box_sizes=[2]
  i=0, distribution_other=(1,)
  About to make recursive call.  balls_in_other_boxes=2, box_sizes=[2]
  i=0, distribution_other=(2,)
  Out[7]: [(2, 0), (1, 1), (0, 2)]
 
  Note that Out[7] above gives the correct result, showing all three
 possible
  distributions. Now lets try the same thing with three boxes.
 
  In [8]: x= balls_in_labeled_boxes(2,[2,2,2])
 
  In [9]: list(x)
  balls=2, box_sizes=[2, 2, 2]
  About to make recursive call.  balls_in_other_boxes=0, box_sizes=[2, 2]
  i=0, distribution_other=(0, 0)
  About to make recursive call.  balls_in_other_boxes=1, box_sizes=[2, 2]
  i=0, distribution_other=(1, 0)
  About to make recursive call.  balls_in_other_boxes=2, box_sizes=[2, 2]
  i=0, distribution_other=(2, 0)
  i=1, distribution_other=(1, 1)
  Out[9]: [(2, 0, 0), (1, 1, 0), (0, 2, 0), (0, 1, 1)]
 
  When there are no balls in the initial box, the recursive call should
  produce the same three occupancy distributions that we saw above, but one
 of
  them is now missing. If someone can shed light on why this is happening,
 I'd
  be grateful.

 Line 46:

 for distribution_other in _balls_in_unlabeled_boxes(

 Should be:


 for distribution_other in _balls_in_labeled_boxes(

 HTH

 --
 Arnaud

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


Re: Context manager with class methods

2011-09-23 Thread Gregory Ewing

Terry Reedy wrote:


it is normal to look for special methods on the class (and superclasses)

 of an object rather than starting with the object itself.

I suspect there was a deliberate change to correct an anomaly, though 
this might have been done as part of some other change.


It's a necessary consequence of the fact that new-style classes
are also instances. Without it, there would be an ambiguity as
to whether a special method defined the behaviour of instances
of a class or of the class object itself.

It also increases efficiency, because for those special methods
that correspond to C-level type slots, you only have to look
in the type slot to find an implementation of the method,
rather than having to look in the instance dict first.

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


Re: Python 2.5 zlib trouble

2011-09-23 Thread Alec Taylor
No idea, as I said before, if you ask for it they might put in the alpha.

On Sat, Sep 24, 2011 at 8:30 AM, Jesse Ramirez
jesus.ramirez.ute...@gmail.com wrote:

 Thanks Alec, might you know when the 2.7 support might come?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python 2.5 zlib trouble

2011-09-23 Thread Jesramz
Thank You Christian

Im running on Ubuntu Natty and I am not running a self-compiled
install, its a regular release. In order to do this:
  $ make distclean
   $ export LDFLAGS=-L/usr/lib/$(dpkg-architecture -
qDEB_HOST_MULTIARCH)
   $ ./configure
   $ make
   $ make install
   $ unset LDFLAGS

If you can, can you explain the steps for this, can I run this in a
regular release of Python2.5?



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


can't load an script from html...

2011-09-23 Thread Ricardo
Hi everyone
I'm trying to use the cgi library to create a python script and loading it from 
a web page. I have already done the necessary imports, and the default commands 
to receive data from html are written too. The final version is something 
like this:

#!/usr/bin/python

import subprocess
import cgi
import cgitb

cgitb.enable()

input = cgi.FieldStorage()

…. my code (do something with input)….


#printing the response

print Content-Type: text/html
print   
print TITLEMy title:/TITLE
print /HEAD
print BODY
print ….. bla bla …
print %s%theoutput
print /BODY

Besides, my call from my index.html is like this:

 form action=/scripts/python_script.py method=post
input name=inid type=text size=20 class=input /br/br/
input type=submit value=accept  class=button/
 /form

well, the thing is that when i do the call from the browser: 

http://localhost/index.html 
   |
  V
put the data and click on the accept button
   |
  V
http:/localhost/scripts/python_script.py

I only get the python_script.py as a plain test by response (the script printed 
on my browser). 
I have already changed the permissions for python_script.py. I have checked the 
import cgi,cgitb in the python shell (i am using v2.7) and they work fine. So, 
i don't know what it is going wrong here.

A little help please… any idea?
Thanks anyway for your time.


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


Re: can't load an script from html...

2011-09-23 Thread MRAB

On 24/09/2011 02:42, Ricardo wrote:

Hi everyone
I'm trying to use the cgi library to create a python script and loading it from a web 
page. I have already done the necessary imports, and the default commands to receive data 
from html are written too. The final version is something like this:

#!/usr/bin/python

import subprocess
import cgi
import cgitb

cgitb.enable()

input = cgi.FieldStorage()

…. my code (do something with input)….


#printing the response

print Content-Type: text/html
print
print TITLEMy title:/TITLE
print /HEAD
print BODY
print ….. bla bla …
print %s%theoutput
print /BODY

Besides, my call from my index.html is like this:

  form action=/scripts/python_script.py method=post
input name=inid type=text size=20 class=input /br/br/
 input type=submit value=accept  class=button/
  /form

well, the thing is that when i do the call from the browser:

http://localhost/index.html
|
   V
put the data and click on the accept button
|
   V
http:/localhost/scripts/python_script.py

I only get the python_script.py as a plain test by response (the script printed 
on my browser).
I have already changed the permissions for python_script.py. I have checked the 
import cgi,cgitb in the python shell (i am using v2.7) and they work fine. So, 
i don't know what it is going wrong here.

A little help please… any idea?
Thanks anyway for your time.


If it helps, the responses on my home-make stuff start something like this:

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
HTML
HEAD
meta http-equiv=Content-Type content=text/html;charset=utf-8 /
/HEAD
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python deadlock using subprocess.popen and communicate

2011-09-23 Thread Matt Joiner
how do you get the call stacks like this?

On Sat, Sep 24, 2011 at 3:59 AM, Atherun athe...@gmail.com wrote:
 On Sep 23, 10:47 am, Nobody nob...@nowhere.com wrote:
 On Fri, 23 Sep 2011 06:59:12 +0100, Nobody wrote:
  kernel32.dll!WaitForSingleObject+0x12
  python26.dll!_Py_svnversion+0xcf8

  I haven't a clue how this happens. _Py_svnversion just returns a string:

 In retrospect, I think that's a red herring. 0xcf8 seems like too large an
 offset for such a small function. I think that it's more likely to be in a
 non-exported function, and _Py_svnversion just happens to be the last
 exported symbol prior to that point in the code.

 I have the call stacks for each python thread running up until the
 dead lock:

 # ThreadID: 992
  out, err = proc.communicate(change: new\ndescription: %s
 \n%changelistDesc)
 File: c:\src\extern\python\lib\subprocess.py, line 689, in
 communicate
  return self._communicate(input)
 File: c:\src\extern\python\lib\subprocess.py, line 903, in
 _communicate
  stdout_thread.join()
 File: c:\src\extern\python\lib\threading.py, line 637, in join
  self.__block.wait()
 File: c:\src\extern\python\lib\threading.py, line 237, in wait
  waiter.acquire()

 # ThreadID: 5516
 File: c:\src\extern\python\lib\threading.py, line 497, in
 __bootstrap
  self.__bootstrap_inner()
 File: c:\src\extern\python\lib\threading.py, line 525, in
 __bootstrap_inner
  self.run()
 File: c:\src\extern\python\lib\threading.py, line 477, in run
  self.__target(*self.__args, **self.__kwargs)
 File: c:\src\extern\python\lib\subprocess.py, line 877, in
 _readerthread
  buffer.append(fh.read())

 # ThreadID: 2668
 File: c:\src\extern\python\lib\threading.py, line 497, in
 __bootstrap
  self.__bootstrap_inner()
 File: c:\src\extern\python\lib\threading.py, line 525, in
 __bootstrap_inner
  self.run()
 File: c:\src\scripts\auto\Autobuilder\StackTracer.py, line 69, in
 run
  self.stacktraces()
 File: c:\src\scripts\auto\Autobuilder\StackTracer.py, line 86, in
 stacktraces
  fout.write(stacktraces())
 File: c:\src\scripts\auto\Autobuilder\StackTracer.py, line 26, in
 stacktraces
  for filename, lineno, name, line in traceback.extract_stack(stack):

 # ThreadID: 3248
  out, err = proc.communicate(change: new\ndescription: %s
 \n%changelistDesc)
 File: c:\src\extern\python\lib\subprocess.py, line 689, in
 communicate
  return self._communicate(input)
 File: c:\src\extern\python\lib\subprocess.py, line 903, in
 _communicate
  stdout_thread.join()
 File: c:\src\extern\python\lib\threading.py, line 637, in join
  self.__block.wait()
 File: c:\src\extern\python\lib\threading.py, line 237, in wait
  waiter.acquire()


 # ThreadID: 7700
 File: c:\src\extern\python\lib\threading.py, line 497, in
 __bootstrap
  self.__bootstrap_inner()
 File: c:\src\extern\python\lib\threading.py, line 525, in
 __bootstrap_inner
  self.run()
 File: c:\src\extern\python\lib\threading.py, line 477, in run
  self.__target(*self.__args, **self.__kwargs)
 File: c:\src\extern\python\lib\subprocess.py, line 877, in
 _readerthread
  buffer.append(fh.read())

 # ThreadID: 8020
  out, err = proc.communicate(change: new\ndescription: %s
 \n%changelistDesc)
 File: c:\src\extern\python\lib\subprocess.py, line 689, in
 communicate
  return self._communicate(input)
 File: c:\src\extern\python\lib\subprocess.py, line 903, in
 _communicate
  stdout_thread.join()
 File: c:\src\extern\python\lib\threading.py, line 637, in join
  self.__block.wait()
 File: c:\src\extern\python\lib\threading.py, line 237, in wait
  waiter.acquire()

 # ThreadID: 4252
 File: c:\src\extern\python\lib\threading.py, line 497, in
 __bootstrap
  self.__bootstrap_inner()
 File: c:\src\extern\python\lib\threading.py, line 525, in
 __bootstrap_inner
  self.run()
 File: c:\src\extern\python\lib\threading.py, line 477, in run
  self.__target(*self.__args, **self.__kwargs)
 File: c:\src\extern\python\lib\subprocess.py, line 877, in
 _readerthread
  buffer.append(fh.read())

 The StackTracer thread freezes trying to update my output file, and
 yes I'm trying to 3 tasks in parallel which each one starts by
 creating a changelist in perforce.  This is just an easy repro case
 for me, it happens with commands other then p4.  This almost looks
 like a threading issue more then the output deadlock.
 --
 http://mail.python.org/mailman/listinfo/python-list

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


Why is the shutil module called shutil?

2011-09-23 Thread Fletcher Johnson
The topic says it all:
Why is shutil named shutil? What does it stand for? This is just a
mild curiosity of mine.
The shutil module for reference: 
http://docs.python.org/library/shutil.html#module-shutil
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: pyWin build 216

2011-09-23 Thread Mark Hammond

On 24/09/2011 12:25 AM, python wrote:

I have used pyWin for several years now with out issue.   I recently
installed build 216 for python 2.7 on windows XP pro.   The program
crashes every time I exit a wxPython program and has crashed a few
other times.


There are a number of issues using Pythonwin to run a program which uses 
a different UI toolkit (eg, wx, Tkinter) and while these have been 
around for many years I don't plan on trying to fix it.  IOW, don't do 
that :)



I does not seem that pyWin has been updated since
February of this year.   Is there a direction change for the windows
extensions?  Is it time I make the move to 3.x?  Mark Hammond has
given much to the Python community and I do not intend for this post
to be negative in any way.


No problem.  There have been no updates as there is very little to 
update (ie, the code hasn't change a huge amount in hg since then). 
There will probably be a new version in the next month or so, but that 
is quite orthogonal to whether you should move to 3.x - the 3.x version 
of Pythonwin hasn't been updated in the same period and is built from 
the same source tree, so is likely to have exactly the same problems 
(infact is likely to have a few more - there are probably a few 3.x 
specific issues still hiding away).


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


Re: Why is the shutil module called shutil?

2011-09-23 Thread Chris Rebert
On Fri, Sep 23, 2011 at 8:36 PM, Fletcher Johnson flt.john...@gmail.com wrote:
 The topic says it all:
 Why is shutil named shutil? What does it stand for? This is just a
 mild curiosity of mine.

sh is short for shell, in line with Unix convention, where the
default shell is located at /bin/sh.
http://en.wikipedia.org/wiki/Shell_(computing)
http://en.wikipedia.org/wiki/Unix_shell

util is short for utilities.

shutil is a utility module used to accomplish tasks which one often
does when in the shell, such as copying, moving, or removing directory
trees. But shutil (to my knowledge) is not implemented using shell
commands or by running external programs, so it thus avoids a whole
host of shell-related issues.

It's not the best name, but what with backwards compatibility and all,
it's unlikely to change any time soon.

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


Re: Why is the shutil module called shutil?

2011-09-23 Thread Fletcher Johnson
On Sep 23, 11:58 pm, Chris Rebert c...@rebertia.com wrote:
 On Fri, Sep 23, 2011 at 8:36 PM, Fletcher Johnson flt.john...@gmail.com 
 wrote:
  The topic says it all:
  Why is shutil named shutil? What does it stand for? This is just a
  mild curiosity of mine.

 sh is short for shell, in line with Unix convention, where the
 default shell is located at 
 /bin/sh.http://en.wikipedia.org/wiki/Shell_(computing)http://en.wikipedia.org/wiki/Unix_shell

 util is short for utilities.

 shutil is a utility module used to accomplish tasks which one often
 does when in the shell, such as copying, moving, or removing directory
 trees. But shutil (to my knowledge) is not implemented using shell
 commands or by running external programs, so it thus avoids a whole
 host of shell-related issues.

 It's not the best name, but what with backwards compatibility and all,
 it's unlikely to change any time soon.

 Cheers,
 Chris
 --http://rebertia.com

I had a hunch it might have been that.
-- 
http://mail.python.org/mailman/listinfo/python-list


[issue13031] [PATCH] small speed-up for tarfile.py when unzipping tarballs

2011-09-23 Thread Lars Gustäbel

Changes by Lars Gustäbel l...@gustaebel.de:


--
assignee:  - lars.gustaebel
nosy: +lars.gustaebel
priority: normal - low
versions: +Python 3.3 -Python 2.7, Python 3.2

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



[issue13032] h2py.py can fail with UnicodeDecodeError

2011-09-23 Thread Arfrever Frehtes Taifersar Arahesis

New submission from Arfrever Frehtes Taifersar Arahesis 
arfrever@gmail.com:

Tools/scripts/h2py.py fails with UnicodeDecodeError when a header file contains 
characters undecodable in current locale. I suggest to use binary mode. I'm 
attaching a patch.

--
components: Demos and Tools
files: h2py.py.patch
keywords: needs review, patch
messages: 144438
nosy: Arfrever, georg.brandl, haypo
priority: normal
severity: normal
status: open
title: h2py.py can fail with UnicodeDecodeError
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file23230/h2py.py.patch

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



[issue13032] h2py.py can fail with UnicodeDecodeError

2011-09-23 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
keywords: +easy

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



[issue13033] recursive chown for shutils

2011-09-23 Thread Low Kian Seong

New submission from Low Kian Seong kianse...@gmail.com:

Currently shutils chown still can't do a recursive chown. It would be nice to 
have this instead of having to do the looping dance we put our selves through 
each time we need recursion. Ruby's FileUtils already have this.

--
components: Library (Lib)
messages: 144439
nosy: Low.Kian.Seong
priority: normal
severity: normal
status: open
title: recursive chown for shutils
versions: Python 2.7

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



[issue13033] recursive chown for shutils

2011-09-23 Thread Eric V. Smith

Eric V. Smith e...@trueblade.com added the comment:

See also issue 12191, where there was a brief discussion of this.

--
nosy: +eric.smith

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



[issue13034] Python does not read Alternative Subject Names from SSL certificates larger than 1024 bits

2011-09-23 Thread Andrea Trasatti

New submission from Andrea Trasatti atrasa...@gmail.com:

We found a problem with SSL certificates, when they are larger than 1024 bits 
and you need to check Alternative Subject Names.
In our case we have a 2048 bit certificate, issued by Verisign for the domain 
developer.nokia.com. The certificate also covers other sub-domains, once of 
which is projects.developer.nokia.com. We found the issue using the mercurial 
client, but we dug down to SSLSocket.getpeercert. It looks like when the 
openSSL library reads the certificate it does not return any Alternative 
Subject Name, even though they are there. Using the standard openssl binary we 
could read the certificate with no problems and the alternative domain names 
are all there, including the one we need.

See below two examples, the first is our 2048 bit certificate and what Python 
returns. Then there is Google's code.google.com SSL certificate, 1024 bits and 
as you can see Python returns the other names correctly.

This was tested with Python 2.7.2.

Binary for projects.developer.nokia.com
'0\x82\x06\xb10\x82\x05\x99\xa0\x03\x02\x01\x02\x02\x10\x0e\xf6_f@\xe4\xd1gtU\x9e39Rn80\r\x06\t*\x86H\x86\xf7\r\x01\x01\x05\x05\x000\x81\xbc1\x0b0\t\x06\x03U\x04\x06\x13\x02US1\x170\x15\x06\x03U\x04\n\x13\x0eVeriSign,
Inc.1\x1f0\x1d\x06\x03U\x04\x0b\x13\x16VeriSign Trust 
Network1;09\x06\x03U\x04\x0b\x132Terms of use at https://www.verisign.com/rpa 
(c)101604\x06\x03U\x04\x03\x13-VeriSign Class 3 International Server CA - 
G30\x1e\x17\r11060800Z\x17\r120607235959Z0h1\x0b0\t\x06\x03U\x04\x06\x13\x02FI1\x0e0\x0c\x06\x03U\x04\x08\x13\x05Espoo1\x0e0\x0c\x06\x03U\x04\x07\x14\x05Espoo1\x0e0\x0c\x06\x03U\x04\n\x14\x05Nokia1\x0b0\t\x06\x03U\x04\x0b\x14\x02IT1\x1c0\x1a\x06\x03U\x04\x03\x14\x13developer.nokia.com0\x82\x010\r\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00\x03\x82\x01\x0f\x000\x82\x01\n\x02\x82\x01\x01\x00\xf8\xdeL\x8az\xbb\xa6\xddj\x14\x89X\xeeh\x87\x07\xbd\xb3\xc5=!
\xb9\x80\xe8\xe6v*\xec6w\x82\r\xb6b\x10\xb8\xe5\x06\x88w\xfd\x03\xa9\x82\x9d\xdf\xdb\xbft\xdb\x06\xc5\'\xdd\x83\x0e\
xf1GdM\x9a\x14\xefyO\x8e\x9dO,
\x92\xf8\xcf\xd3\xb3\xa8m\xc3@^\xa5\x0e\xfb$ddn\xc0\x1cV\xe4\xeaE\xce\x1eoG\xca\xf3\x01\xab\x08V\xd2\x91\x7f7\xbc\x90\x16\xd6b\xdb\x83(ySA\xccH\x1b\x807)^\xe9\x1c\xcaZr-\xc6\xf0\xe0\xb6\xde\x16c
W\x0b\xf4\xd24ei[E\xbaY\xc9[;
\xbbs\nQ\xfc\x1b_TiM\x8e\xb6\x9c9\x7f}\xa3\xfe\x96\xab\xa9\xb4\x8dn\\S\xfc\x08\xd5\x1a71
\xd3\x14\xaaF\xd0\xe4\xcf\x0f-\xf9\x10\xa7U\xf6\x92\xafQa\x8b\x02x\xc7V;
\xe2F\xf5 L\xe4\xc1\r\x1f\xec|
\x02\xee\xda\x9ej\xb3\xda\xda\x9b\xf8\xaf\xb5\xa2=\x1e\n\x14qf\xe7\xef\xbd\x8av\xe7l\x9d7\x93\xea\x11\x02\x03\x01\x00\x01\xa3\x82\x03\x000\x82\x02\xfc0\x82\x01I\x06\x03U\x1d\x11\x04\x82\x01@0\x82\x01\x82\x13developer.nokia.com\x82\x17www.developer.nokia.com\x82\x17aux.developer.nokia.com\x82\x16cc.developer.nokia.com\x82\x1cprojects.developer.nokia.com\x82\x17sso.developer.nokia.com\x82\x19stage.developer.nokia.com\x82\x17ejb.developer.nokia.com\x82\x16cm.developer.nokia.com\x82\x17dav.developer.nokia.com\x82\x1fdav.sandbox.developer.nokia.com\x
82\x1ect.sandbox.developer.nokia.com0\t\x06\x03U\x1d\x13\x04\x020\x000\x0b\x06\x03U\x1d\x0f\x04\x04\x03\x02\x05\xa00A\x06\x03U\x1d\x1f\x04:0806\xa04\xa02\x860http://SVRIntl-
G3-crl.verisign.com/SVRIntlG3.crl0D\x06\x03U\x1d
\x04=0;09\x06\x0b`\x86H\x01\x86\xf8E\x01\x07\x17\x030*0(\x06\x08+\x06\x01\x05\x05\x07\x02\x01\x16\x1chttps://www.verisign.com/rpa0(\x06\x03U\x1d%\x04!
0\x1f\x06\t`\x86H\x01\x86\xf8B\x04\x01\x06\x08+\x06\x01\x05\x05\x07\x03\x01\x06\x08+\x06\x01\x05\x05\x07\x03\x020r\x06\x08+\x06\x01\x05\x05\x07\x01\x01\x04f0d0$\x06\x08+\x06\x01\x05\x05\x070\x01\x86\x18http://ocsp.verisign.com0\x06\x08+\x06\x01\x05\x05\x070\x02\x860http://SVRIntl-
G3-
aia.verisign.com/SVRIntlG3.cer0n\x06\x08+\x06\x01\x05\x05\x07\x01\x0c\x04b0`\xa1^\xa0\\0Z0X0V\x16\timage/gif0!
0\x1f0\x07\x06\x05+\x0e\x03\x02\x1a\x04\x14Kk\xb9(\x96\x06\x0c\xbb\xd0R8\x9b)\xacK\x07\x8b!
\x05\x180\x16$http://logo.verisign.com/vslogo1.gif0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x05\x05\x00\x03\x82\x01\x01\x006N\x97\x1e\xba\x85\xcb\x1e
\xddO6\xf9\xf3\x16-\xb6\x05\x13\xec*\x00\x0f\xde\x89\xc1\xb7\xc1^\xf0\x8b0=C\x87\xf3|
zI\xe4\r\xedmD1\xc1\x06[GqMuV\xd9\x03\xdd\xa6\xbd2Z!
\x0c\xdf\x93\x9c\xc6\xba\x12\xd1\xaa\xd08\x1c\x82\x02\xd1\xb3\xeeK\xca\xcaEK\x07\xffR\xcfW\xae\xa0\x85\xeb\xc1h\xeb\r\xad\xd5\x92d\x82\xac\x03(\x07\xa1F\x82\x93\xdep\xe9\x9a\xf8O\xb1\xfc\xe0\xfat\xf4d\xa3q`\x05J\xb9\xdb\x9a\xb5o;
\xb7O\xaa/\xac\xba\xab\xc9\xd9)m\xf2c\xe8=\xc4\x95\xef\xe9\x92\xee\tlx\xe2\xfc\x87\xab\xbe\xde\xd4[\xc3\x85X\x8f\xf3\xe3\x89\xc9,
\\\xb2:\x9f\xf3\xe2\xf3\x81;
\xdbk\x9f\x1e\xbc\x00\xc7\x87@\xb3\xac\xdf\xe09\xfe:
\xef\n\xcf\xdaCZ\xc7\x07X\xd0\x0f\xf2nBKe\x1f\xd8\xcc\xb4\xa2%\x01\x0eE\nt{G\r\x9a\xfd\xaf\x97\xaf\xba\xb8\x983\xc5~\xd2\x1d\xdd\x04\x13*\xd3\xf3VK:'

Python dictionary extracted
{'notAfter': 'Jun  7 23:59:59 2012 GMT', 'subject': ((('countryName', u'FI'),), 
(('stateOrProvinceName', u'Espoo'),), (('localityName', u'Espoo'),), 

[issue13034] Python does not read Alternative Subject Names from SSL certificates larger than 1024 bits

2011-09-23 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
components: +Extension Modules
nosy: +giampaolo.rodola, janssen, pitrou

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



[issue13034] Python does not read Alternative Subject Names from SSL certificates larger than 1024 bits

2011-09-23 Thread Attila Csipa

Changes by Attila Csipa launch...@csipa.in.rs:


--
nosy: +achipa

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



[issue13031] [PATCH] small speed-up for tarfile.py when unzipping tarballs

2011-09-23 Thread poq

poq p...@gmx.com added the comment:

I don't think you even need the slice, if you use unpack_from.

--
nosy: +poq

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



[issue1625] bz2.BZ2File doesn't support multiple streams

2011-09-23 Thread ozan caglayan

ozan caglayan ozan...@gmail.com added the comment:

Attached patch is a revised version of bz2ms.patch against Python 2.7.2. The 
patch is tested using tarfile and bz2 modules. It also passes the included 
tests correctly.

It also imports a missing class from BytesIO to fix the tests.

It's up to you to take that into 2.7.x branch or not.

--
Added file: 
http://bugs.python.org/file23231/bz2-multiple-stream-support-issue1625.patch

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



[issue13035] maintainer value clear the author value when registering

2011-09-23 Thread Joshua Bronson

New submission from Joshua Bronson jabron...@gmail.com:

This issue was originally opened in the PyPI tracker but was dismissed on the 
theory that it's a bug in Python:

https://sourceforge.net/tracker/index.php?func=detailaid=3396924group_id=66150atid=513503



If in one package's setup.py I provide maintainer (with email) and author 
(whith email) after the python setup.py register ... upload I create a new 
package where I see the maintainer as a creator.

If I manually fix it through the pypi user interface it works, so seems that 
this is only a bug in the register procedure.


--
messages: 14
nosy: jab
priority: normal
severity: normal
status: open
title: maintainer value clear the author value when registering

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



[issue1625] bz2.BZ2File doesn't support multiple streams

2011-09-23 Thread Éric Araujo

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

We don’t add news features in stable releases.  Nadeem has closed this bug as 
fixed for 3.3 and it can’t go in 2.7, so I think we’re done here.

--

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



[issue11472] upload command fails to read auth information from .pypirc

2011-09-23 Thread Russell Keith-Magee

Russell Keith-Magee freakboy3...@gmail.com added the comment:

This isn't just a Python 3 issue -- I'm seeing this with the default Python 
install on OS X Snow Leopard (i.e. Python 2.6.1). Changing the .pypirc config 
line to [server-login] fixed the problem for me, too.

--
nosy: +freakboy3742

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



[issue13036] time format in logging is wrong

2011-09-23 Thread Yves Dorfsman

New submission from Yves Dorfsman y...@zioup.com:

The basic time format in the logging module uses a comma instead of a dot to 
separate the seconds from the tenth of seconds:

import logging
logging.basicConfig(format='%(asctime)s %(message)s')
logging.warning('hello')

2011-09-23 09:08:53,739 hello



Using a dot seems to be more accepted, see:

ls -l --full-time

Java's default dates

python's datetime.datetime.isoformat( datetime.datetime.now() )

--
components: Library (Lib)
messages: 17
nosy: y...@zioup.com
priority: normal
severity: normal
status: open
title: time format in logging is wrong
type: behavior
versions: Python 3.2

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



[issue13036] time format in logging is wrong

2011-09-23 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +belopolsky, vinay.sajip

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



[issue13036] time format in logging is wrong

2011-09-23 Thread Vinay Sajip

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

Logging's date/time representation is supposed to conform to ISO 8601.

From ISO Standard 8601 (Third Edition, dated 2004-12-01):

4.2.2.4 Representations with decimal fraction

If necessary for a particular application a decimal fraction of hour, minute or 
second may be included. If a decimal fraction is included, lower order time 
elements (if any) shall be omitted and the decimal fraction shall be divided 
from the integer part by the decimal sign specified in ISO 31-0, i.e. the comma 
[,] or full stop [.]. Of
these, the comma is the preferred sign.

--
resolution:  - invalid
status: open - closed

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



[issue13034] Python does not read Alternative Subject Names from SSL certificates larger than 1024 bits

2011-09-23 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Thanks for reporting. This trivial patch seems to fix it (still needs a test):

diff -r 1b4fae183da3 Modules/_ssl.c
--- a/Modules/_ssl.cTue Aug 09 18:48:02 2011 -0500
+++ b/Modules/_ssl.cFri Sep 23 18:16:04 2011 +0200
@@ -590,7 +590,7 @@ _get_peer_alt_names (X509 *certificate) 
 /* get a memory buffer */
 biobuf = BIO_new(BIO_s_mem());
 
-i = 0;
+i = -1;
 while ((i = X509_get_ext_by_NID(
 certificate, NID_subject_alt_name, i)) = 0) {
 

Yay for undocumented OpenSSL APIs with weird semantics.

--
assignee:  - pitrou
versions: +Python 3.2, Python 3.3

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



[issue7732] imp.find_module crashes Python if there exists a directory named __init__.py

2011-09-23 Thread Barry A. Warsaw

Barry A. Warsaw ba...@python.org added the comment:

Note that Python 2.6 is also vulnerable to the crash.  While we do not have an 
exploit, we did get a report on security@ which led to this bug.  I could be 
convinced to allow the patch to 2.6 on grounds that if the crasher can be 
exploited, better to apply it now rather than wait.  Certainly if it's easier 
to apply 2.6 and forward port, I'm fine with that.

Victor's pyfile_fromfile_close.patch looks good to me and fixes the problem 
with no discernible ill effects.  On IRC, he said he'll apply it to 2.7, 3.2, 
and 3.3.  I will approve it for 2.6 if he wants to apply it there too.

--
nosy: +barry
versions: +Python 2.6, Python 3.1

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



[issue7732] imp.find_module crashes Python if there exists a directory named __init__.py

2011-09-23 Thread Barry A. Warsaw

Changes by Barry A. Warsaw ba...@python.org:


--
versions:  -Python 3.1

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



[issue13031] small speed-up for tarfile.py when unzipping tarballs

2011-09-23 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
title: [PATCH] small speed-up for tarfile.py when unzipping tarballs - small 
speed-up for tarfile.py when unzipping tarballs

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



[issue13034] Python does not read Alternative Subject Names from SSL certificates larger than 1024 bits

2011-09-23 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

For the record, curl uses the (also undocumented) X509_get_ext_d2i() function 
instead.

--

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



[issue13033] Support recursivity in shutil.chown

2011-09-23 Thread Éric Araujo

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

Wasn’t there a python-ideas discussion on this?  If someone could find a link 
and summarize use cases it would be great.

--
nosy: +eric.araujo
title: recursive chown for shutils - Support recursivity in shutil.chown
type:  - feature request
versions: +Python 3.3 -Python 2.7

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



[issue13034] Python does not read Alternative Subject Names from SSL certificates larger than 1024 bits

2011-09-23 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy:  -giampaolo.rodola

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



[issue13033] Support recursivity in shutil.chown

2011-09-23 Thread Ezio Melotti

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

http://mail.python.org/pipermail/python-dev/2011-May/111661.html

--
nosy: +ezio.melotti

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



[issue13035] maintainer value clear the author value when registering

2011-09-23 Thread Éric Araujo

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

This was already discussed in #962772 (and reported again in #12840 :)

--
nosy: +eric.araujo
resolution:  - duplicate
stage:  - committed/rejected
status: open - closed
superseder:  - when both maintainer and author provided, author discarded

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



[issue13025] mimetypes should read the rule file using UTF-8, not the locale encoding

2011-09-23 Thread Éric Araujo

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

+1.  I’ve finally understood that open using the locale is Evil™.  Please use 
the file from Fedora in a test.

--
nosy: +eric.araujo

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



[issue10884] pkgutil EggInfoDistribution requirements for .egg-info metadata

2011-09-23 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
versions: +3rd party

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



[issue9395] clean does not remove all temp files

2011-09-23 Thread Éric Araujo

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

As I can’t recall what the bug was, closing.

--
assignee: tarek - eric.araujo
resolution:  - invalid
stage: test needed - committed/rejected
status: open - closed

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



[issue8927] Handle version incompatibilities in dependencies

2011-09-23 Thread Éric Araujo

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

Per Tarek’s pronouncement, closing.

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

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



[issue11751] Increase distutils.filelist / packaging.manifest test coverage

2011-09-23 Thread Éric Araujo

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

Hi Justin, is there any way I can help you move forward with this?  Please tell 
if you don’t have the time, I can work on completing the patch.

--

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



[issue11921] distutils2 should be able to compile an Extension based on the Python implementation

2011-09-23 Thread Éric Araujo

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

One remark: I’m not sure distutils2 *runs* at all on other VMs.  For one 
example, parsing sys.version to get the Python version relies on an 
implementation detail of CPython.

--

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



[issue9306] distutils: raise informative error message when cmd_class is None

2011-09-23 Thread Éric Araujo

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

Given that it is documented that the argument must be a dictionary, I’m 
rejecting this.

--
assignee: tarek - eric.araujo
resolution:  - wont fix
stage:  - committed/rejected
status: open - closed

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



[issue1092365] Distutils needs a way *not* to install files

2011-09-23 Thread Éric Araujo

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

We don’t have enough information to understand what the bug is and act on it.  
Closing as invalid, please reopen if you can clarify.

--
assignee: tarek - eric.araujo
dependencies:  -add a resource+files section in setup.cfg
resolution:  - invalid
stage:  - committed/rejected
status: open - closed

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



[issue13008] syntax error when pasting valid snippet into console without empty string after the function def

2011-09-23 Thread Éric Araujo

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

The example is not in our documentation.  I don’t see a bug, closing.

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

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



[issue7732] imp.find_module crashes Python if there exists a directory named __init__.py

2011-09-23 Thread Roundup Robot

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

New changeset 125887a41a6f by Victor Stinner in branch '3.2':
Issue #7732: Don't open a directory as a file anymore while importing a
http://hg.python.org/cpython/rev/125887a41a6f

New changeset 8c6fea5794b2 by Victor Stinner in branch 'default':
Merge 3.2: Issue #7732: Don't open a directory as a file anymore while
http://hg.python.org/cpython/rev/8c6fea5794b2

--
nosy: +python-dev

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



[issue13025] mimetypes should read the rule file using UTF-8, not the locale encoding

2011-09-23 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
stage:  - test needed
type:  - behavior

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



[issue13033] Add shutil.chowntree

2011-09-23 Thread Éric Araujo

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

Following Nick’s opinion in the thread, I’d prefer a distinct function.

--
title: Support recursivity in shutil.chown - Add shutil.chowntree

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



[issue7732] imp.find_module crashes Python if there exists a directory named __init__.py

2011-09-23 Thread Roundup Robot

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

New changeset 0f5b64630fda by Victor Stinner in branch '2.7':
Issue #7732: Fix a crash on importing a module if a directory has the same name
http://hg.python.org/cpython/rev/0f5b64630fda

--

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



[issue13031] small speed-up for tarfile.py when unzipping tarballs

2011-09-23 Thread Justin Peel

Justin Peel pee...@gmail.com added the comment:

poq,

You're quite right. I've added that change too. By the way, four unnecessary 
extra tuples are no longer being created for each call to this function too 
because of these changes.

--
Added file: http://bugs.python.org/file23232/cpython_tarfile2.diff

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



[issue13037] [Regression] socket.error does not inherit from IOError as documented

2011-09-23 Thread Christopher Egner

New submission from Christopher Egner cbeg...@gmail.com:

http://docs.python.org/library/socket.html#socket.error
Changed in version 2.6: socket.error is now a child class of IOError.

However, this is not the case.

$ python
Python 2.7.2 (default, Aug 18 2011, 18:26:35) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2
Type help, copyright, credits or license for more information.
 import socket
 isinstance( socket.error, IOError )
False


Catching IOError in except blocks does not catch socket.error, as one might 
expect according to the documentation.

--
components: IO
messages: 144467
nosy: Christopher.Egner
priority: normal
severity: normal
status: open
title: [Regression] socket.error does not inherit from IOError as documented
type: behavior
versions: Python 2.7

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



[issue13037] [Regression] socket.error does not inherit from IOError as documented

2011-09-23 Thread Christopher Egner

Christopher Egner cbeg...@gmail.com added the comment:

Or I could learn to type...

--
resolution:  - invalid
status: open - closed

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



[issue11725] httplib and urllib2 failed ssl connection httplib.BadStatusLine

2011-09-23 Thread Isaac Salsberg

Isaac Salsberg isalsb...@users.sourceforge.net added the comment:

The output for the command: 

   $ openssl s_client -connect www.finratrace.org:443

was the same on MAC OS X 10.6 and on Red hat 5 (https works fine under linux).

Nevertheless, Ned Deily is right: the bug is on the openssl libs supplied with 
OS X 10.6 

To solve this issue, I compiled and install OpenSSL 1.0.0d and then link python 
against this library.

This is the full recipe, step by step:

1. Install openssl. 
   Download the source tar for openssl. I used version openssl-1.0.0d.
   To build 64-bit library, then you have to invoke 
   './Configure darwin64-x86_64-cc' *manually*. Also, to make ssl work in 
python,
   the openssl libraries must be 'shared libraries'. 
   

   First, Expand the tar file into a temporary directory, I am using /tmp:
   
   $ cd /tmp
   
   $ tar xvzf openssl-1.0.0d.tar.gz
   
   $ cd openssl-1.0.0d
   

   To Build openssl as 64 bits shared libraries and install it:
   
   $ ./Configure darwin64-x86_64-cc shared
   
   $ make 
   
   $ make test # this step is optional
   
   $ sudo make install
   
   
   This will install openssl in the default directory: /usr/local/ssl
   
2. Compile and install python. 
   Download the source tar file. I used version Python 2.7.2
   
   a) Expand the tar file (again into a temporary directory)
   
   b) then go into the Modules folder
   
   c) vi the Setup.dist file, looking for the SSL string (if your are not 
familiar 
  with vi, you can use any text editor), then uncomment the lines BELLOW 
the 
  message:
  
   # Socket module helper for SSL support ...
   
  Your file must look as follows:
   
   
# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
SSL=/usr/local/ssl
_ssl _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -lssl -lcrypto
 
   

   d) Then using python defaults (installing under /usr/local) execute:
   
   $   ./configure 

   $ make

   $ make test # optional

   $ sudo make install
   

3. To test if python now has ssl support, start python and execute
   these commands (be sure you invoke the new python under /usr/local/bin):

imac:~ isaac$ /usr/local/bin/python
Python 2.7.2 (default, Jun 30 2011, 16:00:06) 
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type help, copyright, credits or license for more information.
 import httplib
 hasattr(httplib, 'HTTPS')
True
 # MUST be  True, otherwise has NO ssl support
... 
 import socket
 hasattr(socket,'ssl')
True
 # MUST be  True, otherwise has NO ssl support
... 
 import _ssl
 # should NOT give any error when importing
... 
 


That's all, now you have ssl support with python under MAC OS X 10.6

--

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



[issue13012] Allow keyword argument in str.splitlines()

2011-09-23 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

I agree with Alex. The poorly documented fact that *some* C-coded functions 
cannot accept arguments identified by keyword rather than position is a bit 
hole in the function abstraction.
+1 to the patch (and the int to bool change)

--
nosy: +terry.reedy

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



[issue12944] Accept arbitrary files for packaging's upload command

2011-09-23 Thread Jean-Paul Calderone

Jean-Paul Calderone invalid@example.invalid added the comment:

 pysetup run upload -f dist/spam-0.2.tar.gz -f dist/spam-0.2.exe

I'm not sure why it's run upload instead of just upload, but maybe that's 
the convention in pysetup.  Apart from that, this looks like a vast improvement 
to me.  As far as not supporting globs goes, I guess I don't really care either 
way.  If globs aren't supported, then I'll probably end up globbing somewhere 
else (or constructing the full upload list in some other automated way).  The 
motivation for the complaint is that too many things require manual 
interaction; I'm not going to use a new, easily automated utility manually. :)

--
nosy: +exarkun

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



[issue13013] _ctypes.c: refleak

2011-09-23 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

My impression is that plugging refleaks (unlike minor speedups) is a bugfix 
rather than feature addition, so this and the other issues should be marked for 
2.7 and 3.2 also. (I am only changing this one.)

Deprecating a public (but obscure) CAPI function is a separate issue that would 
only affect 3.3 at the earliest (with a PendingDeprecation or Deprecation 
warning) and would be in addition to plugging the potential leak in the 
existing code.

--
nosy: +terry.reedy
versions: +Python 2.7, Python 3.2

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



[issue13023] argparse should allow displaying argument default values in addition to setting a formatter class

2011-09-23 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
nosy: +bethard
stage:  - test needed
versions:  -Python 2.7, Python 3.2, Python 3.4

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



[issue13030] Be more generic when identifying the Windows main dir in installation doc

2011-09-23 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

Windows does not require that executables be on any particular 'drive'.

--
nosy: +terry.reedy

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



[issue13012] Allow keyword argument in str.splitlines()

2011-09-23 Thread Ezio Melotti

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

The attached patch adds 'keepends=' to a few calls and replaces 0/1 with 
False/True.  The patch can be applied after Mark's patch.  Doing two separate 
commits is probably better.

--
Added file: http://bugs.python.org/file23233/issue13012-repl.diff

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



[issue13023] argparse should allow displaying argument default values in addition to setting a formatter class

2011-09-23 Thread Zbyszek Szmek

Zbyszek Szmek zbys...@in.waw.pl added the comment:

Yeah, adding a formatter instance seems overkill for the usual case of wanting 
to preserver formatting of the epilog.

--
nosy: +zbysz

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



[issue10141] SocketCan support

2011-09-23 Thread Charles-François Natali

Charles-François Natali neolo...@free.fr added the comment:

  - dummy question: why an address is a tuple with 1 string instead of just
 the string? Does AF_UNIX also uses a tuple of 1 string?

I think the reason behind the tuple is future proofing.
Here's the definition of `struct sockaddr_can` in my Linux box's headers:

/**
 * struct sockaddr_can - the sockaddr structure for CAN sockets
 * @can_family:  address family number AF_CAN.
 * @can_ifindex: CAN network interface index.
 * @can_addr:protocol specific address information
 */
struct sockaddr_can {
sa_family_t can_family;
int can_ifindex;
union {
/* transport protocol class address information (e.g. ISOTP) */
struct { canid_t rx_id, tx_id; } tp;

/* reserved for future CAN protocols address information */
} can_addr;
};


By making it a tuple, it will be easier to extend the address that
must be passed to bind(2), should it ever evolve, in a backward
compatible way. Well, that's just a guess (I'm by no means a SocketCAN
expert :-).

  - the example should also use struct.pack() to create the frame, I don't
 like hardcoded BLOB

Done.

  - in test_socket: _have_socket_can() interprets permission denied as CAN
 is not supported, it would be nice to provide a better skip message. Create
 maybe a decorator based?

AFAICT, it shouldn't fail with EPERM or so.
Also, I'm not sure what the message would look like, and it's probably
a bit overkill.

  - _have_socket_can(): you may move s.close() outside the try block (add
 maybe a else: block?) because you may hide a real bug in .close()

Changed that.

  - data += b'\0' * (8 - can_dlc): I prefer data = data.ljust(8, '\x00')

Hum... Done.

  - you might add frame encoder/decoder in your example

Done.

  - if (!strcmp(PyBytes_AS_STRING(interfaceName), )) hum.
 PyBytes_GET_SIZE(intername)==0 should be enough

Done.

  - you truncate the interface name, it can be surprising, I would prefer an
 error (e.g. interface name too long: 20 characters, the maximum is 10
 characters ?)

I changed that, and added a test. Also, note that AF_PACKET suffers
from the same problem.
I'll submit a separate patch.

  - (oh no! don't include horrible configure diff in patches for the bug
 tracker :-p)

Yeah, I usually take care of that, but forgot this time.

 In which Linux version was CAN introduced?


Apparently, 2.6.25. Note that we don't need
@support.requires_linux_version() though, it should be catched by
HAVE_SOCKET_CAN (also, you can't use it as a class decorator...).

Here's the updated patch. It passes on all the buildbots (of course,
it's only relevant on Linux).

--
Added file: http://bugs.python.org/file23234/socketcan_v5.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10141
___diff -r a06ef7ab7321 Doc/library/socket.rst
--- a/Doc/library/socket.rstWed Sep 21 22:05:01 2011 +0200
+++ b/Doc/library/socket.rstFri Sep 23 23:27:19 2011 +0200
@@ -80,6 +80,11 @@
 If *addr_type* is TIPC_ADDR_ID, then *v1* is the node, *v2* is the
 reference, and *v3* should be set to 0.
 
+- A tuple ``(interface, )`` is used for the :const:`AF_CAN` address family,
+  where *interface* is a string representing a network interface name like
+  ``'can0'``. The network interface name ``''`` can be used to receive packets
+  from all network interfaces of this family.
+
 - Certain other address families (:const:`AF_BLUETOOTH`, :const:`AF_PACKET`)
   support specific representations.
 
@@ -216,6 +221,19 @@
in the Unix header files are defined; for a few symbols, default values are
provided.
 
+.. data:: AF_CAN
+  PF_CAN
+  SOL_CAN_*
+  CAN_*
+
+   Many constants of these forms, documented in the Linux documentation, are
+   also defined in the socket module.
+
+   Availability: Linux = 2.6.25.
+
+   .. versionadded:: 3.3
+
+
 .. data:: SIO_*
   RCVALL_*
 
@@ -387,10 +405,14 @@
 
Create a new socket using the given address family, socket type and protocol
number.  The address family should be :const:`AF_INET` (the default),
-   :const:`AF_INET6` or :const:`AF_UNIX`.  The socket type should be
-   :const:`SOCK_STREAM` (the default), :const:`SOCK_DGRAM` or perhaps one of 
the
-   other ``SOCK_`` constants.  The protocol number is usually zero and may be
-   omitted in that case.
+   :const:`AF_INET6`, :const:`AF_UNIX` or :const:`AF_CAN`. The socket type
+   should be :const:`SOCK_STREAM` (the default), :const:`SOCK_DGRAM`,
+   :const:`SOCK_RAW` or perhaps one of the other ``SOCK_`` constants. The
+   protocol number is usually zero and may be omitted in that case or
+   :const:`CAN_RAW` in case the address family is :const:`AF_CAN`.
+
+   .. versionchanged:: 3.3
+  The AF_CAN family was added.
 
 
 .. function:: socketpair([family[, type[, proto]]])
@@ -1213,7 +1235,7 @@
print('Received', repr(data))
 
 
-The 

[issue10141] SocketCan support

2011-09-23 Thread Charles-François Natali

Changes by Charles-François Natali neolo...@free.fr:


Removed file: http://bugs.python.org/file23225/socketcan_v4.patch

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



[issue13038] distutils windows installer STATUS_INVALID_CRUNTIME_PARAMETER (C0000417) exception when python dir is read only

2011-09-23 Thread Mitch Frazier

New submission from Mitch Frazier mi...@comwestcr.com:

Distutils built installers will fail on Windows with a run-time exception of 
STATUS_INVALID_CRUNTIME_PARAMETER, error-code: C417 if the python 
installation directory (e.g. C:\Python27) is read-only for the user running the 
installer.  I've experienced this with the pyside and pywin32 installers on 
Windows XP.

Using procmon I discovered that the installer fails when it tries to create the 
installation log file in the python install directory.  That led me to look at 
the directory which is when I discovered that it was read only for my user 
account.  It's read-only because the Python installer was run as Administrator 
and the other installers are being run from my user account.

Changing the directory to read-only for my account allows the installer to run 
without problem.

Perhaps the installer could check for this and provide a friendlier response.

--
assignee: tarek
components: Distutils
messages: 144477
nosy: eric.araujo, mitchfrazier, tarek
priority: normal
severity: normal
status: open
title: distutils windows installer STATUS_INVALID_CRUNTIME_PARAMETER (C417) 
exception when python dir is read only
type: crash
versions: Python 2.7

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



[issue13039] IDLE3 editor: shell-like behaviour on line starting with

2011-09-23 Thread etuardu

New submission from etuardu edo...@gmail.com:

In the editor window, if a line starts with the shell prompt string , 
backspacing is inhibited when reaching the first space, just like in the shell 
window.

OS: Linux 2.6.38-11-generic-pae #50-Ubuntu i386 GNU/Linux
Python version: 3.2
IDLE version: 3.2
Tk version: 8.5

--
components: IDLE
messages: 144478
nosy: etuardu
priority: normal
severity: normal
status: open
title: IDLE3 editor: shell-like behaviour on line starting with 
type: behavior
versions: Python 3.2

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



[issue1625] bz2.BZ2File doesn't support multiple streams

2011-09-23 Thread Nadeem Vawda

Nadeem Vawda nadeem.va...@gmail.com added the comment:

Ozan: Thanks for taking the time to backport the patch. Unfortunately, as
Éric said, 2.7 is in maintenance mode, so it no longer receives new features.

--

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



  1   2   >