mekk.xmind 0.4.0 released

2010-07-10 Thread Marcin Kasperski

mekk.xmind 0.4.0 has just been released

What it is?
===

mekk.xmind is a pure-Python handler for XMind mind-map files.
It can be used to:

- generate XMind mind-maps from scratch (for example to visualize
  some data as a mind-map),
- modify existing .xmind files,
- parse existing .xmind files and analyze their content.

Mind-map creation example::

from mekk.xmind import XMindDocument

OUTPUT = test.xmind

xmind = XMindDocument.create(uFirst sheet title, uRoot subject)
first_sheet = xmind.get_first_sheet()
root_topic = first_sheet.get_root_topic()

root_topic.add_subtopic(uFirst item)
root_topic.add_subtopic(uSecond item)
t = root_topic.add_subtopic(uThird item)
t.add_subtopic(uSecond level - 1)
t.add_subtopic(uSecond level - 2)
root_topic.add_subtopic(uDetached topic, detached = True)
t.add_subtopic(uAnother detached, detached = True)
t.add_marker(flag-red)
root_topic.add_subtopic(uLink example).set_link(http://mekk.waw.pl;)
root_topic.add_subtopic(uAttachment example).set_attachment(
file(map_creator.py).read(), .txt)
root_topic.add_subtopic(uWith note).set_note(
uThis is just some dummy note.)

xmind.save(OUTPUT)

Mind-map parsing::

from mekk.xmind import XMindDocument

xmind = XMindDocument.open(test.xmind)

sheet = xmind.get_first_sheet()
print Sheet title: , sheet.get_title()

root = sheet.get_root_topic()
print Root title: , root.get_title()
print Root note: , root.get_note()

for topic in root.get_subtopics():
print * , topic.get_title()
printlabel: , topic.get_label()
printlink: , topic.get_link()
printmarkers: , list(topic.get_markers())
# topic.get_subtopics() etc


What has changed?
=

All docstrings were translated to English, plenty of undocumented
methods got their documentation.

A bug which caused failures while opening some XMind 3.1.1 - saved files
has been fixed.

Resources
=

:Source repository and issue tracker: http://bitbucket.org/Mekk/mekk.xmind/
:Download: http://pypi.python.org/pypi/mekk.xmind/0.4.0

:XMind home: http://xmind.net


-- 
--
| Marcin Kasperski   | If we are to be successful, we must still have
| http://mekk.waw.pl |the courage to put our faith in people as
||  opposed to a process. (Booch,Martin,Newkirk)
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

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


Re: how do you do a count of a result set?

2010-07-10 Thread John Nagle

On 7/9/2010 11:08 PM, Dennis Lee Bieber wrote:

On Sat, 10 Jul 2010 06:56:13 +0200, Rene Veermanrene7...@gmail.com
declaimed the following in gmane.comp.python.general:


hi.

i'm using this function;


def dbCacheGet(self, appParams):
results = db.GqlQuery(
SELECT * 
 FROM DBcache 
 WHERE url='+appParams['urlCalled']+'
).fetch(1)
if results.count('*')==0:
return None
else:
return results


i dont think this will work correctly.
i need a function that returns the complete count in the results variable.


   This is really a Google AppEngine question.  Ask in their support
forums.

   It's worth noting that for many database queries, asking how many
hits there are can cost almost as much as actually retrieving them.

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


Re: how do you do a count of a result set?

2010-07-10 Thread Brian Quinlan


On 10 Jul 2010, at 16:21, John Nagle wrote:


On 7/9/2010 11:08 PM, Dennis Lee Bieber wrote:

On Sat, 10 Jul 2010 06:56:13 +0200, Rene Veermanrene7...@gmail.com
declaimed the following in gmane.comp.python.general:


hi.

i'm using this function;


def dbCacheGet(self, appParams):
results = db.GqlQuery(
SELECT * 
FROM DBcache 
WHERE url='+appParams['urlCalled']+'
).fetch(1)
if results.count('*')==0:
return None
else:
return results


i dont think this will work correctly.
i need a function that returns the complete count in the results  
variable.


  This is really a Google AppEngine question.  Ask in their support
forums.


http://groups.google.com/group/google-appengine-python would be a good  
place to start.



  It's worth noting that for many database queries, asking how many
hits there are can cost almost as much as actually retrieving them.


That is the case with the App Engine datastore. If your counts contain  
more than a few hundred results then you would be better so store them  
somewhere.


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


load and plot from multiple file

2010-07-10 Thread rudra
Dear friends,
I have several 2 column file which i need to plot in one figure.
I generally do it using  gnuplot, but when there is several files, its
hard to do manually.
can you tell me how i can load a file in python and plot several file
in one figure(as it is  done via replot in gnuplot)?
I am novice in python, but tried the matplotlib...with no luck.
will u plz help?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: load and plot from multiple file

2010-07-10 Thread Tim Harig
On 2010-07-10, rudra bnrj.ru...@gmail.com wrote:
 Dear friends,
 I have several 2 column file which i need to plot in one figure.
 I generally do it using  gnuplot, but when there is several files, its
 hard to do manually.
 can you tell me how i can load a file in python and plot several file
 in one figure(as it is  done via replot in gnuplot)?
 I am novice in python, but tried the matplotlib...with no luck.
 will u plz help?

It would really help to see a representative sample of the data that you
are working with and what you want the plot to look like.  Other then that,
you likely just want to load the data from the file into lists (ordered
together, lists with sublists, or potentially into a list ofrepresentative
objects).  You can then simply open a pipe to gnuplot and send it the
commands it needs to create your plot.  You could also just create a single
comined file with all of the information to plot and then use it to create
you plots.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: zipimport (.pyd .so) files.

2010-07-10 Thread King
I think I am trying to open a can of worms. It's better to leave the
idea for now.

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


Re: Hello

2010-07-10 Thread Andreas Waldenburger
On Fri, 9 Jul 2010 16:49:20 + (UTC) Grant Edwards
inva...@invalid.invalid wrote:

 On 2010-07-09, Dani Valverde dani.valve...@gmail.com wrote:
 
  I am new to python and pretty new to programming (I have some
  expertise wit R statistical programming language). I am just
  starting, so my questions may be a little bit stupid. Can anyone
  suggest a good editor for python?
 
 Emacs, Scite (has nice folding), Vim, Eclipse.
 
Great tips for a newbie.

Not.

Well, they might be, but chances are, they are overkill for people new
to programming and will only alienate them (Scite may be an exception).
Text editors are an acquired taste.

/W

-- 
INVALID? DE!

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


Re: Hello

2010-07-10 Thread christian schulze
On 9 Jul., 18:31, Dani Valverde dani.valve...@gmail.com wrote:
 Hello!
 I am new to python and pretty new to programming (I have some expertise
 wit R statistical programming language). I am just starting, so my
 questions may be a little bit stupid. Can anyone suggest a good editor
 for python?
 Cheers!

 Dani


Editors:
Scribes, vim, gVim, Emacs, Gedit, Joe, Kate, Leafpad, Mousepad, Nano

IDE's:
Eric, Geany, ActiveState, Anjuta, Bluefish, Code::Blocks, CodeDragon/
wxStudio, WingIDE

I suggest you to try around and find the editor/IDE that fits your
needs.

I use: Eric, Geany, Scribes, Emacs, Vim, gVim, Bluefish, (Gedit)
(You should give Eric a try, its a rather good Python IDE)

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


Re: load and plot from multiple file

2010-07-10 Thread rudra
On Jul 10, 1:13 pm, Tim Harig user...@ilthio.net wrote:
 It would really help to see a representative sample of the data that you
 are working with and what you want the plot to look like.

The data looks something like that:
0.70711 -2.57266
1.0 0.16694
1.22474 -0.15287
1.41421 0.28025
1.58114 -0.03806
1.73205 0.05049
1.87083 -0.01686
2.0 -0.02918
2.12132 0.00246
2.12132 0.13460
2.23607 -0.01552
2.34521 -0.00033
2.44949 0.00550
2.54951 -0.00827
2.54951 -0.01189
2.73861 0.00397
2.82843 0.04685
2.91548 -0.00115
2.91548 -0.00951
3.0 0.00069
3.0 0.00214

and there are several such file.
I need two types of plotting:
1) multiple plot in same figure
2) grid of plots with different data in different grid
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Hello

2010-07-10 Thread Dani Valverde

geremy condra wrote:

On Fri, Jul 9, 2010 at 1:08 PM, Dani Valverde dani.valve...@gmail.com wrote:
  

Sorry, I forgot to mention that I am using Linux. In fact, my first test
have been with gedit. Is there any way to directly run the Python code into
the console?



Gedit has a plugin that brings up a python intepreter.
Edit-Preferences-Plugins-python console I think.

Geremy Condra

  
I have this plugin enabled, but I don't know how to send the code to the 
console...


Dani

--
Daniel Valverde Saubí
c/Joan Maragall 37 4 2
17002 Girona
Spain
Telèfon mòbil: +34651987662
e-mail: dani.valve...@gmail.com
http://www.acrocephalus.net
http://natupics.blogspot.com

Si no és del tot necessari, no imprimeixis aquest missatge. Si ho fas utilitza 
paper 100% reciclat i blanquejat sense clor. D'aquesta manera ajudaràs a 
estalviar aigua, energia i recursos forestals.  GRÀCIES!

Do not print this message unless it is absolutely necessary. If you must print 
it, please use 100% recycled paper whitened without chlorine. By doing so, you 
will save water, energy and forest resources. THANK YOU!

attachment: dani_valverde.vcf-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Hello

2010-07-10 Thread geremy condra
On Sat, Jul 10, 2010 at 6:49 AM, Dani Valverde dani.valve...@gmail.com wrote:
 geremy condra wrote:

 On Fri, Jul 9, 2010 at 1:08 PM, Dani Valverde dani.valve...@gmail.com
 wrote:


 Sorry, I forgot to mention that I am using Linux. In fact, my first test
 have been with gedit. Is there any way to directly run the Python code
 into
 the console?


 Gedit has a plugin that brings up a python intepreter.
 Edit-Preferences-Plugins-python console I think.

 Geremy Condra



 I have this plugin enabled, but I don't know how to send the code to the
 console...

type it in?

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


Re: Hello

2010-07-10 Thread Dani Valverde

geremy condra wrote:

On Sat, Jul 10, 2010 at 6:49 AM, Dani Valverde dani.valve...@gmail.com wrote:
  

geremy condra wrote:


On Fri, Jul 9, 2010 at 1:08 PM, Dani Valverde dani.valve...@gmail.com
wrote:

  

Sorry, I forgot to mention that I am using Linux. In fact, my first test
have been with gedit. Is there any way to directly run the Python code
into
the console?



Gedit has a plugin that brings up a python intepreter.
Edit-Preferences-Plugins-python console I think.

Geremy Condra


  

I have this plugin enabled, but I don't know how to send the code to the
console...



type it in?

Geremy Condra

  
It could be a solution. But I am used to work with gEdit using the R 
statistical programming language plugin, and I am able to send the code 
to console instead of typing it in.


Cheers!

Dani

--
Daniel Valverde Saubí
c/Joan Maragall 37 4 2
17002 Girona
Spain
Telèfon mòbil: +34651987662
e-mail: dani.valve...@gmail.com
http://www.acrocephalus.net
http://natupics.blogspot.com

Si no és del tot necessari, no imprimeixis aquest missatge. Si ho fas utilitza 
paper 100% reciclat i blanquejat sense clor. D'aquesta manera ajudaràs a 
estalviar aigua, energia i recursos forestals.  GRÀCIES!

Do not print this message unless it is absolutely necessary. If you must print 
it, please use 100% recycled paper whitened without chlorine. By doing so, you 
will save water, energy and forest resources. THANK YOU!

attachment: dani_valverde.vcf-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Hello [How to run your code]

2010-07-10 Thread donn

On 10/07/2010 13:05, Dani Valverde wrote:

It could be a solution. But I am used to work with gEdit using the R
statistical programming language plugin, and I am able to send the code
to console instead of typing it in.
To run your code, save it to a file 'mycode.py' (or whatever), then open 
a console and cd into that directory, then:

python mycode.py

That will get you started. Keep the console open and alt-tab to it 
whenever you want to run your code.


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


Re: Hello

2010-07-10 Thread flebber
On Jul 10, 8:49 pm, Dani Valverde dani.valve...@gmail.com wrote:
 geremy condra wrote:
  On Fri, Jul 9, 2010 at 1:08 PM, Dani Valverde dani.valve...@gmail.com 
  wrote:

  Sorry, I forgot to mention that I am using Linux. In fact, my first test
  have been with gedit. Is there any way to directly run the Python code into
  the console?

  Gedit has a plugin that brings up a python intepreter.
  Edit-Preferences-Plugins-python console I think.

  Geremy Condra

 I have this plugin enabled, but I don't know how to send the code to the
 console...

 Dani

 --
 Daniel Valverde Saubí
 c/Joan Maragall 37 4 2
 17002 Girona
 Spain
 Telèfon mòbil: +34651987662
 e-mail: 
 dani.valve...@gmail.comhttp://www.acrocephalus.nethttp://natupics.blogspot.com

 Si no és del tot necessari, no imprimeixis aquest missatge. Si ho fas 
 utilitza paper 100% reciclat i blanquejat sense clor. D'aquesta manera 
 ajudaràs a estalviar aigua, energia i recursos forestals.  GRÀCIES!

 Do not print this message unless it is absolutely necessary. If you must 
 print it, please use 100% recycled paper whitened without chlorine. By doing 
 so, you will save water, energy and forest resources. THANK YOU!

  dani_valverde.vcf
  1KViewDownload

A few good options.

Editor: Notepad++
IDE: Pyscripter - Clean clear design easy to use.
Eclipse/Pydev

Cheers

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


Re: Hello

2010-07-10 Thread geremy condra
On Sat, Jul 10, 2010 at 7:05 AM, Dani Valverde dani.valve...@gmail.com wrote:
 geremy condra wrote:

 On Sat, Jul 10, 2010 at 6:49 AM, Dani Valverde dani.valve...@gmail.com
 wrote:


 geremy condra wrote:


 On Fri, Jul 9, 2010 at 1:08 PM, Dani Valverde dani.valve...@gmail.com
 wrote:



 Sorry, I forgot to mention that I am using Linux. In fact, my first
 test
 have been with gedit. Is there any way to directly run the Python code
 into
 the console?



 Gedit has a plugin that brings up a python intepreter.
 Edit-Preferences-Plugins-python console I think.

 Geremy Condra




 I have this plugin enabled, but I don't know how to send the code to the
 console...


 type it in?

 Geremy Condra



 It could be a solution. But I am used to work with gEdit using the R
 statistical programming language plugin, and I am able to send the code to
 console instead of typing it in.

Not sure how that works, but everything in gedit is accessible through
python, so it should be a snap to put together a plugin to do what you
want.

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


Any reason www.python.org is slow?

2010-07-10 Thread Pierre Rouleau
All,

I have been finding python.org site very slow for the last year and
probably before. Is there any known reason why the site is slow?  I
tried accessing it from several locations and I always get to wait
several seconds for a page to load (in any browser/OS).

Thanks

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


Re: Any reason www.python.org is slow?

2010-07-10 Thread Antoine Pitrou
On Sat, 10 Jul 2010 06:30:11 -0700 (PDT)
Pierre Rouleau prouleau...@gmail.com wrote:
 All,
 
 I have been finding python.org site very slow for the last year and
 probably before. Is there any known reason why the site is slow?

For the last year??
It's been mostly zippy here.
Is IPv6 enabled on your computer? If so, I'd try to disable it.
python.org domains resolve to both IPv4 and IPv6 addresses and, if your
computer has IPv6 enabled but you don't have any IPv6 connectivity,
this can result in slowdowns.

Regards

Antoine.


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


Re: Any reason www.python.org is slow?

2010-07-10 Thread Pierre Rouleau
On Jul 10, 9:48 am, Antoine Pitrou solip...@pitrou.net wrote:
 On Sat, 10 Jul 2010 06:30:11 -0700 (PDT)


  I have been finding python.org site very slow for the last year and
  probably before. Is there any known reason why the site is slow?

 For the last year??
 It's been mostly zippy here.
 Is IPv6 enabled on your computer? If so, I'd try to disable it.
 python.org domains resolve to both IPv4 and IPv6 addresses and, if your
 computer has IPv6 enabled but you don't have any IPv6 connectivity,
 this can result in slowdowns.

 Regards

 Antoine.

Merci Antoine!

I did disable IPv6 on my computer at home and it did speed it up. I'll
check the other computers where I experienced the same slowness.

Thanks again!

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


Re: Any reason www.python.org is slow?

2010-07-10 Thread Martin v. Loewis
 For the last year??
 It's been mostly zippy here.
 Is IPv6 enabled on your computer? If so, I'd try to disable it.
 python.org domains resolve to both IPv4 and IPv6 addresses and, if your
 computer has IPv6 enabled but you don't have any IPv6 connectivity,
 this can result in slowdowns.

That is a common myth. If your computer doesn't have any IPv6
connectivity, all is fine. The web browser will fallback to IPv4
immediately (*), without sending out any IPv6 datagrams first.

If your computer does have IPv6 connectivity, but it's broken
(i.e. you have a gateway, but eventually packets are discarded),
you see the IPv4 fallback after the IPv6 timeout. The IPv4 connection in
itself then would be fast.

If your computer has IPv6 connectivity, but through low-bandwidth
tunnels (which may happen with 6to4 tunnels, for example), then you'll
get slow responses all the time.

Regards,
Martin

(*) unless it's some older Opera version, in which case you would
get no connection to python.org at all.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Any reason www.python.org is slow?

2010-07-10 Thread Martin v. Loewis
 I did disable IPv6 on my computer at home and it did speed it up. I'll
 check the other computers where I experienced the same slowness.

Of course, it would be interesting to find out what precisely went
wrong. If you are curious to find out, let me know, and I'll help
investigating.

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


About new urllib.request in python 3.1.2

2010-07-10 Thread pcchen
Sorry I have searched related topic but none could point out this
problem.

I am currently using python 3.1.2:

Python 3.1.2 (r312:79147, Jun 30 2010, 11:58:11)
[GCC 4.2.1 20070719  [FreeBSD]] on freebsd8

And for the following three simple lines of code, borrowed from
official python-doc 3.1.2:

from urllib.request import urlopen
response = urlopen('http://python.org/')
html = response.read()

They could cause this error:

  File ./http.py, line 3, in module
from urllib.request import urlopen
  File /usr/local/lib/python3.1/urllib/request.py, line 88, in
module
import http.client
  File /home/pcchen/Python/http.py, line 3, in module
from urllib.request import urlopen
ImportError: cannot import name urlopen

All the related discussions point to urlopen has been moved from
urllib to urllib.request, but none can discribe the above error.

Any information is appreciated, thank you so much.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Any reason www.python.org is slow?

2010-07-10 Thread Antoine Pitrou
On Sat, 10 Jul 2010 16:03:24 +0200
Martin v. Loewis mar...@v.loewis.de wrote:
 
 That is a common myth. If your computer doesn't have any IPv6
 connectivity, all is fine. The web browser will fallback to IPv4
 immediately (*), without sending out any IPv6 datagrams first.

Ok, I suppose the explanation wasn't factually exact.

 If your computer does have IPv6 connectivity, but it's broken
 (i.e. you have a gateway, but eventually packets are discarded),
 you see the IPv4 fallback after the IPv6 timeout. The IPv4 connection in
 itself then would be fast.

I think it's what most users experience when they are talking about
this problem. It manifests itself on many Linux setups.

Regards

Antoine.


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


Re: Any reason www.python.org is slow?

2010-07-10 Thread Martin v. Loewis
 If your computer does have IPv6 connectivity, but it's broken
 (i.e. you have a gateway, but eventually packets are discarded),
 you see the IPv4 fallback after the IPv6 timeout. The IPv4 connection in
 itself then would be fast.
 
 I think it's what most users experience when they are talking about
 this problem. It manifests itself on many Linux setups.

This (*) is something I really cannot believe. What specifically
happened on these Linux setups? What specific network use these people,
and why do they get bad IPv6 connectivity?

Regards,
Martin

(*) that there are many
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Any reason www.python.org is slow?

2010-07-10 Thread Antoine Pitrou
On Sat, 10 Jul 2010 16:28:19 +0200
Martin v. Loewis mar...@v.loewis.de wrote:
  If your computer does have IPv6 connectivity, but it's broken
  (i.e. you have a gateway, but eventually packets are discarded),
  you see the IPv4 fallback after the IPv6 timeout. The IPv4 connection in
  itself then would be fast.
  
  I think it's what most users experience when they are talking about
  this problem. It manifests itself on many Linux setups.
 
 This (*) is something I really cannot believe.
 (*) that there are many

Well, just take a look at the number of recipes for disabling IPv6
specifically in order to solve slowdown problems:
http://www.google.com/search?hl=frsafe=offq=linux+ipv6+disable+slowdownsaq=faqi=aql=oq=gs_rfai=

It is at least the third time that someone asks why python.org is
slow, and that their problem is solved by disabling IPv6.

I disabled IPv6 myself, which solved similar slowdown issues.
The issues happened on *.python.org, *.google.com and a couple of other
domains; hence they weren't python.org-specific.
The issues happened with a Web browser but also with ssh; hence they
were neither application- nor protocol-specific.
The issues happened on two different machines, one hooked to a DSL
router, another with wireless connection to various outside networks.
Hence the issue is probably not tied to a particular hardware gateway.

I was quite surprised myself when I discovered that solution. But it
really suppressed the frequent lag I had in some connection attempts
(including ssh connection to a rather close, mostly idle box).

It is possible that the way Linux (or some Linux setups: many of the
recipes above are for Ubuntu, I use Mandriva myself) handles IPv6
connectivity is suboptimal in some cases, and that connection
attempts don't fail immediately when they should. I don't have enough
knowledge to diagnose further.

Regards

Antoine.


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


Re: Hello

2010-07-10 Thread Eli Bendersky
On Fri, Jul 9, 2010 at 19:31, Dani Valverde dani.valve...@gmail.com wrote:

 Hello!
 I am new to python and pretty new to programming (I have some expertise wit
 R statistical programming language). I am just starting, so my questions may
 be a little bit stupid. Can anyone suggest a good editor for python?
 Cheers!


Hi Dani,

Don't be shy to ask beginner questions. However, you will do well to first
read a few FAQs.

Start here: http://www.python.org/doc/faq/
Part of it is also available in spanish, for your convenience:
http://www.python.org/doc/faq/es/general/
The Python wiki (http://wiki.python.org/moin/FrontPage) is also useful. For
example, it has a rather comprehensive page about editors:
http://wiki.python.org/moin/PythonEditors

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


Re: About new urllib.request in python 3.1.2

2010-07-10 Thread Steven D'Aprano
On Sat, 10 Jul 2010 07:06:47 -0700, pcchen wrote:

 And for the following three simple lines of code, borrowed from official
 python-doc 3.1.2:
 
from urllib.request import urlopen
response = urlopen('http://python.org/') html = response.read()
 
 They could cause this error:
 
   File ./http.py, line 3, in module
 from urllib.request import urlopen
   File /usr/local/lib/python3.1/urllib/request.py, line 88, in
 module
 import http.client
   File /home/pcchen/Python/http.py, line 3, in module
 from urllib.request import urlopen
 ImportError: cannot import name urlopen

Look at the traceback: your code executes from urllib.request import 
urlopen. That line in turn executes import http.client. And *that* 
fails, which causes the first import to fail.

It fails because you have shadowed the built-in package http with your 
own module http.py.

Rename your file to something else (myhttp.py) and it should just work.


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


Re: About new urllib.request in python 3.1.2

2010-07-10 Thread pavan kumar maddali


Thank You Steve,
I am not using the urllib. I am using the xmlrpc and http modules from the 
python library.
Please see the header code for the modules I am including..

from xmlrpc import client
import pprint
class ClientCertTransport(client.Transport):
 def make_connection(self,host):
  import http
  host, extra_headers,x509 = self.get_host_info(host)
  
  try:
   HTTPS = http.HTTPS
  except AttributeError:
   raise NotImplementedError(your version of http does not support HTTPS)
  else:
   return HTTPS(host,None,'privkey.pem','resellercert.pem')

the rest of the code is just to get the result from the api
regards
Pavan


From: Steven D'Aprano st...@remove-this-cybersource.com.au
To: python-list@python.org
Sent: Sat, July 10, 2010 11:35:06 AM
Subject: Re: About new urllib.request in python 3.1.2

On Sat, 10 Jul 2010 07:06:47 -0700, pcchen wrote:

 And for the following three simple lines of code, borrowed from official
 python-doc 3.1.2:
 
from urllib.request import urlopen
response = urlopen('http://python.org/') html = response.read()
 
 They could cause this error:
 
  File ./http.py, line 3, in module
    from urllib.request import urlopen
  File /usr/local/lib/python3.1/urllib/request.py, line 88, in
 module
    import http.client
  File /home/pcchen/Python/http.py, line 3, in module
    from urllib.request import urlopen
 ImportError: cannot import name urlopen

Look at the traceback: your code executes from urllib.request import 
urlopen. That line in turn executes import http.client. And *that* 
fails, which causes the first import to fail.

It fails because you have shadowed the built-in package http with your 
own module http://http.py.

Rename your file to something else (myhttp.py) and it should just work.


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



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


Web page special characters encoding

2010-07-10 Thread mattia
Hi all, I'm using py3k and the urllib package to download web pages. Can 
you suggest me a package that can translate reserved characters in html 
like egrave;, ograve;, eacute; in the corresponding correct 
encoding?

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


Indian photographer denies affair with Lindsay Lohan!

2010-07-10 Thread asim malik
Speaking on the issue for the first time, Chaudhuri, over the phone
from New York, says, They were completely distorted reports. We are
really good friends for more details www.bollywood789.blogspot.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Web page special characters encoding

2010-07-10 Thread Rami Chowdhury
On Jul 10, 2010, at 09:24 , mattia wrote:

 Hi all, I'm using py3k and the urllib package to download web pages. Can 
 you suggest me a package that can translate reserved characters in html 
 like egrave;, ograve;, eacute; in the corresponding correct 
 encoding?

It won't do the whole job for you but you may find the 'name2codepoint' mapping 
in the 'html.entities' module useful.

HTH,
Rami
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Web page special characters encoding

2010-07-10 Thread MRAB

mattia wrote:
Hi all, I'm using py3k and the urllib package to download web pages. Can 
you suggest me a package that can translate reserved characters in html 
like egrave;, ograve;, eacute; in the corresponding correct 
encoding?



import re
from html.entities import entitydefs

# The downloaded web page will be bytes, so decode it to a string.
webpage = downloaded_page.decode(iso-8859-1)

# Then decode the HTML entities.
webpage = re.sub(r(\w+);, lambda m: entitydefs[m.group(1)], webpage)
--
http://mail.python.org/mailman/listinfo/python-list


Not-quite-the-module-name qualified names in extension modules? What?

2010-07-10 Thread Alf P. Steinbach /Usenet

Hi.

I built the [xxmodule.c] from the source distribution, as suggested by the 
Python 3.1.1 docs. I named this [xx.pyd], as I believed the module name was just 
xx. Indeed importing xx works fine, but when I do help(xx) I get ...



example
 help( xx )
Help on module xx:

NAME
xx - This is a template module just for instruction.

FILE

c:\projects\progrock\lib\progrock\cppy_dev\examples\02_xx_apilevel\xx.pyd

CLASSES
builtins.Exception(builtins.BaseException)
error
builtins.object
xxmodule.Null
builtins.str(builtins.object)
xxmodule.Str

class Null(builtins.object)
 |  Methods defined here:
 |
/example


... with the name xxmodule somehow in there as qualification.

Checking the standard csv module I similarly get ...


example
CLASSES
builtins.Exception(builtins.BaseException)
_csv.Error
builtins.object
Dialect
excel
excel_tab
DictReader
DictWriter
Sniffer
/example


... with the name _csv in there.

And I'm pretty sure that these not-quite-the-module-name names stem from the 
literal specification of names in the C code in the extension module, assuming 
that the csv module is indeed a C extension module.


Is it really necessary to qualify names in the C code?

And can it do harm when such name qualification is not using the final module 
name but instead something like xxmodule or _csv?


More to the point, what's the point?


Cheers,

- Alf

--
blog at url: http://alfps.wordpress.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: any issues with long running python apps?

2010-07-10 Thread Bruno Desthuilliers
Les Schaffer a écrit :
 i have been asked to guarantee that a proposed Python application will
 run continuously under MS Windows for two months time. And i am looking
 to know what i don't know.

(snip)

 but none of this has anything to do with Python itself. i am sure python
 servers have been running reliably for long periods of time, but i've
 never had to deal with a two-month guarantee before.  is there something
 else i am missing here that i should be concerned about on the
 pure-Python side of things? something under the hood of the python
 interpreter that could be problematic when run for a long time?

Zope is (rightly) considered as a memory/resources hog, and I have a
Zope instance hosting two apps on a cheap dedicated server that has not
been restarted for the past 2 or 3 years. So as long as your code is
clean you should not have much problem with the Python runtime itself,
at least on a a linux box. Can't tell how it would work on Windows.

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


MySqlDb any way to see the query string

2010-07-10 Thread News123
Hi,

I'm using MYSQLdb


and have following code


db = MySQLdb.connect(**cfg)
c = db.cursor()
qrystr = insert mytable set id = %s ,  other_field = %s
c.execute(qrystr, (id_val,other_field_val) )


What I wondered is whether there is any way to print the 'filled in'
query string for debuggin.

The reason I'm askng is, that I'd like to copy paste the 'filled in'
query string
and try it from the command line.

I know I could create it myself, but I had to do all the esaping myself.

Thanks for suggestions


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


Re: Only one forum app in Python?

2010-07-10 Thread Bruno Desthuilliers
Gilles Ganault a écrit :
 Hello
 
 I'd like to write a small web app in Python which must include a
 forum.
 
 So I checked the relevant article in Wikipedia, which says that only
 one forum app is available for Python:
 
 http://en.wikipedia.org/wiki/Comparison_of_internet_forum_software_(other)
 
 Is Pocoo really the only solution available out there?

There are almost a dozen of Python forum apps for Django alone, and
Python is known as the language with more web frameworks than keywords.

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


simples setup for an wsgi https server in python

2010-07-10 Thread Gelonida
Hi,

I'd like to debug a small wsgi module.

I run it either on an apache web server

or locally via wsgiref.simple_server.make_server
and following code snippet:

from wsgiref.simple_server import make_server
httpd = make_server('localhost',8012,application)
while True:
   httpd.handle_request()
   print_some_debug_info()



It seems, that wsgiref.simple_server.make_server can only create an http
server.

What I wondered would be how to easiest create an https server, that
supports wsgi modules


TIA




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


Re: any issues with long running python apps?

2010-07-10 Thread John Nagle

On 7/9/2010 12:13 PM, Les Schaffer wrote:

i have been asked to guarantee that a proposed Python application will
run continuously under MS Windows for two months time. And i am looking
to know what i don't know.

The app would read instrument data from a serial port,


   If the device you're listening to is read-only, and you're just
listening, make a cable to feed the serial data into two machines,
and have them both log it.  Put them on separate UPSs and in
a place where nobody can knock them over or mess with them.

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


Re: any issues with long running python apps?

2010-07-10 Thread Alf P. Steinbach /Usenet

* John Nagle, on 10.07.2010 20:54:

On 7/9/2010 12:13 PM, Les Schaffer wrote:

i have been asked to guarantee that a proposed Python application will
run continuously under MS Windows for two months time. And i am looking
to know what i don't know.

The app would read instrument data from a serial port,


If the device you're listening to is read-only, and you're just
listening, make a cable to feed the serial data into two machines,
and have them both log it. Put them on separate UPSs and in
a place where nobody can knock them over or mess with them.


The Ramans do everything in triplicate - Old jungle proverb


Cheers,

- Alf

--
blog at url: http://alfps.wordpress.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: simples setup for an wsgi https server in python

2010-07-10 Thread Jean-Paul Calderone
On Jul 10, 2:42 pm, Gelonida gelon...@gmail.com wrote:
 Hi,

 I'd like to debug a small wsgi module.

 I run it either on an apache web server

 or locally via wsgiref.simple_server.make_server
 and following code snippet:

 from wsgiref.simple_server import make_server
 httpd = make_server('localhost',8012,application)
 while True:
    httpd.handle_request()
    print_some_debug_info()

 It seems, that wsgiref.simple_server.make_server can only create an http
 server.

 What I wondered would be how to easiest create an https server, that
 supports wsgi modules

 TIA

You could do this with Twisted:

twistd -n web --https 443 --certificate server.pem --privkey
server.key --wsgi your.application

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


Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-10 Thread Tim Roberts
Dave Angel da...@ieee.org wrote:

Tim Roberts wrote:

 No.  The multi-thread-aware CRT in Visual C++ (which is the only option
 since VS2008) puts errno in thread-local storage, so it's shared by all
 CRTs.
   
I didn't know specifically that errno is in TLS, but I will disagree 
with the conclusion that a TLS entry is implicitly shared by all CRT's.  
Unless the CRT for each DLL explicitly does some extra work to allow 
sharing, each will have its own set of TLS variables.

Yes, I should have thought about this before posting.  I checked the CRT
source code, and you are correct.  Every DLL that calls the C run-time
startup code will do its own TlsAlloc.
-- 
Tim Roberts, t...@probo.com
Providenza  Boekelheide, Inc.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: MySqlDb any way to see the query string

2010-07-10 Thread MRAB

Dennis Lee Bieber wrote:

On Sat, 10 Jul 2010 20:22:21 +0200, News123 news1...@free.fr declaimed
the following in gmane.comp.python.general:


Hi,

I'm using MYSQLdb

snip

What I wondered is whether there is any way to print the 'filled in'
query string for debuggin.


Just edit the MySQLdb cursors module -- it's plain Python unless
something has changed in the last year... Find the .execute() method,
and stuff in a debug print statement where it does the escaping and
fill in (reason MySQLdb uses %s placeholder is that it uses Python to
do the fill in; things may change if the module is ever updated to use
ver 5 prepared queries).

Come to think of it, one could probably duplicate the .execute()
method, creating a d_execute with the print statement, while not
affecting operational code... That way one wouldn't have to edit the
module just for testing.


Why duplicate the method? Why not add a keyword argument to turn on
printing or a provide a file-type instance to which it should log the
query?
--
http://mail.python.org/mailman/listinfo/python-list


Sumatra m/l?

2010-07-10 Thread Neal Becker
Sumatra looks like an interesting project 
http://pypi.python.org/pypi/Sumatra/0.2

But I have some questions.  Is there any mail list or forum?  I can't find 
anything on the website.

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


Re: Sumatra m/l?

2010-07-10 Thread Aahz
In article mailman.536.1278792518.1673.python-l...@python.org,
Neal Becker  ndbeck...@gmail.com wrote:

Sumatra looks like an interesting project 
http://pypi.python.org/pypi/Sumatra/0.2

And how are we supposed to know that it's interesting?  You should
provide a summary.

Also, it's pretty rude to set followups to gmane.comp.python.general
-- 
Aahz (a...@pythoncraft.com)   * http://www.pythoncraft.com/

Normal is what cuts off your sixth finger and your tail...  --Siobhan
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Web page special characters encoding

2010-07-10 Thread mattia
Il Sat, 10 Jul 2010 18:09:12 +0100, MRAB ha scritto:

 mattia wrote:
 Hi all, I'm using py3k and the urllib package to download web pages.
 Can you suggest me a package that can translate reserved characters in
 html like egrave;, ograve;, eacute; in the corresponding
 correct encoding?
 
 import re
 from html.entities import entitydefs
 
 # The downloaded web page will be bytes, so decode it to a string.
 webpage = downloaded_page.decode(iso-8859-1)
 
 # Then decode the HTML entities.
 webpage = re.sub(r(\w+);, lambda m: entitydefs[m.group(1)], webpage)

Thanks, very useful, didn't know about the entitydefs dictionary.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Web page special characters encoding

2010-07-10 Thread Christian Heimes
 Hi all, I'm using py3k and the urllib package to download web pages. Can 
 you suggest me a package that can translate reserved characters in html 
 like egrave;, ograve;, eacute; in the corresponding correct 
 encoding?

I think the html parser of LXML can convert the entities, too.

Christian

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


Re: Web page special characters encoding

2010-07-10 Thread John Nagle

On 7/10/2010 2:03 PM, mattia wrote:

Il Sat, 10 Jul 2010 18:09:12 +0100, MRAB ha scritto:


mattia wrote:

Hi all, I'm using py3k and the urllib package to download web pages.
Can you suggest me a package that can translate reserved characters in
html like egrave;, ograve;, eacute; in the corresponding
correct encoding?


import re
from html.entities import entitydefs

# The downloaded web page will be bytes, so decode it to a string.
webpage = downloaded_page.decode(iso-8859-1)

# Then decode the HTML entities.
webpage = re.sub(r(\w+);, lambda m: entitydefs[m.group(1)], webpage)


Thanks, very useful, didn't know about the entitydefs dictionary.


   You also need to decode the HTML numerical escapes.  Expect that
in real-world HTML, out of range values will occasionally appear.

John Nagle

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


Re: Sumatra m/l?

2010-07-10 Thread Antoine Pitrou
On 10 Jul 2010 13:48:09 -0700
a...@pythoncraft.com (Aahz) wrote:
 
 Also, it's pretty rude to set followups to gmane.comp.python.general

Can you expand?


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


Re: About new urllib.request in python 3.1.2

2010-07-10 Thread Cameron Simpson
On 10Jul2010 09:11, pavan kumar maddali pavan_madd...@yahoo.com wrote:
| Thank You Steve,
| I am not using the urllib.

Your example did:

from urllib.request import urlopen
response = urlopen('http://python.org/') html =
response.read()

| I am using the xmlrpc and http modules from the 
| python library.
[...]

That's not what he meant.

Your file is called http.py.
Python searches the current directory first.
That means that when any library module (internally) tried to use
the http module it will find your file, not the library module.

So you don't get to use the http library module.

Rename your http.py file to my-http-test.py and retry.
Then its name won't get in the way of the library name.

Cheers,
-- 
Cameron Simpson c...@zip.com.au DoD#743
http://www.cskk.ezoshosting.com/cs/

Success in software development depends on making a carefully planned
series of small mistakes in order to avoid making unplanned large
mistakes.   - Steve McConnell, _Software Project Survival Guide_
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Any reason www.python.org is slow?

2010-07-10 Thread Pierre Rouleau


 It is possible that the way Linux (or some Linux setups: many of the
 recipes above are for Ubuntu, I use Mandriva myself) handles IPv6
 connectivity is suboptimal in some cases, and that connection
 attempts don't fail immediately when they should. I don't have enough
 knowledge to diagnose further.


Note that I am not using Linux.  I had the problem on OS/X 10.4.

I did another experiment.  I have VMWare Fusion on that computer and
have Linux Ubuntu 9.04 in one VMWare appliance.

I activated IPv6 on the OS/X Preference for the interface I am using.
Access to www.python.org went slow for Firefox and Safari running
directly under OS/X.  However, access for Firefox running inside
VMWare-based Linux Ubuntu 9.04 was fine!  I tried pages from Ubuntu
first, got them right away, then tried the same page under OS/X and
was waiting for over 10 seconds.

Regards

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


Re: Web page special characters encoding

2010-07-10 Thread mattia
Il Sat, 10 Jul 2010 16:24:23 +, mattia ha scritto:

 Hi all, I'm using py3k and the urllib package to download web pages. Can
 you suggest me a package that can translate reserved characters in html
 like egrave;, ograve;, eacute; in the corresponding correct
 encoding?
 
 Thanks,
 Mattia

Basically I'm trying to get an html page and stripping out all the tags 
to obtain just plain text. John Nagle and Christian Heimes somehow 
figured out what I'm trying to do ;-)

So far what I've done, thanks to you suggestions:

import lxml.html
import lxml.html.clean
import urllib.request
import urllib.parse
from html.entities import entitydefs
import re
import sys

HEADERS = {User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; 
rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3}

def replace(m):
if m.group(1) in entitydefs:
return entitydefs[m.group(1)]
else:
return m.group(1)

def test(page):
req = urllib.request.Request(page, None, HEADERS)
page = urllib.request.urlopen(req)
charset = page.info().get_content_charset()
if charset is not None:
html = page.read().decode(charset)
else:
html = page.read().decode(iso-8859-1)
html = re.sub(r(\w+);, replace, html)
cleaner = lxml.html.clean.Cleaner(safe_attrs_only = True, style = 
True)
html = cleaner.clean_html(html)
# create the element tree
tree = lxml.html.document_fromstring(html)
txt = tree.text_content()
for x in txt.split():
# DOS shell is not able to print characters like u'\u20ac' - 
why???
try:
print(x)
except:
continue

if __name__ == __main__:
if len(sys.argv)  2:
print(Usage:, sys.argv[0], webpage)
print(Example:, sys.argv[0], http://www.bing.com;)
sys.exit()
test(sys.argv[1])

Every new tips will be appreciated.

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


Re: 'reload M' doesn't update 'from M inport *'

2010-07-10 Thread Tim Roberts
Frederic Rentsch anthra.nor...@bluewin.ch wrote:

I develop in an IDLE window.

Module M says 'from service import *'.
Next I correct a mistake in function 'service.f'.
Now 'service.f' works fine.

I do 'reload (service); reload (M)'.
The function 'M.f' still misbehaves.

'print inspect.getsource (service.f)' and
'print inspect.getsource (M.f)' shows the same 
corrected code. 

'print service.f' and 'print M.f' show different ids.

Yes. This:

from service import xxx

is essentially the same as:

import service
xxx = service.xxx

At that point, xxx contains a reference to the service.xxx object as it
is right now.  When you do a reload, that imports a new version of
service.xxx, but your global xxx object is still bound to the old one.
-- 
Tim Roberts, t...@probo.com
Providenza  Boekelheide, Inc.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: MySqlDb any way to see the query string

2010-07-10 Thread Tim Roberts
News123 news1...@free.fr wrote:

I'm using MYSQLdb

and have following code

db = MySQLdb.connect(**cfg)
c = db.cursor()
qrystr = insert mytable set id = %s ,  other_field = %s
c.execute(qrystr, (id_val,other_field_val) )

What I wondered is whether there is any way to print the 'filled in'
query string for debuggin.

The reason I'm askng is, that I'd like to copy paste the 'filled in'
query string and try it from the command line.

You have the source code in front of you.  After you do the execute, the
actual query string that was transmitted is available in c._executed.

If you need to know the result before you submit it, you can scan the
source for the execute method and see how they do the quoting.  It's not
that complicated.
-- 
Tim Roberts, t...@probo.com
Providenza  Boekelheide, Inc.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: MySqlDb any way to see the query string

2010-07-10 Thread News123
Hi everybody,


im Roberts wrote:
 News123 news1...@free.fr wrote:
 I'm using MYSQLdb

 and have following code

 db = MySQLdb.connect(**cfg)
 c = db.cursor()
 qrystr = insert mytable set id = %s ,  other_field = %s
 c.execute(qrystr, (id_val,other_field_val) )

 What I wondered is whether there is any way to print the 'filled in'
 query string for debuggin.

 The reason I'm askng is, that I'd like to copy paste the 'filled in'
 query string and try it from the command line.
 
 You have the source code in front of you.  After you do the execute, the
 actual query string that was transmitted is available in c._executed.
 
 If you need to know the result before you submit it, you can scan the
 source for the execute method and see how they do the quoting.  It's not
 that complicated.

Thanks for all of your answers.

In my case c._executed is absolutely sufficient.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Plot problem.. ?? No sign at all

2010-07-10 Thread Ritchy lelis
On 7 jul, 08:38, Johan Grönqvist johan.gronqv...@gmail.com wrote:
 2010-07-06 19:18, Ritchy lelis skrev:

  On 6 jul, 17:29, Alan G Isaacalan.is...@gmail.com  wrote:
  Unfortunately I cannot make sense of the code you posted.
  Provide a detailed description in words (or psuedocode)
  of what you are trying to accomplish.  Be very careful
  and detailed is you want a useful response.

  Alan Isaac

  hummm...

  ok, i will try to make that detailed description.

 I can tell you why I do not understand from your posted code what you
 are trying to do.

 Firstly, I do not understand if you are trying to plot a surface, a set
 of curves, or a curve, or just a set of points? In your posted code, the
 plot command is part of the else clause, and my guess is that you never
 intend the else-clause to be executed at all.

 In your code snippet you loop over two arrays (Vi and Vref), compute a
 scalar value V0, and all plot-commands you issue are of the form
 plot(V0). This will probably draw a line of one point (for each value in
 Vi and Vref), which may not be what you want, and if it draws anything
 at all, then all points will be drawn at the same x-value, which is also
 probably not what you want.

 Secondly, how are the Vi and Vref related to your axes? I assume you
 want to plot all values you compute for V0, but as a function of what?
 When I use the plot command, I usually give it (at least) two arguments,
 where the first is the x-axis, and the second is the y-axis.

 After I have understood those things, the next question would be about
 the maths relating the Vi and Vref values to the V0 values, but I do not
 think I will understand those until after the above points are explained
 clearer.

 I definitely think your english is not a problem here.

 Johan

hi Johan

Thanks for the interest in my problem... really appreciate.

About the plot draw it's a curve that it's a set of points wich it's
the result of the comput of the Vref and Vi together. I don't know if
i had to make a break instruction (like in other's languages) after
the If instructions if i want the else-condition to be executed? ...
(do you have some sujestions?)
Anyway i have a picture of a tuturial that i found but in this forum i
can't post it. That pic would show what a really want...

Relatively to the axis, the Vi takes the x-axis and the Vref takes the
y-axis.

As i said, i have a good 2 pic of a doc that has the information about
this ADC that i'm developing.

I would appreciate more of your help, if you permit me i could send
you those 2 pic and i guarantee that you would got the certain vision
of the problem.

I'll be waiting for your answer, i thing that you can help me.

Cheers.

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


Re: any issues with long running python apps?

2010-07-10 Thread sturlamolden
On 10 Jul, 02:23, Tim Chase python.l...@tim.thechases.com wrote:

 While I'm not sure how much of Roy's comment was hah, hah, just
 serious, this has been my biggest issue with long-running Python
 processes on Win32 -- either power outages the UPS can't handle,
 or (more frequently) the updates

Win32 is also the only OS in common use known to fragment memory
enough to make long-running processes crash or hang (including system
services), and require reboots on regular basis. Algorithms haven't
changed, but it takes a bit longer for the heap to go fubar with
Win64. (That is, longer as in you're dead long before it happens.)
For processes that needs to run that long, I would really recommend
using Win64 and Python compiled for amd64.

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


Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-10 Thread sturlamolden
On 9 Jul, 02:02, Neil Hodgson nyamatongwe+thun...@gmail.com wrote:

    If you break the rules by using malloc rather than IMalloc for memory
 that is deallocated by a different component to that which allocated it
 or try to pass around FILE* objects then you will see failures.

Yes, the CRT issue applies to COM as well. COM developers are even
less aware of this than Python developers.

 So,
 always follow the COM rules.

Or just avoid COM...

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


Re: Sumatra m/l?

2010-07-10 Thread Aahz
In article mailman.538.1278800746.1673.python-l...@python.org,
Antoine Pitrou  solip...@pitrou.net wrote:
On 10 Jul 2010 13:48:09 -0700
a...@pythoncraft.com (Aahz) wrote:
 
 Also, it's pretty rude to set followups to gmane.comp.python.general

Can you expand?

If you look at the original post's headers, you'll see

Followup-To: gmane.comp.python.general

which does not exist on my news server.
-- 
Aahz (a...@pythoncraft.com)   * http://www.pythoncraft.com/

Normal is what cuts off your sixth finger and your tail...  --Siobhan
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Issues compiling 2.6.5 on AIX 6.1

2010-07-10 Thread Dan Stromberg
On Fri, Jul 9, 2010 at 5:54 AM, Stopp, Bryan bryan.st...@argushealth.comwrote:

 I checked, none of the files are symlinks. The install process never got
 to the point where it created sym-links for libraries (if it even does,
 I haven't gotten to that point in the install process.)

 -B

 -Original Message-
 From: python-list-bounces+cbds=argushealth@python.org
 [mailto:python-list-bounces+cbds python-list-bounces%2Bcbds=
 argushealth@python.org] On Behalf
 Of Thomas Jollans
 Sent: Friday, July 09, 2010 7:10 AM
 To: python-list@python.org
 Subject: Re: Issues compiling 2.6.5 on AIX 6.1

 On 07/08/2010 04:36 PM, Stopp, Bryan wrote:
  building '_struct' extension
 
  gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
  -Wstrict-prototypes -I. -I/build/tools/src/Python-2.6.5/./Include
  -I/build/tools/include -I. -IInclude -I./Include -I/usr/local/include
  -I/build/tools/src/Python-2.6.5/Include
 -I/build/tools/src/Python-2.6.5
  -c /build/tools/src/Python-2.6.5/Modules/_struct.c -o
  build/temp.aix-6.1-2.6/build/tools/src/Python-2.6.5/Modules/_struct.o
 
  ./Modules/ld_so_aix gcc -pthread -bI:Modules/python.exp
  build/temp.aix-6.1-2.6/build/tools/src/Python-2.6.5/Modules/_struct.o
  -L/build/tools/lib -L/usr/local/lib -lpython2.6 -o
  build/lib.aix-6.1-2.6/_struct.so
 
  collect2: library libpython2.6 not found

 What really stumps me (and you too, I expect) about this is the two
 different error messages. Above, it looks like collect2 simply doesn't
 find a -lpython2.6 anywhere. Adding . to LIBPATH does make sense.

  building '_struct' extension
 
  gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
  -Wstrict-prototypes -I. -I/build/tools/src/Python-2.6.5/./Include
  -I/build/tools/include -I. -IInclude -I./Include -I/usr/local/include
  -I/build/tools/src/Python-2.6.5/Include
 -I/build/tools/src/Python-2.6.5
  -c /build/tools/src/Python-2.6.5/Modules/_struct.c -o
  build/temp.aix-6.1-2.6/build/tools/src/Python-2.6.5/Modules/_struct.o
 
  ./Modules/ld_so_aix gcc -pthread -bI:Modules/python.exp
  build/temp.aix-6.1-2.6/build/tools/src/Python-2.6.5/Modules/_struct.o
  -L/build/tools/lib -L/usr/local/lib -lpython2.6 -o
  build/lib.aix-6.1-2.6/_struct.so
 
  ld: 0706-006 Cannot find or open library file: -l python2.6
 
  ld:open(): No such file or directory
 
  collect2: ld returned 255 exit status

 But what on earth is this? It looks like collect2 found the library, and
 told it's mate ld, which can't open it. collect2 thinks it find a file,
 ld hits No such file or directory on the same file.

 Maybe it's a dead symlink? Looking for a file with the right name and
 location would find it, while opening it would hit a dead end, and
 probably return No such file 


It's been a while since I've used AIX, but is it possible you're mixing 32
bit and 64 bit operations?  AIX shared libraries:
1) Are closer to windows dll's than *ix .so's - unsurprising given that
Windows shares a heritage with OS/2, and both OS/2 and AIX are from IBM.
2) A .a can hold both 32 bit and 64 bit objects.
3) If you have a .a with 32 objects in it, and try to link against it in 64
bit mode, the file is sort of there and sort of not - ls will see it, but
the linker will not.
4) 32 bit libraries suffer from a loader domain issue - the first part of
$LIBPATH optionally specifies a loader domain, which is a namespace into
which shared libraries are loaded
5) 64 bit libraries are supposed to be cleaner than 32 bit
6) Make sure that if you're building for 64 bit (for example) that ld is
doing the same when it's called from collect2 or whatever.
7) You can test what kind of shared library you're looking at (and sometimes
.a's are _shared_ on AIX - yes, it's weird, yes, it's true) with ar -X - see
the man page for more.

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


Re: Sumatra m/l?

2010-07-10 Thread Dan Goodman

On 10/07/2010 22:08, Neal Becker wrote:

Sumatra looks like an interesting project
http://pypi.python.org/pypi/Sumatra/0.2

But I have some questions.  Is there any mail list or forum?  I can't find
anything on the website.


It's part of Neural Ensemble which has a google group (not specifically 
devoted to Sumatra, but all their projects):


http://groups.google.com/group/neuralensemble

Dan

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


grailbrowser now running under python 2.5 (probably above too)

2010-07-10 Thread Luke Kenneth Casson Leighton
source at:
http://github.com/lkcl/grailbrowser

$ python grail.py (note the lack of python1.5 or python2.4)

conversion of the 80 or so regex's to re has been carried out.
entirely successfully or not is a matter yet to be determined.  always
a hoot to try browsing http://www.bbc.co.uk or http://www.youtube.com
with a browser from 11+ years ago, it still cannot be resisted as
grail is the only working graphical web browser in the world written
in pure python [pybrowser is still in development, stalled].

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


integer = 1 == True and integer.0 == False is bad, bad, bad!!!

2010-07-10 Thread rantingrick
Let me tell you folks about a recent case of culo rojo i experianced
whilst creating a customized bin packer with Python. First i want to
say that i actually like the fact that i can do this..

py a = []
py if a:
... do something

Instead of this

py if len(a)  0:
... do something

Ok but the buck stops with integers. Why? you ask in amazing
befuddlement...Well I happened upon this atrocity when creating
variables that hold indexes into a python list. the variables where
named choice1 and choice2 and both where initialized to None. Fine no
problem there. So the algorithm will search for the two best choices.
The first choice choice1 will always be array[0]. The second choice
choice2 will need to be found using a completely different
algorithm. ...Well i could tell you about it but i would rather just
show you with some simple code..

array = [c1,c2,c3,c4,c5,c6,...]
while looping:
choiceIdx1 = None
choiceIdx2 = None
if array[0] meets condition this condition:
choiceIdx1 = 0
for i in range(len(array)):
if array[i] meets this condition:
choiceIdx2 = i
break
if choiceIdx1 and not choiceIdx2:
best = array.pop(choiceIdx1)
elif choiceIdx2 and not choiceIdx1:
best = array.pop(choiceIdx2)
elif choiceIdx1 and choiceIdx2:
# figure out which choice is better.
best = choiceIdx1 if choiceIdx1.better() else choiceIdx2
elif not choiceIdx1 and not choiceIdx2:
break
else:
# assume the worst
raise
do_somthing_with(best)

BUT THAT WONT WORK BECAUSE OF CRAPPY INTEGER BOOLEAN DEFAULTS! So i
had to do this crap...!

array = [c1,c2,c3,c4,c5,c6,...]
while looping:
choiceIdx1 = ()
choiceIdx2 = ()
if array[0] meets condition this condition:
choiceIdx1 = (0,)
for i in range(len(array)):
if array[i] meets this condition:
choiceIdx2 = (i,)
break
if choiceIdx1 and not choiceIdx2:
best = array.pop(choiceIdx1[0])
elif choiceIdx2 and not choiceIdx1:
best = array.pop(choiceIdx2[0])
elif choiceIdx1 and choiceIdx2:
# figure out which choice is better.
best = choiceIdx1[0] if choiceIdx1.better() else choiceIdx2[0]
elif not choiceIdx1 and not choiceIdx2:
break
else:
# assume the worst
raise
do_somthing_with(best)

Seems kinda dumb to build a tuple just so a conditional wont blow
chunks! This integer bool-ing need to be fixed right away!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: grailbrowser now running under python 2.5 (probably above too)

2010-07-10 Thread rantingrick
On Jul 10, 10:59 pm, Luke Kenneth Casson Leighton
luke.leigh...@gmail.com wrote:
 source at:http://github.com/lkcl/grailbrowser

 $ python grail.py (note the lack of python1.5 or python2.4)

 conversion of the 80 or so regex's to re has been carried out.
 entirely successfully or not is a matter yet to be determined.  always
 a hoot to try browsinghttp://www.bbc.co.ukorhttp://www.youtube.com
 with a browser from 11+ years ago, it still cannot be resisted as
 grail is the only working graphical web browser in the world written
 in pure python [pybrowser is still in development, stalled].

 l.

Congratulations on this effort Luke. However you know what project i
would really like to see the community get around? ...dramatic pause
here... a cross platform Python file browser! Yes i know there are
tons of them out there already and Python is a bit slow, but i think
it would be useful to many peoples.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: integer = 1 == True and integer.0 == False is bad, bad, bad!!!

2010-07-10 Thread Stephen Hansen
On 7/10/10 10:38 PM, rantingrick wrote:
 Seems kinda dumb to build a tuple just so a conditional wont blow
 chunks! This integer bool-ing need to be fixed right away!

Yes, let us penalize the thousands of use cases where 0 being false is
useful and good, for the benefit of the one use-case (indexing) where it
is not.

You don't need to build a tuple. Just change the tests, to if
choiceIdx1 is not None. Its a little more work, sure. But its not
enough that its even vaguely worth breaking the otherwise very useful
behavior of bool(0) == False.

-- 

   Stephen Hansen
   ... Also: Ixokai
   ... Mail: me+list/python (AT) ixokai (DOT) io
   ... Blog: http://meh.ixokai.io/



signature.asc
Description: OpenPGP digital signature
-- 
http://mail.python.org/mailman/listinfo/python-list


[issue2007] cookielib lacks FileCookieJar class for Internet Explorer

2010-07-10 Thread Terry J. Reedy

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

Removed file was a dup of msg62113 Jansen  2008-02-06 13:34

FileCookieJars are now in http.cookiejar. Doc says The following CookieJar 
subclasses are provided for reading and writing . Further CookieJar subclasses, 
including one that reads Microsoft Internet Explorer cookies, are available at 
http://wwwsearch.sf.net/ClientCookie/.;

Link does not work and appears to be superseded by
http://wwwsearch.sourceforge.net/mechanize/

If this issue is closed, at least that doc change should be made.

--
nosy: +tjreedy
versions: +Python 3.2 -Python 2.6, Python 3.0

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



[issue3647] urlparse - relative url parsing and joins to be RFC3986 compliance

2010-07-10 Thread Terry J. Reedy

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


--
versions: +Python 3.2 -Python 2.6, Python 3.0

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



[issue4246] execution model - clear and complete example in documentation

2010-07-10 Thread Terry J. Reedy

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


--
versions: +Python 3.2 -Python 2.6

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



[issue4558] with_stdc89

2010-07-10 Thread Terry J. Reedy

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


--
versions: +Python 3.2 -Python 2.6, Python 2.7, Python 3.0, Python 3.1

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



[issue4805] Make python code compilable with a C++ compiler

2010-07-10 Thread Terry J. Reedy

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


--
versions: +Python 3.2 -Python 2.6

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



[issue4805] Make python code compilable with a C++ compiler

2010-07-10 Thread Terry J. Reedy

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


--
stage:  - patch review

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



[issue813453] restrictions in _tkinter built with threaded tk undocumented

2010-07-10 Thread Terry J. Reedy

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

Is this still valid (or has something already been added)?
If so, do you still think it is needed (we seem to have gotten along without it 
for 7 years)?
If so, will you rewrite the snippet (it starts with with a dangling 'this') and 
specify where you would put it?

Response with reset this to open.

--
nosy: +tjreedy
resolution:  - out of date
status: open - pending
versions: +Python 2.7, Python 3.1, Python 3.2 -Python 3.0

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



[issue1887] distutils doesn't support out-of-source builds

2010-07-10 Thread Terry J. Reedy

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

Roumen's comments suggest that this should be closed.
Monty, do you disagree?

--
nosy: +tjreedy
versions: +Python 3.2 -Python 2.6

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



[issue1977] Python reinitialization test

2010-07-10 Thread Terry J. Reedy

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


--
versions: +Python 3.2 -Python 2.6, Python 3.0

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



[issue1554133] PyOS_InputHook() and related API funcs. not documented

2010-07-10 Thread Terry J. Reedy

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


--
versions: +Python 2.7, Python 3.1, Python 3.2

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



[issue1626300] 'Installing Python Modules' does not work for Windows

2010-07-10 Thread Terry J. Reedy

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


--
versions: +Python 2.7, Python 3.2

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



[issue1643712] Emphasize buffering issues when sys.stdin is used

2010-07-10 Thread Terry J. Reedy

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


--
assignee:  - d...@python
keywords: +patch
nosy: +d...@python
stage: unit test needed - 
versions: +Python 2.7, Python 3.1, Python 3.2 -Python 3.0

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



[issue1539925] warnings in interactive sessions

2010-07-10 Thread Terry J. Reedy

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


--
versions: +Python 3.2 -Python 2.6

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



[issue1720250] PyGILState_Ensure does not acquires GIL

2010-07-10 Thread Terry J. Reedy

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

Please check whether this is still an issue in 3.1, so that there is still an 
issue for 3.2.

--
nosy: +tjreedy
versions: +Python 3.2 -Python 2.6, Python 3.0

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



[issue1349732] urllib.urlencode provides two features in one param

2010-07-10 Thread Terry J. Reedy

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

put something somewhere will not get action.
Please suggest specific wording and a specific place to put it and mark it TEXT 
or PATCH or something so a doc person can find it.

I am assuming that this does not apply to 3.x.

--
assignee: georg.brandl - d...@python
nosy: +d...@python, tjreedy
versions: +Python 2.7

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



[issue5888] mmap ehancement - resize with sequence notation

2010-07-10 Thread Terry J. Reedy

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


--
components: +Library (Lib)
stage:  - unit test needed
versions: +Python 3.2 -Python 2.6

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



[issue1376292] Write user's version of the reference guide

2010-07-10 Thread Terry J. Reedy

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


--
versions: +Python 3.2 -Python 2.6, Python 3.1

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



[issue2053] IDLE - standardize dialogs

2010-07-10 Thread Terry J. Reedy

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


--
versions: +Python 3.2 -Python 2.6

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



[issue7136] Idle File Menu Option Improvement

2010-07-10 Thread Terry J. Reedy

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


--
stage:  - needs patch
versions: +Python 3.2 -Python 2.6

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



[issue1865] Bytes alias for 2.6

2010-07-10 Thread Terry J. Reedy

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

Still not in 2.7: 2.4.1. String literals
include not in the grammar section.

--
nosy: +tjreedy
stage:  - needs patch

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



[issue8040] It would be nice if documentation pages linked to other versions of the same document

2010-07-10 Thread Terry J. Reedy

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

The link does not currently work.
I think this effectively impossible for volunteers. Microsoft has 1000s of paid 
employees. Chapter and Sections numbers do not match from version to version.
How many other versions would you link to? Multiple links could get a bit ugly.

What might be done is to put one permanent link to All doc versions on the 
sidebar.

--
nosy: +tjreedy
versions:  -Python 2.6

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



[issue6728] To avoid hang up in using CGIXMLRPCRequestHandler under IIS 7.x

2010-07-10 Thread Terry J. Reedy

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


--
versions: +Python 3.2 -Python 2.6

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



[issue6741] Garbage collector release method

2010-07-10 Thread Terry J. Reedy

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


--
stage:  - unit test needed
versions: +Python 3.2 -Python 2.6

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



[issue8040] It would be nice if documentation pages linked to other versions of the same document

2010-07-10 Thread Ezio Melotti

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

I think I've already discussed this with Georg a while ago and we ended up 
adding the links on the left sidebar in http://docs.python.org/.
IIRC there's no easy way to find the same document in another version of the 
doc, not even now with Sphinx.
I think this can be closed, unless Georg disagrees.

--
status: open - pending

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



[issue9110] contextlib.ContextDecorator

2010-07-10 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

Jack, thanks for the explanation.  Glad it seems sensible to more than just one 
person.  To my eyes, it looks like a little too much magic and I would be more 
comfortable if this idea and its variants had been explored more thoroughly by 
the community before it got injected into the standard library.

--

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



[issue9215] test_float crashes with assertion failure on Ubuntu buildbot.

2010-07-10 Thread Matthias Klose

Matthias Klose d...@debian.org added the comment:

 what version of gcc is being used by this buildslave

you already found out, but it's mentioned at the top of the test stdio. I'll 
update the compiler and recheck.

--

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



[issue1147646] Windows deadlock with PyEval_ReleaseLock

2010-07-10 Thread Amaury Forgeot d'Arc

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

This is actually the same issue as issue1720250

--
resolution:  - duplicate
status: open - closed
superseder:  - PyGILState_Ensure does not acquires GIL

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



[issue9215] test_float crashes with assertion failure on Ubuntu buildbot.

2010-07-10 Thread Mark Dickinson

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

On Sat, Jul 10, 2010 at 8:26 AM, Matthias Klose rep...@bugs.python.org wrote:
 you already found out, but it's mentioned at the top of the test stdio.

Ah yes, so it is.  Thank you.  I thought I remembered seeing it
somewhere in the buildbot output in the past;  I obviously didn't look
hard enough.

 I'll update the compiler and recheck.

Thank you again!

--

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



[issue1720250] PyGILState_Ensure does not acquires GIL

2010-07-10 Thread Amaury Forgeot d'Arc

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

This is still the case: the documentation should mention that 
PyEval_ReleaseLock() is not the correct function to release the GIL, both the 
interpreter lock *and* the current thread state have to be released.

--
assignee:  - d...@python
components:  -Interpreter Core
nosy: +amaury.forgeotdarc, d...@python

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



[issue9110] contextlib.ContextDecorator

2010-07-10 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

The idea of building this into contextlib actually came out on off-list 
discussion between Michael and I. To quote the original suggestion he sent to 
me:

What do you think about adding ContextDecorator to contextlib for Python 3.2?

http://pypi.python.org/pypi/contextdecorator

It's a simple recipe but useful nonetheless (and Barry Warsaw at least is very 
enthusiastic about it ;-).

ContextDecorator allows you to create APIs that behave as both context managers 
and as decorators. It also provides the optional exception handling capability 
of __exit__ for decorators. This isn't an uncommon pattern, used in libraries 
like mock, py.test and django, and it is at least slightly fiddly to get 
right.

I agree it is good to have that additional motivation (and the reference to 
previous work) here in the tracker issue rather than squirreled away in a 
couple of private email archives.

--

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



[issue9110] contextlib.ContextDecorator

2010-07-10 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

One thing that Jack's confusion above does suggest to me is that we should 
mention in the *ContextDecorator* documentation that it is automatically 
applied to the context managers created when you use @contextmanager. A lot of 
people familiar with contextmanager are just going to read the docs for the new 
toy, so may miss the fact that we have added __call__ support to 
GeneratorContextManager.

As far as use cases go, this change is just syntactic sugar for any construct 
of the following form:

  def f():
with cm():
  # Do stuff

ContextDecorator lets you instead write:

  @cm
  def f():
# Do stuff

It makes it clear that the CM applies to the whole function, rather than just a 
piece of it (and saving an indentation level is nice, too).

--

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



[issue9110] contextlib.ContextDecorator

2010-07-10 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

 this change is just syntactic sugar for
 any construct of the following form:

  def f():
with cm():
  # Do stuff

 ContextDecorator lets you instead write:

  @cm
  def f():
# Do stuff

Nicely expressed.  This ought to go directly into the documentation.

--

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



[issue876421] logging handlers raise exception on level

2010-07-10 Thread Vinay Sajip

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

If I did this for some but not handler classes, then people would probably log 
issues saying e.g. Why doesn't NTEventLogHandler support a level argument? 
Other handlers do. etc.

What's the big problem with using setLevel() to set the level? If you're after 
convenience, you could use the dictionary configuration API which allows you to 
set the levels declaratively.

--

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



[issue4277] asynchat's handle_error inconsistency

2010-07-10 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
stage:  - unit test needed
versions: +Python 3.1, Python 3.2 -Python 3.0

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4277
___
___
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

2010-07-10 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
versions: +Python 2.7, Python 3.1, Python 3.2 -Python 2.6

___
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



[issue1521950] shlex.split() does not tokenize like the shell

2010-07-10 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
versions: +Python 3.2 -Python 2.7

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



[issue1522400] irda socket support

2010-07-10 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
components: +Library (Lib) -Extension Modules
stage: unit test needed - patch review
versions: +Python 3.2 -Python 2.7, Python 3.1

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



  1   2   3   4   >