ANN: phileas (=Python/Html Integration; Larry's Elegant Alternative scheme) 0.6 available

2011-01-03 Thread Larry Myerscough
Hippo's Techical Systems BV is proud to anounced that release 0.6 of 
'phileas' is available.


Phileas stands for:

   *P*ython *H*TML *I*ntegration - *L*arry's *E*legant *A*lternative
   *S*cheme

(The word 'elegant' is a matter of taste of course but it makes the 
acronym work!)


/Web-site/:
http://larry.myerscough.nl/phileas_project

/Description/:

   Phileas is actually a new take on some old ideas:

   The code in 'html40.py' allows html to be coded in a natural /[dare
   I say'pythonic'?]/ style, as the following fragment illustrates:


   from phileas.html40 import HTML40
   # .
   h = HTML40()
   # .
   h._(h.h1|'Major Heading',
h.p | (
 closing tags may be implied by use of the '|'
operator. with brackets where appropriate,
h.a(href=someUrl)|clickableLink,
h.br,
  ),
h.p, or be coded explicitly like this!,
~h.p,
   )

   As such, it covers similar ground to established packages like
   'HTMLgen' but I believe it is somewhat easier to use and leads to
   clearer code when nested tags and looping constructions are used. In
   fact, my intention is to make the practice of mixing templating
   constructions with python code unnecesary.

   The other files in the phileas package implement an object-oriented
   web-page framework, rather like psp's ('python server pages') but
   styled around the constructs in
   'html40.py'.

/Installation:/

   [You may wish/need to deviate from the followng instructions
   depending on your platform.]

   1.Create a directory 'phileas' in a location of your choice;
   make a note of the parent directory name
   2.Unzip the latest zip-file from
   http://larry.myerscough.nl/phileas_project into this directory.
   3.Create a file 'phileas.pth' in your python site-packages
   directory containg the name of the parent directory (forward slashes
   are ok, even on windows)
   4.Check that the above has worked by doing 'import phileas' 
   from a python shell; no news (no output) is good news.
   5.The rest is up to you; the other stuff on 
   http://larry.myerscough.nl may help you to get  started.


/A final note from the author:/

   I'm sure I need to improve a number of things before I have a
   package worth calling 1.0. I look forward to receiving input from
   the python community which will guide the necessary improvements.

   Larry Myerscough (aka 'papahippo')
   Hippos Technical Systems BV





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

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


asciitable 0.5.0

2011-01-03 Thread Tom Aldcroft
I'd like to announce the release of version 0.5.0 of asciitable, an
extensible module for reading and writing ASCII tables.  This release
features a new function to guess the table format from the supported
formats within asciitable.  This function is now called by default
within asciitable.read().

  http://cxc.harvard.edu/contrib/asciitable/#guess-table-format

Other updates include:

- Added support for whitespace (tab or space) delimited tables by
setting
  the delimiter parameter to \s.
- Improved support for RDB tables by parsing the second line which
specifies
  column type and (optionally) width.  These values are written out if
  available when writing an RDB table.
- More rigorous checking of format compatibility for several table
formats.

Regards,
Tom Aldcroft
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

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


[ANN] Python courses 2011

2011-01-03 Thread Mike Müller

Python Courses 2011
===

Our schedule of public Python courses for 2011 is taking shape.
This year we added some new topics such as Cython and XML processing with
Python. If you are interested in other Python topics just let me now.

Also, if you would like to teach about a Python topic you are an expert in,
just drop me a line.


Courses taught in English
-

February 14 - 18, 2011 Python - Software Development Training for
   Cheminformatics (Leipzig, Germany)
May 13 - 15, 2011  Python for Programmers (Leipzig, Germany)
May 16 - 20, 2011  Python Power Course (Leipzig, Germany)
   including:
   * Advanced Python
   * Optimizing Python Programs
   * Python Extensions with Other Languages
   * Fast Code with the Cython Compiler
   * High Performance XML with Python
June 3 - 5, 2011   Introduction to Python and Python for Scientists
   and Engineers (Golden, CO, USA)
August 22 - 24, 2011   Python for Programmers (Leipzig, Germany)
August 25 - 27, 2011   Python for Scientists and Engineers (Leipzig, Germany)

More information:
http://www.python-academy.com/courses/dates.html


Courses taught in German


Jan. 31 - Feb. 2, 2011 Pythonkurs bei Aberla (Zürich, Switzerland)
April 4 - 6, 2011  Python für Programmierer (Leipzig, Germany)
April 7 - 9, 2011  Django Python Web-Framework (Leipzig, Germany)

More information:
http://www.python-academy.de/Kurse/termine.html

--
Mike
mmuel...@python-academy.de
--
http://mail.python.org/mailman/listinfo/python-announce-list

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


Pygments 1.4 Unschärfe released

2011-01-03 Thread Georg Brandl
I've just uploaded the Pygments 1.4 packages to CheeseShop. Pygments is a
generic syntax highlighter written in Python.

Download it from http://pypi.python.org/pypi/Pygments, or look at the
demonstration at http://pygments.org/demo.

As always, many thanks go to Tim Hatch for writing or integrating many
of the bug fixes and new features in this release.  Of course, thanks
to all other contributors too!


Enjoy,
Georg



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

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


First release of Proteus

2011-01-03 Thread ced
Proteus is a Python library to access Tryton [1] server.  (Tryton is a
three-tiers high-level general purpose application platform)

It can be used through XML-RPC or by using trytond as module and
provides an
Active Record pattern enabling you to interact pythonically with your
Tryton
server.

Its common usages are:
- scripting for automatic actions
- scenario testing
- automatic setup
- basement for a CLI (with iPython, bpython etc.)
- basement for a minimal client

Here is some example usage:

At first you import the necessary functions

 from proteus import config, Model, Wizard

Then you can create a database and install the `party` module into it

 config = config.set_trytond(':memory:',
database_type='sqlite')
 Module = Model.get('ir.module.module')
 party, = Module.find([('name', '=', 'party')])
 Module.button_install([party.id], config.context)
 Wizard('ir.module.module.install_upgrade').execute('start')

We will then create a party, set her name and even her language

 Party = Model.get('party.party')
 party = Party()
 party.name = 'ham'
 party.save()
 party.name
u'ham'
 party.id  0
True

Notice how addresses (which are a One2Many field for the party model)
are
handled just like Python list objects:

 Address = Model.get('party.address')
 address = Address()
 party.addresses.append(address)
 party.save()
 party.addresses #doctest: +ELLIPSIS
[proteus.Model.get('party.address')(...)]

More on http://pypi.python.org/pypi/proteus/1.8.0

[1] http://www.tryton.org/
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

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


Re: Tkinter: The good, the bad, and the ugly!

2011-01-03 Thread Octavian Rasnita
From: Hank Fay hank...@gmail.com
Subject: Re: Tkinter: The good, the bad, and the ugly!

 That (the desktop app issue) was the big game-change for me.  It looks like a 
 desktop app, it acts like a desktop app, and our enterprise customers would 
 be delighted to a) have no installs to do for fat clients; or b) not have to 
 run a TS or Citrix farm. 
 


It looks like a desktop app, but it doesn't fully act like a desktop app.

Not all the computer users are using a mouse and not all of them can see, but 
the good desktop apps are very accessible for those users who can't do those 
things.

Octavian


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


A quesstion with matplotlib

2011-01-03 Thread 余亮罡
Dear all,
I have a quesstion about change the width of the ylabel.You know the width 
of the ylabel is relaete to the x axi,how can i change the width of the ylabel 
not depend on the width of the x-axis?
Thank you!
 George




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


Re: list 2 dict?

2011-01-03 Thread Glazner
On Jan 2, 3:18 pm, Octavian Rasnita orasn...@gmail.com wrote:
 Hi,

 If I want to create a dictionary from a list, is there a better way than the 
 long line below?

 l = [1, 2, 3, 4, 5, 6, 7, 'a', 8, 'b']

 d = dict(zip([l[x] for x in range(len(l)) if x %2 == 0], [l[x] for x in 
 range(len(l)) if x %2 == 1]))

 print(d)

 {8: 'b', 1: 2, 3: 4, 5: 6, 7: 'a'}

 Thanks.

 Octavian

this is efficient

l = [1,2,3,4,5,6]
 dict(izip(islice(l,0,len(l),2),islice(l,1,len(l),2)))
{1: 2, 3: 4, 5: 6}
-- 
http://mail.python.org/mailman/listinfo/python-list


Arisingsoft provides the Norton antivirus all in one security suite.

2011-01-03 Thread mani ma
hai,

Uses : The package includes a personal firewall, phishing protection
and the ability to detect and remove malware.
Norton 360 is compatible with 32-bit editions of Windows XP and 32-bit
or 64-bit editions of Windows Vista.Windows 7 support has been added.
Reviews cited Norton 360's low resource usage, relative to Norton
Internet Security 2007, and phishing protection.

 
http://www.arisingsoft.com/2010_11_14_archive.html
 http://www.arisingsoft.com/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: String building using join

2011-01-03 Thread Alexander Gattin
Hello,

On Sun, Jan 02, 2011 at 10:11:50AM -0800, Alex
Willmer wrote:
 def prg3(l):
 return '\n'.join([str(x) for x in l if x])

just one fix (one fix one fix one fix):
return '\n'.join([str(x) for x in l if x is not None])

-- 
With best regards,
xrgtn
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is there anyway to run JavaScript in python?

2011-01-03 Thread Diez B. Roggisch
crow wen...@gmail.com writes:

 Hi, I'm writing a test tool to simulate Web browser. Is there anyway
 to run JavaScript in python? Thanks in advance.

Not really. Yes, you can invoke spidermonkey. But the crucial point
about running JS is not executing JS, it's about having the *DOM* of the
browser available. Which spidermonkey obviously hasn't.

So, I recommend using Selenium. 

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


Re: Interrput a thread

2011-01-03 Thread Diez B. Roggisch
gervaz ger...@gmail.com writes:

 On 31 Dic 2010, 23:25, Alice Bevan–McGregor al...@gothcandy.com
 wrote:
 On 2010-12-31 10:28:26 -0800, John Nagle said:

  Even worse, sending control-C to a multi-thread program
  is unreliable in CPython.  See http://blip.tv/file/2232410;
  for why.  It's painful.

 AFIK, that has been resolved in Python 3.2 with the introduction of an
 intelligent thread scheduler as part of the GIL release/acquire process.

         - Alice.

 Ok, but then suppose I have multiple long running threads that I want
 to delete/suspend because they are tooking too much time, which
 solution do you propose?

If possible, use multiple processes instead.

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


Re: CPython on the Web

2011-01-03 Thread azakai
On Jan 2, 5:55 pm, Gerry Reno gr...@verizon.net wrote:
 I tried printing sys.path and here is the output:

 ['', '/usr/local/lib/python27.zip', '/usr/local/lib/python2.7/',
 '/usr/local/lib/python2.7/plat-linux2',
 '/usr/local/lib/python2.7/lib-tk', '/usr/local/lib/python2.7/lib-old',
 '/usr/local/lib/lib-dynload']

 Now, those paths must be on your machine because they are not on my
 client machine.  But the interpreter is now running on MY machine.  Well
 in a sandbox really.  So how is that going to work?


Yeah, those are the paths on the machine where the binary was compiled
(so, they are the standard paths on ubuntu).

Anyhow the filesystem can't (and shouldn't) be accessed from inside a
browser page. I think we will implement a minimal virtual filesystem
here, just enough for stuff to work. The actual implementation would
use HTML5 features like local storage etc.

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


Re: CPython on the Web

2011-01-03 Thread Diez B. Roggisch
azakai alonmozi...@gmail.com writes:

 Hello, I hope this will be interesting to people here: CPython running
 on the web,

 http://syntensity.com/static/python.html

 That isn't a new implementation of Python, but rather CPython 2.7.1,
 compiled from C to JavaScript using Emscripten and LLVM. For more
 details on the conversion process, see http://emscripten.org

A fun hack. Have you bothered to compare it to the PyPy javascript
backend - perfomance-wise, that is?

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


Re: Interrput a thread

2011-01-03 Thread gervaz
On 3 Gen, 17:47, de...@web.de (Diez B. Roggisch) wrote:
 gervaz ger...@gmail.com writes:
  On 31 Dic 2010, 23:25, Alice Bevan–McGregor al...@gothcandy.com
  wrote:
  On 2010-12-31 10:28:26 -0800, John Nagle said:

   Even worse, sending control-C to a multi-thread program
   is unreliable in CPython.  See http://blip.tv/file/2232410;
   for why.  It's painful.

  AFIK, that has been resolved in Python 3.2 with the introduction of an
  intelligent thread scheduler as part of the GIL release/acquire process.

          - Alice.

  Ok, but then suppose I have multiple long running threads that I want
  to delete/suspend because they are tooking too much time, which
  solution do you propose?

 If possible, use multiple processes instead.

 Diez- Nascondi testo citato

 - Mostra testo citato -

Multiple processes, ok, but then regarding processes' interruption
there will be the same problems pointed out by using threads?

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


Re: Interrput a thread

2011-01-03 Thread Jean-Paul Calderone
On Jan 3, 3:22 pm, gervaz ger...@gmail.com wrote:
 On 3 Gen, 17:47, de...@web.de (Diez B. Roggisch) wrote:



  gervaz ger...@gmail.com writes:
   On 31 Dic 2010, 23:25, Alice Bevan–McGregor al...@gothcandy.com
   wrote:
   On 2010-12-31 10:28:26 -0800, John Nagle said:

Even worse, sending control-C to a multi-thread program
is unreliable in CPython.  See http://blip.tv/file/2232410;
for why.  It's painful.

   AFIK, that has been resolved in Python 3.2 with the introduction of an
   intelligent thread scheduler as part of the GIL release/acquire process.

           - Alice.

   Ok, but then suppose I have multiple long running threads that I want
   to delete/suspend because they are tooking too much time, which
   solution do you propose?

  If possible, use multiple processes instead.

  Diez- Nascondi testo citato

  - Mostra testo citato -

 Multiple processes, ok, but then regarding processes' interruption
 there will be the same problems pointed out by using threads?


No.  Processes can be terminated easily on all major platforms.  See
`os.kill`.

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


Re: Interrput a thread

2011-01-03 Thread Adam Skutt
On Jan 3, 4:06 pm, Jean-Paul Calderone calderone.jeanp...@gmail.com
wrote:

  Multiple processes, ok, but then regarding processes' interruption
  there will be the same problems pointed out by using threads?

 No.  Processes can be terminated easily on all major platforms.  See
 `os.kill`.


Yes, but that's not the whole story, now is it?  It's certainly much
more reliable and easier to kill a process.  It's not any easier to do
it and retain defined behavior, depending on exactly what you're
doing.  For example, if you kill it while it's in the middle of
updating shared memory, you can potentially incur undefined behavior
on the part of any process that can also access shared memory.

In short, taking a program that uses threads and shared state and
simply replacing the threads with processes will likely not gain you a
thing.  It entirely depends on what those threads are doing and how
they do it.

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


Re: CPython on the Web

2011-01-03 Thread Gerry Reno
On 01/03/2011 03:10 PM, azakai wrote:
 On Jan 2, 5:55 pm, Gerry Reno gr...@verizon.net wrote:
   
 I tried printing sys.path and here is the output:

 ['', '/usr/local/lib/python27.zip', '/usr/local/lib/python2.7/',
 '/usr/local/lib/python2.7/plat-linux2',
 '/usr/local/lib/python2.7/lib-tk', '/usr/local/lib/python2.7/lib-old',
 '/usr/local/lib/lib-dynload']

 Now, those paths must be on your machine because they are not on my
 client machine.  But the interpreter is now running on MY machine.  Well
 in a sandbox really.  So how is that going to work?

 
 Yeah, those are the paths on the machine where the binary was compiled
 (so, they are the standard paths on ubuntu).

 Anyhow the filesystem can't (and shouldn't) be accessed from inside a
 browser page. 

Well, the local filesystem could be accessible with the user's
permission and this should be an option.


Regards,
Gerry

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


Re: Interesting bug

2011-01-03 Thread John Machin
On Jan 2, 12:22 am, Daniel Fetchinson fetchin...@googlemail.com
wrote:

 An AI bot is playing a trick on us.

Yes, it appears that the mystery is solved: Mark V. Shaney is alive
and well and living in Bangalore :-)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: CPython on the Web

2011-01-03 Thread Gerry Reno
On 01/03/2011 03:13 PM, Diez B. Roggisch wrote:

 A fun hack. Have you bothered to compare it to the PyPy javascript
 backend - perfomance-wise, that is?

 Diez
   

I don't think that exists anymore.  Didn't that get removed from PyPy
about 2 years ago?


Regards,
Gerry

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


Re: Interrput a thread

2011-01-03 Thread gervaz
On 3 Gen, 22:17, Adam Skutt ask...@gmail.com wrote:
 On Jan 3, 4:06 pm, Jean-Paul Calderone calderone.jeanp...@gmail.com
 wrote:



   Multiple processes, ok, but then regarding processes' interruption
   there will be the same problems pointed out by using threads?

  No.  Processes can be terminated easily on all major platforms.  See
  `os.kill`.

 Yes, but that's not the whole story, now is it?  It's certainly much
 more reliable and easier to kill a process.  It's not any easier to do
 it and retain defined behavior, depending on exactly what you're
 doing.  For example, if you kill it while it's in the middle of
 updating shared memory, you can potentially incur undefined behavior
 on the part of any process that can also access shared memory.

 In short, taking a program that uses threads and shared state and
 simply replacing the threads with processes will likely not gain you a
 thing.  It entirely depends on what those threads are doing and how
 they do it.

 Adam

As per the py3.1 documentation, os.kill is only available in the Unix
os. Regarding the case pointed out by Adam I think the best way to
deal with it is to create a critical section so that the shared memory
will be updated in an atomic fashion. Btw it would be useful to take a
look at some actual code/documentation in order to understand how
others dealt with the problem...

Ciao,

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


Re: Interrput a thread

2011-01-03 Thread Jean-Paul Calderone
On Jan 3, 4:17 pm, Adam Skutt ask...@gmail.com wrote:
 On Jan 3, 4:06 pm, Jean-Paul Calderone calderone.jeanp...@gmail.com
 wrote:



   Multiple processes, ok, but then regarding processes' interruption
   there will be the same problems pointed out by using threads?

  No.  Processes can be terminated easily on all major platforms.  See
  `os.kill`.

 Yes, but that's not the whole story, now is it?  It's certainly much
 more reliable and easier to kill a process.  It's not any easier to do
 it and retain defined behavior, depending on exactly what you're
 doing.  For example, if you kill it while it's in the middle of
 updating shared memory, you can potentially incur undefined behavior
 on the part of any process that can also access shared memory.

Then don't use shared memory.


 In short, taking a program that uses threads and shared state and
 simply replacing the threads with processes will likely not gain you a
 thing.  It entirely depends on what those threads are doing and how
 they do it.


Of course.  The whole point here is not about threads vs processes.
It's about shared memory concurrency vs non-shared memory
concurrency.  You can implement both with threads and both with
processes, but threads are geared towards shared memory and processes
are geared towards non-shared memory.  So what most people mean by
use processes is don't use shared memory.

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


SUNLisp 2: Josh vs. Kenny Flamewars Galore!!

2011-01-03 Thread kenny
All they agree on is Common Lisp! Come join the Yobbos of MCNA at the
Frog  Toad for booze, vino, and great food and knock down drag out
debates galore on everything from Cells to Lisp IDEs:

When: Tomorrow Tuesday, at 7pm
Where: http://www.thefrogandtoadpub.com/

HK

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


Re: CPython on the Web

2011-01-03 Thread Diez B. Roggisch
Gerry Reno gr...@verizon.net writes:

 On 01/03/2011 03:13 PM, Diez B. Roggisch wrote:

 A fun hack. Have you bothered to compare it to the PyPy javascript
 backend - perfomance-wise, that is?

 Diez
   

 I don't think that exists anymore.  Didn't that get removed from PyPy
 about 2 years ago?

Ah, didn't know that. I was under the impression pyjamas was done with
it. Apparently, that's wrong:

 http://pyjs.org/

But then I re-phrase my question: how does this relate to pyjamas/pyjs?

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


Re: Interrput a thread

2011-01-03 Thread Diez B. Roggisch
gervaz ger...@gmail.com writes:

 On 3 Gen, 22:17, Adam Skutt ask...@gmail.com wrote:
 On Jan 3, 4:06 pm, Jean-Paul Calderone calderone.jeanp...@gmail.com
 wrote:



   Multiple processes, ok, but then regarding processes' interruption
   there will be the same problems pointed out by using threads?

  No.  Processes can be terminated easily on all major platforms.  See
  `os.kill`.

 Yes, but that's not the whole story, now is it?  It's certainly much
 more reliable and easier to kill a process.  It's not any easier to do
 it and retain defined behavior, depending on exactly what you're
 doing.  For example, if you kill it while it's in the middle of
 updating shared memory, you can potentially incur undefined behavior
 on the part of any process that can also access shared memory.

 In short, taking a program that uses threads and shared state and
 simply replacing the threads with processes will likely not gain you a
 thing.  It entirely depends on what those threads are doing and how
 they do it.

 Adam

 As per the py3.1 documentation, os.kill is only available in the Unix
 os. Regarding the case pointed out by Adam I think the best way to
 deal with it is to create a critical section so that the shared memory
 will be updated in an atomic fashion. Btw it would be useful to take a
 look at some actual code/documentation in order to understand how
 others dealt with the problem...

There is the multiprocessing module. It's a good start, and works
cross-platform.

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


Re: Interrput a thread

2011-01-03 Thread Adam Skutt
On Jan 3, 5:05 pm, gervaz ger...@gmail.com wrote:
 Regarding the case pointed out by Adam I think the best way to
 deal with it is to create a critical section so that the shared memory
 will be updated in an atomic fashion.

Ok, so if the OS kills the process between taking the lock and
releasing it, what are you going to do?  Handled naively, you can end
up in a deadlock situation[1]. If a process has locked a semaphore and
then terminates, the semaphore retains its current value: all other
processes waiting on the semaphore will still be waiting, and any new
processes that access the semaphore will wait as well.  In short, if a
process holding a semaphore dies, you have to manually unlock it.

For signals that the process intends to handle, you can always disable
them before taking the lock and reenable them after releasing it.  Or,
you can install signal handlers in each process that ensure everything
is properly cleaned up when the signal is delivered.  Which solution
is right depends on what you're doing.

For signals you don't intend to handle (SIGSEGV) or cannot handle
(SIGKILL) there's not much you can do.  It's potentially dangerous to
continue on after a child has received such a signal, so the right
solution may be to literally do nothing and let the deadlock occur.
If you must do cleanup, it must be done carefully.  The key thing to
understand is that the problems with killing threads haven't gone
away: delivering the please die message isn't the hard part; it's
safely cleaning up the thread in such a way it doesn't break the rest
of the application!  This problem still exists if you replace threads
with processes (assuming you're using shared memory).

As such, the better thing to do, if possible, is to avoid shared
memory and use constructs like pipes and sockets for I/O.  They have
much better defined failure semantics, and do allow you a modicum of
fault isolation.  At the very least, graceful shutdown is much easier.

HTH,
Adam

[1] For SIGINT from the terminal, the right thing /might/ happen.
Strong emphasis on the might.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: CPython on the Web

2011-01-03 Thread Gerry Reno
On 01/03/2011 05:55 PM, Diez B. Roggisch wrote:
 Gerry Reno gr...@verizon.net writes:

   
 On 01/03/2011 03:13 PM, Diez B. Roggisch wrote:
 
 A fun hack. Have you bothered to compare it to the PyPy javascript
 backend - perfomance-wise, that is?

 Diez
   
   
 I don't think that exists anymore.  Didn't that get removed from PyPy
 about 2 years ago?
 
 Ah, didn't know that. I was under the impression pyjamas was done with
 it. Apparently, that's wrong:

  http://pyjs.org/

 But then I re-phrase my question: how does this relate to pyjamas/pyjs?

 Diez
   

From what I've seen so far:

Pyjamas is taking your python code and converting it into javascript so
that your python code (converted to javascript) can run in a browser.

CPotW is taking the whole python interpreter and converting the
interpreter into javascript so that the python interpreter runs in the
browser.  Your python code remains as python code.


Regards,
Gerry

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


Re: Interrput a thread

2011-01-03 Thread Adam Skutt
On Jan 3, 5:24 pm, Jean-Paul Calderone calderone.jeanp...@gmail.com
wrote:
 Of course.  The whole point here is not about threads vs processes.
 It's about shared memory concurrency vs non-shared memory
 concurrency.  You can implement both with threads and both with
 processes, but threads are geared towards shared memory and processes
 are geared towards non-shared memory.  So what most people mean by
 use processes is don't use shared memory.


This is entirely my presumption, but I think if the OP were keenly
aware of the differences between thread and processes, it's pretty
likely he wouldn't have asked his question in the first place.

Also, I've written lots and lots of use processes code on multiple
platforms, and much of it has used some sort of shared memory
construct.  It's actually pretty common, especially in code bases with
a lot of history.  Not all the world is Apache.

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


Re: SUNLisp 2: Josh vs. Kenny Flamewars Galore!!

2011-01-03 Thread Thomas 'PointedEars' Lahn
kenny crossposted bullshit over 5 newsgroups again:

 […]

JFTR: *PLONK*
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: CPython on the Web

2011-01-03 Thread astar
On Jan 2, 4:58 pm, pyt...@bdurham.com wrote:
 Azakai/Gerry,

  Errors when using Firefox 3.6.3:



firefox 3.6.13 openbsd i386 4.8 -current
error console has some errors:

editor not defined
module not define
too much recursion

nothing interested happened on the web page, but wonderful project
anyway

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


Python comparison matrix

2011-01-03 Thread Alex Willmer
I've created a spreadsheet that compares the built ins, features and modules of 
the CPython releases so far. For instance it shows: 
- basestring was first introduced at version 2.3 then removed in version 3.0
- List comprehensions (PEP 202) were introduced at version 2.0.
- apply() was a built in throughout the 1.x and 2.x series, but was deprecated 
in from 2.3 and removed in 3.0
- Generator functions were first introduced in 2.2 with __future__ import, from 
2.3 they were fully supported

https://spreadsheets.google.com/pub?key=0At5kubLl6ri7dHU2OEJFWkJ1SE16NUNvaGg2UFBxMUE

The current version covers CPython 1.5 - 3.2 on these aspects:
- Built in types and functions
- Keywords
- Modules
- Interpreter switches and environment variables
- Platforms, including shipped Python version(s) for major Linux distributions
- Features/PEPs (incomplete)

I gathered the data from the documentation at python.org. It's work in progress 
so there are plenty of rough edges and holes, but I'd like to get your 
opinions, feedback and suggestions.
- Would you find such a document useful? 
- What format(s) would be most useful to you (e.g. spreadsheet, pdf, web 
page(s), database, wall chart, desktop background)?
- Are there other aspects/pages that you'd like to see included?
- Do you know of source(s) for which versions of CPython supported which 
operating systems (e.g. the first and last Python release that works on Windows 
98 or Mac OS 9)? The best I've found so far is PEP 11

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


Re: Python comparison matrix

2011-01-03 Thread Antoine Pitrou
On Mon, 3 Jan 2011 16:17:00 -0800 (PST)
Alex Willmer a...@moreati.org.uk wrote:
 I've created a spreadsheet that compares the built ins, features and modules 
 of the CPython releases so far. For instance it shows: 

A couple of errors:
- BufferError is also in 3.x
- IndentationError is also in 3.x
- object is also in 3.x
- NotImplemented is not an exception type, it's a built-in singleton
  like None
- you forgot VMSError (only on VMS) :-)

Regards

Antoine.


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


Re: Python comparison matrix

2011-01-03 Thread python
Alex,

I think this type of documentation is incredibly useful!

Is there some type of key which explains symbols like !, *, f, etc?

Thanks for sharing this work with the community.

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


Re: CPython on the Web

2011-01-03 Thread azakai
On Jan 3, 12:13 pm, de...@web.de (Diez B. Roggisch) wrote:
 A fun hack. Have you bothered to compare it to the PyPy javascript
 backend - perfomance-wise, that is?


Gerry already gave a complete and accurate answer to the status of
this project in comparison to PyPy and pyjamas. Regarding performance,
this hack is not currently fast, primarily because the code is not
optimized yet.

But through a combination of optimizations on the side of Emscripten
(getting all LLVM optimizations to work when compiling to JS) and on
the side of the browsers (optimizing accesses on typed arrays in JS,
etc.), then I hope the code will eventually run quite fast, even
comparably to C.

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


Re: Python comparison matrix

2011-01-03 Thread Alex Willmer
On Tuesday, January 4, 2011 12:54:24 AM UTC, Malcolm wrote:
 Alex,
 
 I think this type of documentation is incredibly useful!

Thank you.

 Is there some type of key which explains symbols like !, *, f, etc?

There is a key, it's the second tab from the end, '!' wasn't documented and I 
forgot why I marked bytes() thusly, so I've removed it.
 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python comparison matrix

2011-01-03 Thread Alex Willmer
Thank you Antoine, I've fixed those errors. Going by the docs, I have VMSError 
down as first introduced in Python 2.5.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: CPython on the Web

2011-01-03 Thread azakai
On Jan 3, 12:23 pm, Gerry Reno gr...@verizon.net wrote:
 On 01/03/2011 03:10 PM, azakai wrote:









  On Jan 2, 5:55 pm, Gerry Reno gr...@verizon.net wrote:

  I tried printing sys.path and here is the output:

  ['', '/usr/local/lib/python27.zip', '/usr/local/lib/python2.7/',
  '/usr/local/lib/python2.7/plat-linux2',
  '/usr/local/lib/python2.7/lib-tk', '/usr/local/lib/python2.7/lib-old',
  '/usr/local/lib/lib-dynload']

  Now, those paths must be on your machine because they are not on my
  client machine.  But the interpreter is now running on MY machine.  Well
  in a sandbox really.  So how is that going to work?

  Yeah, those are the paths on the machine where the binary was compiled
  (so, they are the standard paths on ubuntu).

  Anyhow the filesystem can't (and shouldn't) be accessed from inside a
  browser page.

 Well, the local filesystem could be accessible with the user's
 permission and this should be an option.


Hmm, I think this might be possible with the HTML5 File API. Would
definitely be useful here.

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


Re: Multiple instances and wrong parental links

2011-01-03 Thread DevPlayer

Mere are my ramblings of a novice (bad) Hobbyst programmer.

You mentioned that your having a hard time coming up with a solution
to your complex problem. Complex means you are doing lots of different
things to different things all over the place where timing is an
issue.

First it seems you are trying to simplify your problem by creating a
generic class you might call Element which is held in an ElementList
class. Right?

Or is it you would like you to create a new class for each unique
element? If this is the case it would be because each unique element -
behaves- differently. Is this the case? Or do all XML elements
basically behave the same? If they behave the same you're confusing
your design. A class  represents a unique behavior. Remember instances
can have unique attributes like code or title. But I'm digressing.

For example in your other discussion you posted at:
https://groups.google.com/forum/#!topic/comp.lang.python/K9PinAbuCJk/discussion
you say:

So, an element like:

market code=WotF
titleWriters of the Future/title
/market

Or is the element structure?:

some_classname code=some_value
titlesome value/title
/some_classname

Or is it like this?

some_classname some_tokenname=value
sub_elementvalue/subelement
/some_classname

Or like this?

some_classname some_tokenname=value
sub_elementvalue/subelement
sub_elementvalue/subelement
...
/some_classname

Or this, typical XML?

some_classname some_tokenname=value
sub_elementvalue/subelement
sub_elementvalue/subelement
...
some_classname some_tokenname=value
sub_elementvalue/subelement
sub_elementvalue/subelement
...
/some_classname
/some_classname


And is sub_element nested or only one sub deep?

Ask yourself why do you need to have a different class for each unique
element type? Or in other words, why do you need a new class for each
XML tag pair?

If your elements are nested to some unknown depth, perhaps broaden
your idea of your ElementList into an ElementTree.

Take a look at the section Basic Usage midway down at url:
http://effbot.org/zone/element-index.htm


Or change you Market Class stucture(in your other discussion) to make
it more dimensional by adding a tag attribute which would
mark it as if it were a certain class.

class ElementNode(objec):
def__init__(self, parent, elem)
self.parent = parent# another elementNode object or None
self.elem = elem # entire text block or just do offsets
(i.e. file line numbers)
self.tag = self.get_tag(elem)   # market  tag==class
self.token = self.get_token(self) # code or whatever if
variable
self.sub_elems= self.get_subs(elem) # recursive ElementNodes;
return a list or dict

self.root = self.get_root(parent)   # optional but handy
# I like to use the root as the XML source; sometimes an
XML file
self.next = None   # because I love double link lists
# probably useful for that ObjectListView wxPython widget


If in your case each Element does behave differently (ie has unique
methods) then perhaps you should be looking at some other solution.
Perhaps class factories or meta classes. I can't help you there.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: String building using join

2011-01-03 Thread Kushal Kumaran
On Mon, Jan 3, 2011 at 3:07 AM, gervaz ger...@gmail.com wrote:
 On 2 Gen, 19:14, Emile van Sebille em...@fenx.com wrote:
 snip

 class Test:
       def __init__(self, v1, v2):
           self.v1 = v1
           self.v2 = v2

 t1 = Test(hello, None)
 t2 = Test(None, ciao)
 t3 = Test(salut, hallo)
 t = [t1, t2, t3]

 \n.join([y for x in t for y in [x.v1,x.v2] if y])



 snip

 Thanks Emile, despite that now the solution runs in quadratic time I
 guess. I could also provide a __str__(self) representation, but in my
 real code I don't have access to the class. Also using str() on an
 empty object (i.e. None), the representation is 'None'.


Since no one else has mentioned it, I'll just point out that Emile's
solution does not run in quadratic time.  It has the same number of
operations as the originally posted code.

That str(None) results in None is not a problem because of the if
y test in the list comprehension.

-- 
regards,
kushal
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python comparison matrix

2011-01-03 Thread Tomasz Rola
On Mon, 3 Jan 2011, Alex Willmer wrote:

 I've created a spreadsheet that compares the built ins, features and 
 modules of the CPython releases so far. For instance it shows: 
[...]
 I gathered the data from the documentation at python.org. It's work in 
 progress so there are plenty of rough edges and holes, but I'd like to 
 get your opinions, feedback and suggestions. 
 - Would you find such a document useful? 

Yes, definitely.  Great idea, thanks for doing this.

 - What format(s) would be most useful to you (e.g. spreadsheet, pdf, web 
 page(s), database, wall chart, desktop background)?

I would vote for html/web pages with pdf as an option (i.e. a link), if 
you find it easy enough to make. This probably means you would like to 
have the source in a form that allows generation of both pages and pdf 
without much trouble. In this case, it seems there are more than few 
options to choose from.

Perhaps in a form of Python code doing the job, with data in hashtables? 
That would be so Pythonish :-).

 - Are there other aspects/pages that you'd like to see included?
 - Do you know of source(s) for which versions of CPython supported which 
 operating systems (e.g. the first and last Python release that works on 
 Windows 98 or Mac OS 9)? The best I've found so far is PEP 11

Nothing comes to my head ATM.

Regards,
Tomasz Rola

--
** A C programmer asked whether computer had Buddha's nature.  **
** As the answer, master did rm -rif on the programmer's home**
** directory. And then the C programmer became enlightened...  **
** **
** Tomasz Rola  mailto:tomasz_r...@bigfoot.com **
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: CPython on the Web

2011-01-03 Thread MrJean1
FireFox 3.6.13 on MacOS X Tiger (10.4.11) fails:

  Error: too much recursion
  Error: Modules is not defined
  Source File: http://synthensity.com/static/python.html

/Jean

On Jan 2, 11:26 pm, Wolfgang Strobl ne...@mystrobl.de wrote:
 azakai alonmozi...@gmail.com:

 On Jan 2, 4:58 pm, pyt...@bdurham.com wrote:
  Azakai/Gerry,

   Errors when using Firefox 3.6.3:

  I'm running Firefox 3.6.1.3 and the interpreter is running fine.

 I guess that meant FIrefox 3.6.13 (without the last dot), the current
 stable version.

 I'm using Firefox 3.6.13 (german) on Windowx XP (32bit, german) here,
 and the interpreter is running fine, too.  Same for Chrome 8.0.552.224.

 --
 Wir danken f r die Beachtung aller Sicherheitsbestimmungen

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


Re: list 2 dict?

2011-01-03 Thread DevPlayer
An adaptation to Hrvoje Niksic's recipe

Use a dictionary comprehention instead of a list comprehension or
function call:

lyst = [1, 2, 3, 4, 5, 6, 7, 'a', 8, 'b']

it = iter( lyst )
dyct = {i:it.next() for i in it}  # I'm using {} and not [] for those
with tiny fonts.

#print dyct
{8: 'b', 1: 2, 3: 4, 5: 6, 7: 'a'}

Of course check for an even number of elements to the original list
to avoid exceptions or dropping the last element on traps.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: CPython on the Web

2011-01-03 Thread MrJean1
FYI,

The example

  http://syntensity.com/static/python.html

works fine in Safari 4.1.3 on MacOS X Tiger (10.4.11).

/Jean


On Jan 3, 5:59 pm, azakai alonmozi...@gmail.com wrote:
 On Jan 3, 12:23 pm, Gerry Reno gr...@verizon.net wrote:





  On 01/03/2011 03:10 PM, azakai wrote:

   On Jan 2, 5:55 pm, Gerry Reno gr...@verizon.net wrote:

   I tried printing sys.path and here is the output:

   ['', '/usr/local/lib/python27.zip', '/usr/local/lib/python2.7/',
   '/usr/local/lib/python2.7/plat-linux2',
   '/usr/local/lib/python2.7/lib-tk', '/usr/local/lib/python2.7/lib-old',
   '/usr/local/lib/lib-dynload']

   Now, those paths must be on your machine because they are not on my
   client machine.  But the interpreter is now running on MY machine.  Well
   in a sandbox really.  So how is that going to work?

   Yeah, those are the paths on the machine where the binary was compiled
   (so, they are the standard paths on ubuntu).

   Anyhow the filesystem can't (and shouldn't) be accessed from inside a
   browser page.

  Well, the local filesystem could be accessible with the user's
  permission and this should be an option.

 Hmm, I think this might be possible with the HTML5 File API. Would
 definitely be useful here.

 - azakai

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


Re: list 2 dict?

2011-01-03 Thread Paul Rubin
Octavian Rasnita orasn...@gmail.com writes:
 If I want to create a dictionary from a list...
 l = [1, 2, 3, 4, 5, 6, 7, 'a', 8, 'b']

dict(l[i:i+2] for i in xrange(0,len(l),2))

seems simplest to me.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: CPython on the Web

2011-01-03 Thread John Nagle

On 1/1/2011 11:26 PM, azakai wrote:

Hello, I hope this will be interesting to people here: CPython running
on the web,

http://syntensity.com/static/python.html

That isn't a new implementation of Python, but rather CPython 2.7.1,
compiled from C to JavaScript using Emscripten and LLVM. For more
details on the conversion process, see http://emscripten.org


   It's a cute hack, but it's about 1000 times slower than CPython.

Try

def cnt(n) :
j = 0
for i in xrange(n) :
j = j + 1
return(j)

print(cnt(100))

with this.  It will take 30 seconds or so to count to a million.

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


Re: Interrput a thread

2011-01-03 Thread Jean-Paul Calderone
On Jan 3, 6:17 pm, Adam Skutt ask...@gmail.com wrote:
 On Jan 3, 5:24 pm, Jean-Paul Calderone calderone.jeanp...@gmail.com
 wrote:

  Of course.  The whole point here is not about threads vs processes.
  It's about shared memory concurrency vs non-shared memory
  concurrency.  You can implement both with threads and both with
  processes, but threads are geared towards shared memory and processes
  are geared towards non-shared memory.  So what most people mean by
  use processes is don't use shared memory.

 This is entirely my presumption, but I think if the OP were keenly
 aware of the differences between thread and processes, it's pretty
 likely he wouldn't have asked his question in the first place.


Fair enough. :)

 Also, I've written lots and lots of use processes code on multiple
 platforms, and much of it has used some sort of shared memory
 construct.  It's actually pretty common, especially in code bases with
 a lot of history.  Not all the world is Apache.


Hee hee, Apache. :)

 Adam

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


Re: CPython on the Web

2011-01-03 Thread azakai
On Jan 3, 10:11 pm, John Nagle na...@animats.com wrote:
 On 1/1/2011 11:26 PM, azakai wrote:

  Hello, I hope this will be interesting to people here: CPython running
  on the web,

 http://syntensity.com/static/python.html

  That isn't a new implementation of Python, but rather CPython 2.7.1,
  compiled from C to JavaScript using Emscripten and LLVM. For more
  details on the conversion process, seehttp://emscripten.org

     It's a cute hack, but it's about 1000 times slower than CPython.

 Try

 def cnt(n) :
      j = 0
      for i in xrange(n) :
          j = j + 1
      return(j)

 print(cnt(100))

 with this.  It will take 30 seconds or so to count to a million.

                                         John Nagle

Yes, as I said, the code isn't optimized (so
don't expect good performance) :)

It can get much faster with more work.

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


[issue10632] multiprocessing generates a fatal error

2011-01-03 Thread Brian Quinlan

Changes by Brian Quinlan br...@sweetapp.com:


--
stage:  - needs patch

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-03 Thread Etienne Robillard

Etienne Robillard e...@gthcfoundation.org added the comment:

On 02/01/11 10:50 PM, Glenn Linderman wrote:
 Glenn Linderman v+pyt...@g.nevcal.com added the comment:

 Rereading the doc link I pointed at, I guess detach() is part of the new API 
 since 3.1, so doesn't need to be checked for in 3.1+ code... but instead, may 
 need to be coded as:

 try:
 sys.stdin = sys.stdin.detach()
 except UnsupportedOperation:
 pass

 --

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue4953
 ___
   

Hi!

using detach would be great but I'm missing that method here in 2.7! :-)

e...@localhost:~$ python2.7
Python 2.7.1 (r271:86832, Jan  2 2011, 10:38:30)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build)] on linux2
Type help, copyright, credits or license for more information.
 sys.stdin.detach
Traceback (most recent call last):
  File stdin, line 1, in module
NameError: name 'sys' is not defined
 import sys
 sys.stdin.detach
Traceback (most recent call last):
  File stdin, line 1, in module
AttributeError: 'file' object has no attribute 'detach'

--
title: cgi module cannot handle POST with multipart/form-data in 3.0 - cgi 
module cannot handle POST with multipart/form-data in   3.0

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-03 Thread Etienne Robillard

Etienne Robillard e...@gthcfoundation.org added the comment:

i'm thinking this issue is also well connected to:

http://bugs.python.org/issue1573931

so a backport of whatever solution comes to 3.2 would be a great
addition to Python 2.6 as the very minimum, in order to satisfy
minimal backward compatibility!

Thanks,

On 02/01/11 10:50 PM, Glenn Linderman wrote:
 Glenn Linderman v+pyt...@g.nevcal.com added the comment:

 Rereading the doc link I pointed at, I guess detach() is part of the new API 
 since 3.1, so doesn't need to be checked for in 3.1+ code... but instead, may 
 need to be coded as:

 try:
 sys.stdin = sys.stdin.detach()
 except UnsupportedOperation:
 pass

 --

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue4953
 ___


--

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



[issue10348] multiprocessing: use SysV semaphores on FreeBSD

2011-01-03 Thread STINNER Victor

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

Martin fixed test_concurrent_futures (#10798), this issue can be implemented 
later.

--
type:  - feature request
versions: +Python 3.3 -Python 3.2

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



[issue8013] time.asctime segfaults when given a time in the far future

2011-01-03 Thread STINNER Victor

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

 http://docs.python.org/library/time.html#time-y2kissues
 Values 100–1899 are always illegal.

Why are these values illegal? The GNU libc accepts year in [1900-2^31; 2^31-1] 
(tm_year in [-2147483648; 2147481747]). If time.accept2dyear=False, we should 
at least accept years in [1; ]. The system libc would raise an error 
(return NULL) if it doesn't know how to format years older than 1900.

--

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



[issue10812] Add some posix functions

2011-01-03 Thread Ross Lagerwall

New submission from Ross Lagerwall rosslagerw...@gmail.com:

Here's a patch that adds a bunch of posix functions that are missing from the 
posix module. Includes tests  documentation.

Tested on Linux  FreeBSD.

Specifically:
futimes
lutimes
futimens
fexecve
gethostid
sethostname
waitid
lockf
readv
pread
writev
pwrite
truncate
posix_fallocate
posix_fadvise
sync

--
components: Extension Modules
files: mpos.patch
keywords: patch
messages: 125162
nosy: georg.brandl, giampaolo.rodola, gregory.p.smith, loewis, pitrou, 
rosslagerwall
priority: normal
severity: normal
status: open
title: Add some posix functions
type: feature request
versions: Python 3.3
Added file: http://bugs.python.org/file20239/mpos.patch

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



[issue10786] unittest.TextTextRunner does not respect redirected stderr

2011-01-03 Thread Michael Foord

Michael Foord mich...@voidspace.org.uk added the comment:

Thanks Terry. Done. Doc changes committed revision 87679.

--
keywords:  -patch
nosy:  -MarkRoddy, terry.reedy
resolution:  - accepted
stage: needs patch - committed/rejected
status: open - closed
type: feature request - behavior

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



[issue10813] Suppress adding decimal point for places=0 in moneyfmt()

2011-01-03 Thread Carsten Grohmann

New submission from Carsten Grohmann carstengrohm...@gmx.de:

Hi,

the documentation of the decimal module contains a small recipe called 
moneyfmt() for format decimal values. It's very usefull.

I'd like to suggest a small improvement because the output is incorrect with 
given dp=. (default) and places=0.

Example:
 moneyfmt(decimal.Decimal('-0.02'), neg='', trailneg='', places=1)
'0.0'
 moneyfmt(decimal.Decimal('-0.02'), neg='', trailneg='', places=0)
'0.'

Change:
--- moneyfmt.py 2011-01-03 13:56:32.774169788 +0100
+++ moneyfmt.py.new 2011-01-03 13:56:58.130165330 +0100
@@ -33,7 +33,8 @@
 build(trailneg)
 for i in range(places):
 build(next() if digits else '0')
-build(dp)
+if places:
+build(dp)
 if not digits:
 build('0')
 i = 0

What do you think about the change?

Regrads,
Carsten

--
assignee: d...@python
components: Documentation
messages: 125164
nosy: cgrohmann, d...@python
priority: normal
severity: normal
status: open
title: Suppress adding decimal point for places=0 in moneyfmt()

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



[issue6800] os.exec* raises OSError: [Errno 45] Operation not supported in a multithreaded application

2011-01-03 Thread Ross Lagerwall

Ross Lagerwall rosslagerw...@gmail.com added the comment:

I tested this on FreeBSD 8.1 - it outputs 'hello world'.

I think this should be closed - i think the os.exec* functions should mirror 
the operating system exec* functions. If the platform has a limitation then so 
be it.

And it seems like the latest versions of those platforms have overcome this 
limitation anyway.

--
nosy: +rosslagerwall

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



[issue5162] multiprocessing cannot spawn child from a Windows service

2011-01-03 Thread Mher Movsisyan

Mher Movsisyan mher.movsis...@gmail.com added the comment:

Attached test case demonstrates the issue.

--
nosy: +mher
Added file: http://bugs.python.org/file20240/test_issue5162.py

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



[issue5162] multiprocessing cannot spawn child from a Windows service

2011-01-03 Thread Mher Movsisyan

Mher Movsisyan mher.movsis...@gmail.com added the comment:

Treating python services like frozen executables solves the issue. The patch is 
attached.

--
Added file: http://bugs.python.org/file20241/forking_r87679.patch

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



[issue10060] python.exe crashes or hangs on help() modules when bad modules found

2011-01-03 Thread R. David Murray

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

Dev: I have no idea how what you just posted relates to the subject of this 
issue.  Could you clarify please?

--

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



[issue10775] assertRaises as a context manager should accept a 'msg' keyword argument.

2011-01-03 Thread Michael Foord

Michael Foord mich...@voidspace.org.uk added the comment:

I'm fine with this functionality being added in 3.3.

--

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



[issue10814] assertion failed on Windows buildbots

2011-01-03 Thread Antoine Pitrou

New submission from Antoine Pitrou pit...@free.fr:

See e.g. http://www.python.org/dev/buildbot/all/builders/x86%20XP-4%203.1

test_time
f:\dd\vctools\crt_bld\self_x86\crt\src\asctime.c(130) : Assertion failed: ( ( 
tb-tm_mday = 1 )  ( ( ( _days[ tb-tm_mon + 1 ] - _days[ tb-tm_mon ] ) = 
tb-tm_mday ) || ( ( IS_LEAP_YEAR( tb-tm_year + 1900 ) )  ( tb-tm_mon == 1 
)  ( tb-tm_mday = 29 ) ) ) )
program finished with exit code -1073740777

(don't know about 2.6 but it's likely to crash there too)

--
components: Library (Lib), Tests
messages: 125170
nosy: amaury.forgeotdarc, belopolsky, benjamin.peterson, db3l, georg.brandl, 
pitrou
priority: critical
severity: normal
stage: needs patch
status: open
title: assertion failed on Windows buildbots
type: crash
versions: Python 2.7, Python 3.1

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



[issue6800] os.exec* raises OSError: [Errno 45] Operation not supported in a multithreaded application

2011-01-03 Thread Antoine Pitrou

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

Agreed, not a Python bug.

--
nosy: +pitrou
resolution:  - rejected
status: open - closed

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



[issue10814] assertion failed on Windows buildbots

2011-01-03 Thread STINNER Victor

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

Regression introduced by r87648 (issue #8013).

--
nosy: +haypo

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



[issue8013] time.asctime segfaults when given a time in the far future

2011-01-03 Thread STINNER Victor

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

test_time fails with an (C) assertion error on Windows: see issue #10814.

--

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



[issue10812] Add some posix functions

2011-01-03 Thread Antoine Pitrou

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

First couple comments:
- you don't have to modify Misc/NEWS yourself; it will probably make patch 
maintenance easier
- it would seem more natural for readv() to take a sequence of writable buffers 
(such as bytearrays) instead; I don't think the current signature is very useful
- readv() and writev() should support both lists and tuples, at the minimum 
(perhaps arbitrary iterables if you like to spend more time on it :-)): see the 
PySequence* API

--

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



[issue10815] Write to /dev/full does not raise IOError

2011-01-03 Thread Michal Vyskocil

New submission from Michal Vyskocil mvysko...@suse.cz:

Write to /dev/full in python3 don't raise IOError. Python2 works as expected, 
the close call causes an IOError exception with no space left on device message.

$ python
Python 2.7 (r27:82500, Aug 07 2010, 16:54:59) [GCC] on linux2
Type help, copyright, credits or license for more information.
 f = open('/dev/full', 'w')
 f.write('s')
 f.close()
Traceback (most recent call last):
  File stdin, line 1, in module
IOError: [Errno 28] No space left on device

However using python3 I don't get an IOError after close
$ python3
Python 3.1.2 (r312:79147, Nov 20 2010, 11:33:28) 
[GCC 4.5.1 20101001 [gcc-4_5-branch revision 164883]] on linux2
Type help, copyright, credits or license for more information.
 f = open('/dev/full', 'w')
 f.write('s')
1
 f.close()

The only one way how to raise IOError in python3 is call f.flush()

...
 f.write('s')
1
 f.flush()
Traceback (most recent call last):
  File stdin, line 1, in module
IOError: [Errno 28] No space left on device

Documentation of io.IOBase.close() [1] said Flush and close this stream, so one 
should expect calls f.flush();f.close() will be the same as plain f.close().

[1] http://docs.python.org/py3k/library/io.html

--
components: IO
messages: 125175
nosy: mvyskocil
priority: normal
severity: normal
status: open
title: Write to /dev/full does not raise IOError
versions: Python 3.1

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



[issue10512] regrtest ResourceWarning - unclosed sockets and files

2011-01-03 Thread STINNER Victor

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

* r87680 fixes test_sockserver
 * r87681 fixes test_timeout
 * r87682 fixes test_tk
 * r87683 fixes test_xmlrpc
 * r87684 fixes test_socket

r87682, r87683, r87684 are patches from Nadeem Vawda.

On my Linux box, I am unable to get the warning on test_cgi or 
test_normalization.

--
nosy: +haypo

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



[issue10815] Write to /dev/full does not raise IOError

2011-01-03 Thread STINNER Victor

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

This issue is fixed in Python 3.2 beta 2:

$ ./python 
 f=open(/dev/full, wb)
 f.write(b'x')
1
 f.close()
IOError: [Errno 28] No space left on device
 ^D

sys:1: ResourceWarning: unclosed file _io.BufferedWriter name='/dev/full'
sys:1: ResourceWarning: unclosed file _io.FileIO name='/dev/full' mode='wb'


If you would like to get the error earlier, disable the buffer (which is not 
completly possible for a text file, Python requires at least a line buffer).

Backport the fix to Python 3.1 is not a good idea because it may break programs 
using Python 3.1.

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

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-03 Thread R. David Murray

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

Etienne: since this is about solving a 3.x specific problem, it will not get 
backported.  Issue 1573931 looks unrelated to me at a quick glance.  FYI, you 
will find that you *do* have detach in 2.7 if you open a file using the io 
subsystem (import io).  Of course, that isn't used for the std files in 2.7.

Glen: the new IO subsystem is a complete C layer on top of only the most basic 
of the C runtime stuff.  It does handle cross platform issues.  Given that, and 
given that the input to CGI *should* be bytes, I think letting an error raise 
if the stream is text and detatch isn't available is fine, though we might find 
we want to catch it to improve the error message with extra context.

Pierre: yes, that diff is what I was looking for.  I hope to have time to look 
it over later today.

--

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



[issue10806] Subprocess error if fds 0,1,2 are closed

2011-01-03 Thread Antoine Pitrou

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

This new patch makes tests more comprehensive (closes all combinations of the 
three standard fds).

--
Added file: http://bugs.python.org/file20242/sp3.patch

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



[issue10816] test_multiprocessing: unclosed sockets

2011-01-03 Thread STINNER Victor

New submission from STINNER Victor victor.stin...@haypocalc.com:

test_remote (__main__.WithManagerTestRemoteManager) ... 
/home/haypo/prog/GIT/py3k/Lib/multiprocessing/managers.py:812: ResourceWarning: 
unclosed socket.socket object, fd=8, family=2, type=1, proto=0
  util.debug('... decref failed %s', e)
ok


test_pool_initializer (__main__.TestInitializers) ... 
/home/haypo/prog/GIT/py3k/Lib/multiprocessing/managers.py:831: ResourceWarning: 
unclosed socket.socket object, fd=9, family=1, type=1, proto=0
  util.info('incref failed: %s' % e)
ok


test_pool_in_process (__main__.TestStdinBadfiledescriptor) ... 
/home/haypo/prog/GIT/py3k/Lib/multiprocessing/managers.py:831: ResourceWarning: 
unclosed socket.socket object, fd=9, family=1, type=1, proto=0
  util.info('incref failed: %s' % e)
/home/haypo/prog/GIT/py3k/Lib/multiprocessing/managers.py:831: ResourceWarning: 
unclosed socket.socket object, fd=9, family=1, type=1, proto=0
  util.info('incref failed: %s' % e)
/home/haypo/prog/GIT/py3k/Lib/multiprocessing/managers.py:831: ResourceWarning: 
unclosed socket.socket object, fd=13, family=1, type=1, proto=0
  util.info('incref failed: %s' % e)
/home/haypo/prog/GIT/py3k/Lib/multiprocessing/managers.py:831: ResourceWarning: 
unclosed socket.socket object, fd=13, family=1, type=1, proto=0
  util.info('incref failed: %s' % e)
/home/haypo/prog/GIT/py3k/Lib/multiprocessing/managers.py:831: ResourceWarning: 
unclosed socket.socket object, fd=13, family=1, type=1, proto=0
  util.info('incref failed: %s' % e)
/home/haypo/prog/GIT/py3k/Lib/multiprocessing/managers.py:831: ResourceWarning: 
unclosed socket.socket object, fd=13, family=1, type=1, proto=0
  util.info('incref failed: %s' % e)
/home/haypo/prog/GIT/py3k/Lib/multiprocessing/managers.py:831: ResourceWarning: 
unclosed socket.socket object, fd=13, family=1, type=1, proto=0
  util.info('incref failed: %s' % e)
/home/haypo/prog/GIT/py3k/Lib/multiprocessing/managers.py:831: ResourceWarning: 
unclosed socket.socket object, fd=13, family=1, type=1, proto=0
  util.info('incref failed: %s' % e)
ok


test_queue_in_process (__main__.TestStdinBadfiledescriptor) ... 
/home/haypo/prog/GIT/py3k/Lib/multiprocessing/managers.py:831: ResourceWarning: 
unclosed socket.socket object, fd=9, family=1, type=1, proto=0
  util.info('incref failed: %s' % e)
/home/haypo/prog/GIT/py3k/Lib/multiprocessing/managers.py:831: ResourceWarning: 
unclosed socket.socket object, fd=9, family=1, type=1, proto=0
  util.info('incref failed: %s' % e)
/home/haypo/prog/GIT/py3k/Lib/multiprocessing/managers.py:831: ResourceWarning: 
unclosed socket.socket object, fd=13, family=1, type=1, proto=0
  util.info('incref failed: %s' % e)
/home/haypo/prog/GIT/py3k/Lib/multiprocessing/managers.py:831: ResourceWarning: 
unclosed socket.socket object, fd=13, family=1, type=1, proto=0
  util.info('incref failed: %s' % e)
ok

--
components: Library (Lib)
messages: 125180
nosy: haypo
priority: normal
severity: normal
status: open
title: test_multiprocessing: unclosed sockets
versions: Python 3.2

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-03 Thread Etienne Robillard

Etienne Robillard e...@gthcfoundation.org added the comment:

On 03/01/11 09:45 AM, R. David Murray wrote:
 R. David Murray rdmur...@bitdance.com added the comment:

 Etienne: since this is about solving a 3.x specific problem, it will not get 
 backported.  Issue 1573931 looks unrelated to me at a quick glance.  FYI, you 
 will find that you *do* have detach in 2.7 if you open a file using the io 
 subsystem (import io).  Of course, that isn't used for the std files in 2.7.

 Glen: the new IO subsystem is a complete C layer on top of only the most 
 basic of the C runtime stuff.  It does handle cross platform issues.  Given 
 that, and given that the input to CGI *should* be bytes, I think letting an 
 error raise if the stream is text and detatch isn't available is fine, though 
 we might find we want to catch it to improve the error message with extra 
 context.

 Pierre: yes, that diff is what I was looking for.  I hope to have time to 
 look it over later today.

 --

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue4953
 ___
   

Thanks for theses precisions, David.

So will cgi.FieldStorage still be usable in 3.x using 2.5 semantics ?
implementing the size argument
in the FieldStorage class would surely be a good fix for WSGI middlewares. 

Either ways (using the new io subsystem) or monkey-patching
cgi.FieldStorage so it accepts the size argument could probably helps to
resolve memory-usage issues with things like file uploads!

Regards

--

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



[issue6075] Patch for IDLE/OS X to work with Tk-Cocoa

2011-01-03 Thread Kevin Walzer

Kevin Walzer wordt...@users.sourceforge.net added the comment:

Ned--thank you for reviewing, testing, and modifying the patch. I applied your 
revised version to my new install of Python 2.7.1 and it works fine.

--

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



[issue10814] assertion failed on Windows buildbots

2011-01-03 Thread Alexander Belopolsky

Changes by Alexander Belopolsky belopol...@users.sourceforge.net:


--
assignee:  - belopolsky

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



[issue10812] Add some posix functions

2011-01-03 Thread Antoine Pitrou

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

For the record, I get the following failures under OpenSolaris:

==
ERROR: test_lutimes (test.test_posix.PosixTester)
--
Traceback (most recent call last):
  File /home/antoine/py3k/cc/Lib/test/test_posix.py, line 265, in test_lutimes
posix.lutimes(support.TESTFN, None)
AttributeError: 'module' object has no attribute 'lutimes'

==
ERROR: test_posix_fallocate (test.test_posix.PosixTester)
--
Traceback (most recent call last):
  File /home/antoine/py3k/cc/Lib/test/test_posix.py, line 236, in 
test_posix_fallocate
posix.posix_fallocate(fd, 0, 10)
OSError: [Errno 22] Invalid argument

--

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



[issue10502] Add unittestguirunner to Tools/

2011-01-03 Thread Michael Foord

Michael Foord mich...@voidspace.org.uk added the comment:

Committed revision 87685. 

It would be nice to see this included in the Mac OS X and Windows distribution, 
but I guess that applies to the *whole* Tools/ directory.

--
resolution:  - accepted
stage: needs patch - committed/rejected
status: open - closed

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



[issue10816] test_multiprocessing: unclosed sockets

2011-01-03 Thread STINNER Victor

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

Ok, I found it: fixed by r87686

--
resolution:  - fixed
status: open - closed

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



[issue10817] urllib.request.urlretrieve never raises ContentTooShortError if no reporthook

2011-01-03 Thread Robert Cheng

New submission from Robert Cheng robert.h.ch...@gmail.com:

When reporthook is None, size variable is not computed and defaulted to -1. 
Thus, without reporthook, ContentTooShortError is not raised even when 
Content-Length header is supplied and download size is less than expected 
amount, contrary to the documentation.

--
components: Library (Lib)
messages: 125186
nosy: RC
priority: normal
severity: normal
status: open
title: urllib.request.urlretrieve never raises ContentTooShortError if no 
reporthook
type: behavior
versions: Python 2.7

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-03 Thread Giampaolo Rodola'

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


--
nosy:  -giampaolo.rodola

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



[issue10817] urllib.request.urlretrieve never raises ContentTooShortError if no reporthook

2011-01-03 Thread Senthil Kumaran

Changes by Senthil Kumaran orsent...@gmail.com:


--
assignee:  - orsenthil
nosy: +orsenthil

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



[issue10812] Add some posix functions

2011-01-03 Thread Antoine Pitrou

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

According to the posix_fallocate() man page under OpenSolaris:

 EINVALThe len argument is less than or equal to zero, or
   the  offset  argument  is  less  than zero, or the
   underlying  file  system  does  not  support  this
   operation.

I would go for the third (last) interpretation: the filesystem (ZFS here) 
doesn't support it.

--

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



[issue9115] test_site: support for systems without unsetenv

2011-01-03 Thread Zsolt Cserna

Zsolt Cserna zsolt.cse...@morganstanley.com added the comment:

I confirm that this patch fixes the problem. Thanks.

On my systems I haven't seen other bugs related to unsetenv - however, it might 
be useful to fix subprocess.Popen and subprocess.call to use the os.environ by 
default (but this would be another request or discussion).

--

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



[issue10814] assertion failed on Windows buildbots

2011-01-03 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

Can someone with a windows box test

 time.asctime((12345, 1, 1, 0, 0, 0, 0, 0, 0))?

If that crashes as well, can you tell which part of 

( ( tb-tm_mday = 1 )  ( ( ( _days[ tb-tm_mon + 1 ] - _days[ tb-tm_mon ] ) 
= tb-tm_mday ) || ( ( IS_LEAP_YEAR( tb-tm_year + 1900 ) )  ( tb-tm_mon == 
1 )  ( tb-tm_mday = 29 ) ) ) )


triggers the assertion?

--

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



[issue10814] assertion failed on Windows buildbots

2011-01-03 Thread Andreas Stührk

Changes by Andreas Stührk andy-pyt...@hammerhartes.de:


--
nosy: +Trundle

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



[issue10818] pydoc: refactorize duplicate DocHandler and DocServer classes

2011-01-03 Thread STINNER Victor

New submission from STINNER Victor victor.stin...@haypocalc.com:

The pydoc module has two DocHandler classes and two DocServer classes. I think 
that they can be easily factorized.

DocServer may also use serve_forever()+shutdown() instead of 
serve_until_quit()+quit flag, to be able to wait the server (with shutdown()).

--
assignee: d...@python
components: Documentation, Library (Lib)
messages: 125190
nosy: d...@python, haypo
priority: normal
severity: normal
status: open
title: pydoc: refactorize duplicate DocHandler and DocServer classes
versions: Python 3.2, Python 3.3

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



[issue10818] pydoc: refactorize duplicate DocHandler and DocServer classes

2011-01-03 Thread STINNER Victor

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

I opened this issue because I had to fix a bug twice in pydoc: r87687 (fix a 
ResourceWarning(unclosed socket)).

--

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



[issue10814] assertion failed on Windows buildbots

2011-01-03 Thread Brian Curtin

Brian Curtin cur...@acm.org added the comment:

Alexander:

PCbuild\amd64\python_d.exe
Python 3.2b2+ (py3k, Jan  3 2011, 10:24:18) [MSC v.1500 64 bit (AMD64)] on win32
Type help, copyright, credits or license for more information.
 import time
[54931 refs]
 time.asctime((12345, 1, 1, 0, 0, 0, 0, 0, 0))
'Mon Jan 01 00:00:00 345'
[54935 refs]

--
nosy: +brian.curtin

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



[issue10512] regrtest ResourceWarning - unclosed sockets and files

2011-01-03 Thread STINNER Victor

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

* r87686 fixes multiprocessing
 * r87687 fixes pydoc
 * r87688 fixes test_subprocess

Remaining ResourceWarning warnings:
 * test_imaplib
 * test_urllibnet
 * test_urllib2net

--

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



[issue10814] assertion failed on Windows buildbots

2011-01-03 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

On Mon, Jan 3, 2011 at 11:26 AM, Brian Curtin rep...@bugs.python.org wrote:
..
PCbuild\amd64\python_d.exe
 Python 3.2b2+ (py3k, Jan  3 2011, 10:24:18) [MSC v.1500 64 bit (AMD64)] on 
 win32
 Type help, copyright, credits or license for more information.
 import time
 [54931 refs]
 time.asctime((12345, 1, 1, 0, 0, 0, 0, 0, 0))
 'Mon Jan 01 00:00:00 345'

Thanks, Brian.  This is rather strange because checktm() is supposed
to convert tm_day=0 to 1:

if (buf-tm_mday == 0)
buf-tm_mday = 1;

Does time.asctime((12345, 1, 0, 0, 0, 0, 0, 0, 0)) crash on your system?

BTW, '' in the output looks like a naive ASCII encoding for the 12-th
millennium:

12

You may need year 300,000 to observe a crash.

--

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



[issue10814] assertion failed on Windows buildbots

2011-01-03 Thread Brian Curtin

Brian Curtin cur...@acm.org added the comment:

No crash on 0-day or 300,000. I bumped it up to 3,000,000 and got a 
UnicodeDecodeError, although I'm not sure of the relevance of that to this 
issue.


 time.asctime((12345, 1, 0, 0, 0, 0, 0, 0, 0))
'Mon Jan 01 00:00:00 345'
[54935 refs]
 time.asctime((30, 1, 0, 0, 0, 0, 0, 0, 0))
'Mon Jan 01 00:00:00 \\000'
[54935 refs]
 time.asctime((300, 1, 0, 0, 0, 0, 0, 0, 0))
Traceback (most recent call last):
  File stdin, line 1, in module
UnicodeDecodeError: 'utf8' codec can't decode byte 0xe8 in position 20: invalid 
continuation byte

--

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



[issue10814] assertion failed on Windows buildbots

2011-01-03 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

On Mon, Jan 3, 2011 at 11:43 AM, Brian Curtin rep...@bugs.python.org wrote:
..
 No crash on 0-day or 300,000. I bumped it up to 3,000,000 and got a 
 UnicodeDecodeError, although
 I'm not sure of the relevance of that to this issue.

It looks like we need an XP box with a debug version of the crt lib to
reproduce the crash.

..
 time.asctime((300, 1, 0, 0, 0, 0, 0, 0, 0))
 Traceback (most recent call last):
  File stdin, line 1, in module
 UnicodeDecodeError: 'utf8' codec can't decode byte 0xe8 in position 20: 
 invalid continuation byte

Well, undefined behavior is undefined behavior.  Arguably, writing
binary garbage in a timestamp is better than crashing.  (given Windows
reputation, I would not be surprised if the above also involves
undetected memory corruption, though.) I am convinced that we don't
have a choice but to check the input of asctime() beforehand.  I am
preparing a patch.

--

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



[issue10814] assertion failed on Windows buildbots

2011-01-03 Thread Antoine Pitrou

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

This is under 3.1, not 3.2.

--

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



[issue10814] assertion failed on Windows buildbots

2011-01-03 Thread Antoine Pitrou

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

I can reproduce under Windows 7, 32-bit debug build, with the following line:

time.asctime((12345, 1, 0, 0, 0, 0, 0, 0, 0))

Apparently, the debugger tells me that tb-tm_mday is 0.
Actually, most of the tb fields are 0 except tm_year (10445), tm_wday (1) and 
tm_yday (-1).

The code is the following:

_VALIDATE_RETURN_ERRCODE(
(
( tb-tm_mday = 1 ) 
(
// Day is in valid range for the month
( ( _days[ tb-tm_mon + 1 ] - _days[ tb-tm_mon ] ) =
tb-tm_mday ) ||
// Special case for Feb in a leap year
(
( IS_LEAP_YEAR( tb-tm_year + 1900 ) ) 
( tb-tm_mon == 1 ) 
( tb-tm_mday = 29 )
)
)
),
EINVAL
)

So I would say the problem is really that the CRT should return EINVAL but 
instead triggers an assertion, perhaps because of a debug mode thing that we 
disable manually in 3.2?

--
nosy: +loewis

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



[issue10814] assertion failed on Windows buildbots

2011-01-03 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

I committed a a fix for the test in r87690.  If this fixes the buildbot, I'll 
backport to 2.7 and call it a day for  3.2.  For 3.2 a proper year range check 
will be added to close issue 8013.

--

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



[issue10814] assertion failed on Windows buildbots

2011-01-03 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

Btw, I have a failed assertion in the test suite, with time.ctime(1e12):
File: loctim64.c
Line: 78
Expression: (*ptime = _MAX__TIME64_T)

This is a recent py3k, compiled with VS2005.

--

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-03 Thread Glenn Linderman

Glenn Linderman v+pyt...@g.nevcal.com added the comment:

So then David, is your suggestion to use

sys.stdin = sys.stdin.detach()

and you claim that the Windows-specific hacks are not needed in 3.x land?  The 
are, in 2.x land, I have proven empirically, but haven't been able to test CGI 
forms very well in 3.x because of this bug.  I will test 3.x download without 
the Windows-specific hack, and report how it goes.  My testing started with 2.x 
and has proceeded to 3.x, and it is not always obvious what hacks are no longer 
needed in 3.x.  Thanks for the info.

--

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



[issue1674555] sys.path in tests contains system directories

2011-01-03 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com added the comment:

Apparently this patch isn't sufficient for test___all__.
Please create empty _xmlplus directory (without __init__.py) in site-packages 
directory appropriate for given sys.prefix (e.g. 
/usr/lib/python3.2/site-packages/_xmlplus for sys.prefix='/usr').

The output of `make test` contains:
LD_LIBRARY_PATH=/var/tmp/portage/dev-lang/python-3.2_pre20110102/work/python-3.2_pre20110102:
 ./python -Wd -E -bb -S -s  ./Lib/test/regrtest.py -j1 
== CPython 3.2b2+ (py3k:87612, Jan 3 2011, 18:30:27) [GCC 4.4.5]
==   
linux-2.6.34-tuxonice-r8-afta-x86_64-intel-r-_pentium-r-_dual_cpu_t23...@_1.86ghz-with-gentoo-2.0.1
 little-endian
==   
/var/tmp/portage/dev-lang/python-3.2_pre20110102/work/python-3.2_pre20110102/build/test_python_2301
[  1/349] test_grammar
[  2/349] test_opcodes
[  3/349] test_dict
[  4/349] test_builtin
[  5/349] test_exceptions
[  6/349] test_types
[  7/349] test_unittest
[  8/349] test_doctest

[  9/349] test_doctest2

[ 10/349] test___all__

Warning -- sys.path was modified by test___all__
test test___all__ failed -- Traceback (most recent call last):
  File 
/var/tmp/portage/dev-lang/python-3.2_pre20110102/work/python-3.2_pre20110102/Lib/test/test___all__.py,
 line 101, in test_all
self.check_all(modname)
  File 
/var/tmp/portage/dev-lang/python-3.2_pre20110102/work/python-3.2_pre20110102/Lib/test/test___all__.py,
 line 28, in check_all
raise FailedImport(modname)
  File 
/var/tmp/portage/dev-lang/python-3.2_pre20110102/work/python-3.2_pre20110102/Lib/contextlib.py,
 line 35, in __exit__
next(self.gen)
  File 
/var/tmp/portage/dev-lang/python-3.2_pre20110102/work/python-3.2_pre20110102/Lib/test/support.py,
 line 623, in _filterwarnings
raise AssertionError(unhandled warning %s % reraise[0])
AssertionError: unhandled warning {message : ImportWarning(Not importing 
directory '/usr/lib/python3.2/site-packages/_xmlplus': missing __init__.py,), 
category : 'ImportWarning', filename : 
'/var/tmp/portage/dev-lang/python-3.2_pre20110102/work/python-3.2_pre20110102/Lib/xml/__init__.py',
 lineno : 26, line : None}
[ 11/349] test___future__
[ 12/349] test__locale
[ 13/349] test_abc

--

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



[issue10814] assertion failed on Windows buildbots

2011-01-03 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

On Mon, Jan 3, 2011 at 12:30 PM, Amaury Forgeot d'Arc
rep...@bugs.python.org wrote:
..
 Btw, I have a failed assertion in the test suite, with time.ctime(1e12)

This is from r87657.  I commented on that change in msg125117.
Hopefully a range check will fix that as well.

--

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



[issue10818] pydoc: refactorize duplicate DocHandler and DocServer classes

2011-01-03 Thread Éric Araujo

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


--
assignee: d...@python - 
components:  -Documentation
nosy: +eric.araujo, ron_adam -d...@python
stage:  - needs patch
type:  - feature request
versions:  -Python 3.2

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



[issue10619] Failed module loading in test discovery loses traceback

2011-01-03 Thread Michael Foord

Michael Foord mich...@voidspace.org.uk added the comment:

This doesn't appear to be true on py3k (traceback.format_exc is used to 
preserve the original traceback). Need to check on Python 2.7.

--
versions:  -Python 3.2

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



  1   2   3   >