Re: PEP 391 (Dictionary-Based Configuration for Logging) Updated

2009-10-28 Thread Wolodja Wentland
On Wed, Oct 28, 2009 at 10:27 +, Vinay Sajip wrote: I've updated PEP 391 (Dictionary-Based Configuration for Logging): http://svn.python.org/view/peps/trunk/pep-0391.txt?r1=75599r2=75918 +1 All feedback gratefully received! The PEP does not seem to specify how handler are retrieved by

Re: IDLE python shell freezes after running show() of matplotlib

2009-10-28 Thread OKB (not okblacke)
Forrest Sheng Bao wrote: I am having a weird problem on IDLE. After I plot something using show () of matplotlib, the python shell prompt in IDLE just freezes that I cannot enter anything and there is no new prompt show up. I tried ctrl - C and it didn't work. I have to restart IDLE to use

Re: how to zip a StringIO object?

2009-10-28 Thread Dave Angel
Nagy Viktor wrote: Hi, I try to run the following code: def generate_zip(object_list, template): result = StringIO.StringIO() zipped = zipfile.ZipFile(result, w) for object in object_list: pdf = generate_pdf(object, template) if not pdf: raise

Re: Web development with Python 3.1

2009-10-28 Thread Dotan Cohen
It did not look like I had any control over the tags at all. I can tell you you have full control over the whole HTTP response's content and headers. And FWIW, this has nothing to do with templating systems. That's good to know. Actually, it's more that good: I am looking into Django again.

Re: Web development with Python 3.1

2009-10-28 Thread Dotan Cohen
I've already given you that for TG: class RootController(BaseController):   @expose()   def page(self, torwalds=None):       return htmlbodyp%s/p/body/html % (torwalds if torwalds else Does return mean that this could not be used in the middle of a page? Of course nobody would do it

Building Python on Solaris 10?

2009-10-28 Thread Judy Booth
Can anyone point me towards some instructions for building Python on Solaris 10? We need this for some of our test scripts and so far we cannot get this to build. We have tried both Python 2.6.4 and 3.1.1 and both fail with messages like this: Include/pyport.h:685:2: #error LONG_BIT definition

Re: Web development with Python 3.1

2009-10-28 Thread Dotan Cohen
Actually, currently in the example url http://example.com/path/to/script.py?var1=hellovar2=world the script is /home/user/site-name/public_html/path/ (with no filename extension) and the script.py is actually page.html which is an arbitrary, descriptive string and not part of the script

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-28 Thread Dann Corbit
In article hc8pn3$dd...@news.eternal-september.org, al...@start.no says... [Cross-posted comp.programming and comp.lang.python] Hi. I may finally have found the perfect language for a practically oriented introductory book on programming, namely Python. C++ was way too complex for

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-28 Thread Dann Corbit
In article pan.2009.10.28.07.31...@remove.this.cybersource.com.au, ste...@remove.this.cybersource.com.au says... On Wed, 28 Oct 2009 07:52:17 +0100, Alf P. Steinbach wrote: Unfortunately Google docs doesn't display the nice table of contents in each document, but here's the public view

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-28 Thread Alf P. Steinbach
* Dann Corbit: In article hc8pn3$dd...@news.eternal-september.org, al...@start.no Unfortunately Google docs doesn't display the nice table of contents in each document, but here's the public view of ch 1 (complete) and ch 2 (about one third completed, I've not yet settled on a title so it's

Re: Question on PEP 337 (Vinay Sajip)

2009-10-28 Thread Gabor Urban
Hy guys, Sorry, Vinay Sajip was right. I wrote my questions about PEP 391. I would like to know your ideas about my questions posted in my last mail. Gabor -- Linux: Choice of a GNU Generation -- http://mail.python.org/mailman/listinfo/python-list

Re: Web development with Python 3.1

2009-10-28 Thread Rami Chowdhury
On Wed, 28 Oct 2009 12:42:17 -0700, Dotan Cohen dotanco...@gmail.com wrote: I've already given you that for TG: class RootController(BaseController):   @expose()   def page(self, torwalds=None):       return htmlbodyp%s/p/body/html % (torwalds if torwalds else Does return mean that

Re: Hello, world?

2009-10-28 Thread CM
On Oct 28, 5:40 am, Gilles Ganault nos...@nospam.com wrote: Hello I'm reading O'Reily's Python Programming on Win32, but couldn't find a simple example on how to create a window with just a label and pushbutton. If someone has such a basic example handy, I'm interested. Thank you. In

Re: Web development with Python 3.1

2009-10-28 Thread Dotan Cohen
What do you mean by in the middle of the page? Do you mean, for instance, the behavior of middle.php in the following PHP example: ?php include_once(beginning.inc.php); include_once(middle.php); include_once(end.inc.php); ? Is that what you are after? Yes, that is what I am after.

Re: ConfigParser.items sorting

2009-10-28 Thread Dean McClure
On Oct 28, 4:50 pm, Jon Clements jon...@googlemail.com wrote: On 28 Oct, 06:21, Dean McClure bratpri...@gmail.com wrote: Hi, Just wondering how I can get theitems() command fromConfigParserto not resort all the item pairs that it presents. I am trying to get it to read some data in

Re: IDLE python shell freezes after running show() of matplotlib

2009-10-28 Thread Chris Colbert
This is a threading issue that is very common when using gui toolkits with the interactive interpreter. You're better off just using ipython, which already has builtin support for matplotlib when you start it via ipython -pylab On Wed, Oct 28, 2009 at 7:41 PM, OKB (not okblacke)

Re: calling server side function

2009-10-28 Thread Chris Colbert
I second the suggestion for XML-RPC... It also solves the security issue in your example, by only exporting functions you specifically register... look at xmlrpclib in the standard python library. On Wed, Oct 28, 2009 at 8:59 AM, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Wed, 28 Oct

Re: PEP 391 (Dictionary-Based Configuration for Logging) Updated

2009-10-28 Thread Vinay Sajip
Wolodja Wentland wentland at cl.uni-heidelberg.de writes: All feedback gratefully received! The PEP does not seem to specify how handler are retrieved by their name/id. How should this work? Especially given the statement: The handler name lookup dictionary is for configuration use

Bug(s) in Python 3.1.1 Windows installation

2009-10-28 Thread Alf P. Steinbach
Hi. Or, to whomever this concerns... ;-) I thought it would be prudent to install 3.1.1 for Windows from scratch, so I uninstalled everything (CPython, ActivePython), and then installed Python 3.1.1. In the Advanced option I told the installer to compile packages. The compiler then found a

Re: Question on PEP 337

2009-10-28 Thread Vinay Sajip
Gabor Urban urbangabo at gmail.com writes: Hy guys, this PEP is very well written, and I have found the discussion inspiring. Every time I use the logging module, I have the configuration hardcoded in the application. That is why I never used the configuration file based approach. Now

Re: Bug(s) in Python 3.1.1 Windows installation

2009-10-28 Thread Alf P. Steinbach
* Alf P. Steinbach: Hi. Or, to whomever this concerns... ;-) I thought it would be prudent to install 3.1.1 for Windows from scratch, so I uninstalled everything (CPython, ActivePython), and then installed Python 3.1.1. In the Advanced option I told the installer to compile packages. The

Re: Web development with Python 3.1

2009-10-28 Thread Albert Hopkins
On Wed, 2009-10-28 at 15:32 +0200, Dotan Cohen wrote: def index(request): unmaintanable_html = html head titleIndex/title /head body h1Embedded HTML is a PITA/h1 pbut some like pains.../p /body /html return HttpResponse(unmaintanable_html) And if

Re: Web development with Python 3.1

2009-10-28 Thread Rami Chowdhury
On Wed, 28 Oct 2009 14:15:54 -0700, Dotan Cohen dotanco...@gmail.com wrote: What do you mean by in the middle of the page? Do you mean, for instance, the behavior of middle.php in the following PHP example: ?php include_once(beginning.inc.php); include_once(middle.php);

Re: Web development with Python 3.1

2009-10-28 Thread Albert Hopkins
On Wed, 2009-10-28 at 16:38 +0200, Dotan Cohen wrote: return HttpResponse(unmaintanable_html % data) That's fine for single variables, but if I need to output a table of unknown rows? I assume that return means the end of the script. Therefore I should shove the whole table into a

Re: ftpilb.FTP.stor...() freeze mystery

2009-10-28 Thread Gabriel Genellina
En Wed, 28 Oct 2009 08:05:22 -0300, Anthra Norell anthra.nor...@bluewin.ch escribió: Gabriel Genellina wrote: En Tue, 27 Oct 2009 07:53:36 -0300, Anthra Norell anthra.nor...@bluewin.ch escribió: I am trying to upload a bunch of web pages to a hosting service.[...] I wrote a loop that

Working threads progress

2009-10-28 Thread mattia
hi all, I have a simple program that uses multiple threads to carry out some work. Every threads share the same queue.Queue() (that is synchronized) in order to get some data and then carry out the work. Suppose I have something like: q = queue.Queue() for x in range(100): q.put(x) then I

Re: ConfigParser.items sorting

2009-10-28 Thread Jon Clements
On 28 Oct, 21:55, Dean McClure bratpri...@gmail.com wrote: On Oct 28, 4:50 pm, Jon Clements jon...@googlemail.com wrote: On 28 Oct, 06:21, Dean McClure bratpri...@gmail.com wrote: Hi, Just wondering how I can get theitems() command fromConfigParserto not resort all the item pairs

Re: popen function of os and subprocess modules

2009-10-28 Thread Albert Hopkins
On Wed, 2009-10-28 at 07:15 -0700, banu wrote: Thanks for the reply Jon Basically I need to move into a folder and then need to execute some shell commands(make etc.) in that folder. I just gave 'ls' for the sake of an example. The real problem I am facing is, how to stay in the folder

Re: ConfigParser.items sorting

2009-10-28 Thread Dean McClure
On Oct 29, 9:05 am, Jon Clements jon...@googlemail.com wrote: On 28 Oct, 21:55, Dean McClure bratpri...@gmail.com wrote: On Oct 28, 4:50 pm, Jon Clements jon...@googlemail.com wrote: On 28 Oct, 06:21, Dean McClure bratpri...@gmail.com wrote: Hi, Just wondering how I can get

Re: Bug(s) in Python 3.1.1 Windows installation

2009-10-28 Thread Gabriel Genellina
En Wed, 28 Oct 2009 19:18:48 -0300, Alf P. Steinbach al...@start.no escribió: I thought it would be prudent to install 3.1.1 for Windows from scratch, so I uninstalled everything (CPython, ActivePython), and then installed Python 3.1.1. In the Advanced option I told the installer to

Re: Bug(s) in Python 3.1.1 Windows installation

2009-10-28 Thread Gabriel Genellina
En Wed, 28 Oct 2009 19:30:13 -0300, Alf P. Steinbach al...@start.no escribió: Hm, the installer forgot to clean up, leaving lots of files, so contrary to the dialog's final message the system had been modified. If those files are third-party libraries, this confirms my previous post.

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-28 Thread Gabriel Genellina
En Wed, 28 Oct 2009 08:49:02 -0300, Alf P. Steinbach al...@start.no escribió: I suggested ActiveState because I know from earlier that their packages are easy to install and provide documentation in reasonable Windows CHM help file format. I did try the IronPython .NET implementation first

Re: Web development with Python 3.1

2009-10-28 Thread Rhodri James
On Wed, 28 Oct 2009 07:08:12 -, John Nagle na...@animats.com wrote: Alan Harris-Reid wrote: I am very much new to Python, and one of my first projects is a simple data-based website. I am starting with Python 3.1 Until MySQLdb gets ported to something later than Python 2.5, support

Re: Bug(s) in Python 3.1.1 Windows installation

2009-10-28 Thread Alf P. Steinbach
* Alf P. Steinbach: * Alf P. Steinbach: Hi. Or, to whomever this concerns... ;-) I thought it would be prudent to install 3.1.1 for Windows from scratch, so I uninstalled everything (CPython, ActivePython), and then installed Python 3.1.1. In the Advanced option I told the installer to

Re: Bug(s) in Python 3.1.1 Windows installation

2009-10-28 Thread Alf P. Steinbach
* Gabriel Genellina: En Wed, 28 Oct 2009 19:30:13 -0300, Alf P. Steinbach al...@start.no escribió: Hm, the installer forgot to clean up, leaving lots of files, so contrary to the dialog's final message the system had been modified. If those files are third-party libraries, this confirms my

Re: Bug(s) in Python 3.1.1 Windows installation

2009-10-28 Thread Alf P. Steinbach
* Gabriel Genellina: En Wed, 28 Oct 2009 19:18:48 -0300, Alf P. Steinbach al...@start.no escribió: I thought it would be prudent to install 3.1.1 for Windows from scratch, so I uninstalled everything (CPython, ActivePython), and then installed Python 3.1.1. In the Advanced option I told the

Re: Bug(s) in Python 3.1.1 Windows installation

2009-10-28 Thread Mark Hammond
On 29/10/2009 11:06 AM, Alf P. Steinbach wrote: So I suggest switching to some other more light-weight installer technology. Thanks for the suggestion, but I expect we will stick with MSI even with its shortcomings. Using MSI files has significant other advantages, particularly in managed

Re: Copying a ZipExtFile

2009-10-28 Thread ryles
On Oct 23, 1:15 pm, Moore, Mathew L moor...@battelle.org wrote: Hello all, A newbie here.  I was wondering why the following fails on Python 2.6.2 (r262:71605) on win32.  Am I doing something inappropriate? Interestingly, it works in 3.1, but would like to also get it working in 2.6.

Re: Re: Web development with Python 3.1

2009-10-28 Thread Alan Harris-Reid
John Nagle wrote: div class=moz-text-flowedAlan Harris-Reid wrote: I am very much new to Python, and one of my first projects is a simple data-based website. I am starting with Python 3.1 Until MySQLdb gets ported to something later than Python 2.5, support for a data-based web site

Python 2.6 Global Variables

2009-10-28 Thread mattofak
Hi All; I'm new to Python and moving from C, which is probably a big source of my confusion. I'm struggling with something right now though and I hope you all can help. I have a global configuration that I would like all my classes and modules to be able to access. What is the correct way to do

Re: Web development with Python 3.1

2009-10-28 Thread Alan Harris-Reid
Martin v. Löwis wrote: I am very much new to Python, and one of my first projects is a simple data-based website. I am starting with Python 3.1 (I can hear many of you shouting don't - start with 2.6), but as far as I can see, none of the popular python-to-web frameworks (Django, CherryPy,

Re: Bug(s) in Python 3.1.1 Windows installation

2009-10-28 Thread Alf P. Steinbach
* Mark Hammond: On 29/10/2009 11:06 AM, Alf P. Steinbach wrote: So I suggest switching to some other more light-weight installer technology. Thanks for the suggestion, but I expect we will stick with MSI even with its shortcomings. Using MSI files has significant other advantages,

Re: Python 2.6 Global Variables

2009-10-28 Thread Ronn Ross
Inside the method that you want to use the var prefix the first instance with global. For example: global my_var. Then you can use the var like normal in the method. Good luck On Oct 28, 2009, at 20:50, mattofak matto...@gmail.com wrote: Hi All; I'm new to Python and moving from C, which

Re: Python 2.6 Global Variables

2009-10-28 Thread Chris Rebert
On Oct 28, 2009, at 20:50, mattofak matto...@gmail.com wrote: Hi All; I'm new to Python and moving from C, which is probably a big source of my confusion. I'm struggling with something right now though and I hope you all can help. I have a global configuration that I would like all my

Re: Form Parsing resouces

2009-10-28 Thread Tim Johnson
On 2009-10-28, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: ... Try FormEncode http://formencode.org/ Wish I had noticed that yesterday. I started rolling my own and am about 2/3's way thru. thanks -- Tim t...@johnsons-web.com http://www.akwebsoft.com --

Re: Python 2.6 Global Variables

2009-10-28 Thread Benjamin Kaplan
On Wed, Oct 28, 2009 at 8:50 PM, mattofak matto...@gmail.com wrote: Hi All; I'm new to Python and moving from C, which is probably a big source of my confusion. I'm struggling with something right now though and I hope you all can help. I have a global configuration that I would like all my

Re: Bug(s) in Python 3.1.1 Windows installation

2009-10-28 Thread David Robinow
On Wed, Oct 28, 2009 at 8:06 PM, Alf P. Steinbach al...@start.no wrote: PS: This was not unexpected. It was exactly why I earlier didn't even look at CPython (umpteen bad experiences with *nix ports) but used ActivePython. It's not a *nix port. It's multiplatform and it works fine. As you've

Re: popen function of os and subprocess modules

2009-10-28 Thread Sean DiZazzo
On Oct 28, 7:15 am, banu varun.nagp...@gmail.com wrote: On Oct 28, 3:02 pm, Jon Clements jon...@googlemail.com wrote: On 28 Oct, 13:39, banu varun.nagp...@gmail.com wrote: Hi, I am a novice in python. I was trying to write a simple script on Linux (python 3.0) that does the

Re: Bug(s) in Python 3.1.1 Windows installation

2009-10-28 Thread Alf P. Steinbach
* David Robinow: On Wed, Oct 28, 2009 at 8:06 PM, Alf P. Steinbach al...@start.no wrote: PS: This was not unexpected. It was exactly why I earlier didn't even look at CPython (umpteen bad experiences with *nix ports) but used ActivePython. It's not a *nix port. It's multiplatform and it works

Re: Bug(s) in Python 3.1.1 Windows installation

2009-10-28 Thread John Machin
On Oct 29, 11:56 am, Alf P. Steinbach al...@start.no wrote: Summarizing the main differences 2.6 - 3.1.1 that I know of so far: print is now a function (nice), / now always produces float result (unsure about that, it must surely break a lot or even most of existing code?), xrange() has been

__eq__() inconvenience when subclassing set

2009-10-28 Thread Jess Austin
I'm subclassing set, and redefining __eq__(). I'd appreciate any relevant advice. class mySet(set): ... def __eq__(self, other): ... print called mySet.__eq__()! ... if isinstance(other, (set, frozenset)): ... return True ... return set.__eq__(self,

cool-compiling python 3

2009-10-28 Thread Rustom Mody
I guess this is a bit OT but anyhow. I just finished compiling compiling python 3 on ubuntu and discovered that my laptop has a builtin toaster :-; Yeah I know this is not a python issue and probably modern laptops are meant to run wondrous beautiful elephantaneous things like eclipse

Re: Building Python on Solaris 10?

2009-10-28 Thread ryles
On Oct 28, 3:46 pm, Judy Booth j...@invalid.invalid wrote: Can anyone point me towards some instructions for building Python on Solaris 10? We need this for some of our test scripts and so far we cannot get this to build. We have tried both Python 2.6.4 and 3.1.1 and both fail with messages

Re: Working threads progress

2009-10-28 Thread ryles
On Oct 28, 7:02 pm, mattia ger...@gmail.com wrote: Now, I would like to know the activity done (e.g. every two seconds) so I create another thread that checks the queue size (using .qsize()). Have you any suggestion to improve the code? It's not uncommon to pass each thread a second queue for

Re: __eq__() inconvenience when subclassing set

2009-10-28 Thread Mick Krippendorf
Jess Austin schrieb: frozenset([1]) == mySet() False frozenset doesn't use mySet.__eq__() because mySet is not a subclass of frozenset as it is for set. You could just overwrite set and frozenset: class eqmixin(object): def __eq__(self, other): print called %s.__eq__() %

How to test if a file is a symbolic link?

2009-10-28 Thread Peng Yu
'symbolic_link' is a symbolic link in the current directory. I run 'python main.py', but it does not return me anything. I want to check if a file is a symbolic link. I'm wondering what is the correct way to do so? $cat main.py import stat import os st = os.stat('symbolic_link') if

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-28 Thread Richard Heathfield
In mpg.255244b37d76cfb5989...@news.eternal-september.org, Dann Corbit wrote: In article hc8pn3$dd...@news.eternal-september.org, al...@start.no says... snip here's the public view of ch 1 (complete) and ch 2 (about one third completed, I've not yet settled on a title so it's just

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-28 Thread Richard Heathfield
In mpg.255246264331509a989...@news.eternal-september.org, Dann Corbit wrote: snip You can read PDF with the ghostscript stuff or the free Adobe stuff. Agreed. But why should you have to? A man who cannot read .pdf or .ps in today's computer science world is a crippled man (IMO-YMMV). A

Minifb 1.2 released

2009-10-28 Thread peteshinners
I've released version 1.2 of my simple Facebook module, minifb. http://code.google.com/p/minifb/ This is a minimalist API for validating and making calls to Facebook. The new release fixes a few outstanding problems, and adds support for Python 3. Because the module isn't too large, writing it in

Re: How to test if a file is a symbolic link?

2009-10-28 Thread D'Arcy J.M. Cain
On Wed, 28 Oct 2009 22:19:55 -0500 Peng Yu pengyu...@gmail.com wrote: 'symbolic_link' is a symbolic link in the current directory. I run 'python main.py', but it does not return me anything. I want to check if a file is a symbolic link. I'm wondering what is the correct way to do so? $cat

Re: How to test if a file is a symbolic link?

2009-10-28 Thread tec
On 2009-10-29 11:19, Peng Yu wrote: 'symbolic_link' is a symbolic link in the current directory. I run 'python main.py', but it does not return me anything. I want to check if a file is a symbolic link. I'm wondering what is the correct way to do so? $cat main.py import stat import os st =

Re: How to test if a file is a symbolic link?

2009-10-28 Thread Steven D'Aprano
On Wed, 28 Oct 2009 22:19:55 -0500, Peng Yu wrote: 'symbolic_link' is a symbolic link in the current directory. I run 'python main.py', but it does not return me anything. I want to check if a file is a symbolic link. I'm wondering what is the correct way to do so? $cat main.py import

Fix problems with email list

2009-10-28 Thread Spencer Heckathorn
I am getting doubles of every email on this list. Is there a list manager I can inform? Please help this is getting very annoying and makes it very hard to follow along. Spencer -- http://mail.python.org/mailman/listinfo/python-list

Re: How to test if a file is a symbolic link?

2009-10-28 Thread ma
import os if os.path.islink('symbolic_link'): print hello. Cheers, Mahmoud Abdelkader On Oct 28, 2009, at 11:19 PM, Peng Yu pengyu...@gmail.com wrote: 'symbolic_link' is a symbolic link in the current directory. I run 'python main.py', but it does not return me anything. I want to check

Re: How to test if a file is a symbolic link?

2009-10-28 Thread Ben Finney
Peng Yu pengyu...@gmail.com writes: 'symbolic_link' is a symbolic link in the current directory. I run 'python main.py', but it does not return me anything. I want to check if a file is a symbolic link. You have the same access to the Python help as we do: import os.path

Re: calling server side function

2009-10-28 Thread Tim Arnold
Gabriel Genellina gagsl-...@yahoo.com.ar wrote in message news:mailman.2155.1256716617.2807.python-l...@python.org... En Wed, 28 Oct 2009 04:04:50 -0300, Paul Hartley luapyelt...@hotmail.com escribió: I have a socket set up between a client and server program. Let's say that I serialize

Re: a simple unicode question

2009-10-28 Thread Tim Arnold
Chris Jones cjns1...@gmail.com wrote in message news:mailman.2149.1256707687.2807.python-l...@python.org... On Tue, Oct 27, 2009 at 06:21:11AM EDT, Lie Ryan wrote: Chris Jones wrote: [..] Best part of Unicode is that there are multiple encodings, right? ;-) No, the best part about Unicode

Re: Bug(s) in Python 3.1.1 Windows installation

2009-10-28 Thread John Machin
On Oct 29, 11:06 am, Alf P. Steinbach al...@start.no wrote: (3) Tkinter not bundled, misleading incomplete documentation. With the file associations in place (the installer managed to do that) running console programs works fine. However, running Tkinter based programs does *not* work:

Re: What IDE has good git and python support?

2009-10-28 Thread alex23
On Oct 28, 1:56 am, Aweks a...@ewadev.com wrote: what do you use? ActiveState's Komodo IDE. -- http://mail.python.org/mailman/listinfo/python-list

Newbie advice

2009-10-28 Thread CSharpner
Alright, I'm not new to programming, but I'm diving in head first into Python for the first time. I'm running on Windows 7, just installed Eclipse Java EE IDE for Web Developers and installed PyDev in it and installed Python 2.6. I've written my first Hello World program, which simply displays

What exception shall I raise when os.path.exists fails?

2009-10-28 Thread Peng Yu
I want to raise an exception when os.path.exists fails. I looked through the exception list on the menu. I'm not sure if IOError is the most appropriate exception I should use. Could somebody let me know? Thank you! import os.path def direct_target(path): while os.path.islink(path): path =

Re: What exception shall I raise when os.path.exists fails?

2009-10-28 Thread Chris Rebert
On Wed, Oct 28, 2009 at 10:01 PM, Peng Yu pengyu...@gmail.com wrote: I want to raise an exception when os.path.exists fails. I looked through the exception list on the menu. I'm not sure if IOError is the most appropriate exception I should use. Could somebody let me know? Yeah, I'd say

Re: Bug(s) in Python 3.1.1 Windows installation

2009-10-28 Thread Alf P. Steinbach
* John Machin: On Oct 29, 11:06 am, Alf P. Steinbach al...@start.no wrote: (3) Tkinter not bundled, misleading incomplete documentation. With the file associations in place (the installer managed to do that) running console programs works fine. However, running Tkinter based programs does

[issue7227] Shell Support for installation of Python Packages (.EGG)

2009-10-28 Thread Martin v . Löwis
Changes by Martin v. Löwis mar...@v.loewis.de: -- versions: -Python 2.4, Python 2.5, Python 2.6, Python 3.0, Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7227 ___

[issue7228] %lld for PyErr_Format (Modules/_io/bufferedio.c)

2009-10-28 Thread Hirokazu Yamamoto
New submission from Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp: Hello. There is following sentence in Modules/_io/bufferedio.c, PyErr_Format(PyExc_IOError, Raw stream returned invalid position % PY_PRIdOFF, (PY_OFF_T_COMPAT)n); and PY_PRIdOFF == lld

[issue7228] %lld for PyErr_Format (Modules/_io/bufferedio.c)

2009-10-28 Thread Hirokazu Yamamoto
Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp added the comment: I believe r75728 and r75879 are related. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7228 ___

[issue4750] tarfile keeps excessive dir structure in compressed files

2009-10-28 Thread Tarek Ziadé
Tarek Ziadé ziade.ta...@gmail.com added the comment: Lars, is this still accurate ? -- nosy: +tarek versions: +Python 3.1, Python 3.2 -Python 2.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4750

[issue4750] tarfile keeps excessive dir structure in compressed files

2009-10-28 Thread Tarek Ziadé
Changes by Tarek Ziadé ziade.ta...@gmail.com: -- components: -Distutils ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4750 ___ ___

[issue7228] %lld for PyErr_Format (Modules/_io/bufferedio.c)

2009-10-28 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Thanks for reporting this. Do you know what the right conversion specifier is for print(f)ing something of long long type in MSVC? -- ___ Python tracker rep...@bugs.python.org

[issue7228] %lld for PyErr_Format (Modules/_io/bufferedio.c)

2009-10-28 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: The 'long long' define should have been PY_LONG_LONG. I don't know what the appropriate substitute for %lld is, though. -- ___ Python tracker rep...@bugs.python.org

[issue7228] %lld for PyErr_Format (Modules/_io/bufferedio.c)

2009-10-28 Thread Hirokazu Yamamoto
Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp added the comment: MSVC6 uses __int64 as 64bit integer, and printf uses I64 as its specifier. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7228

[issue7228] %lld for PyErr_Format (Modules/_io/bufferedio.c)

2009-10-28 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: So PY_PRIdOFF should be I64d? Or just I64? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7228 ___

[issue7228] %lld for PyErr_Format (Modules/_io/bufferedio.c)

2009-10-28 Thread Hirokazu Yamamoto
Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp added the comment: Oh, I was late. I agree with msg94605. printf(%I64d\n, 1I64 40); /* 1099511627776 */ So if PyErr_Format (actually, PyString_FromFormatV) will support PY_LONG_LONG, I think we can use same technique as PY_FORMAT_SIZE_T like

[issue7228] %lld for PyErr_Format (Modules/_io/bufferedio.c)

2009-10-28 Thread Hirokazu Yamamoto
Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp added the comment: I was late again...? Hmm, I thought Python tracker told me that somebody else modified this issue. Anyway, printf can use both %I64 and %I64d for signed 64bit integer, but should use %I64u for unsigned 64bit integer AFAIK. But

[issue7228] %lld for PyErr_Format (Modules/_io/bufferedio.c)

2009-10-28 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Thanks. I'm just going to fix Modules/io/_iomodule.h for now. But I agree that it might make sense to have a PY_FORMAT_OFF_T or PY_FORMAT_LONG_LONG in pyport.h, especially if uses of off_t become more widespread in the codebase. I also

[issue7228] %lld for PyErr_Format (Modules/_io/bufferedio.c)

2009-10-28 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Aargh. You're right, of course. PyString_FromFormatV needs to be updated, or avoided in this case. I'll look at this later today. -- assignee: - mark.dickinson ___ Python tracker

[issue7228] %lld for PyErr_Format (Modules/_io/bufferedio.c)

2009-10-28 Thread Hirokazu Yamamoto
Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp added the comment: Sorry for confusion. I shouldn't have said last 3 lines in msg94601. :-( -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7228

[issue7212] Retrieve an arbitrary element from a set without removing it

2009-10-28 Thread Willi Richert
Willi Richert w.rich...@gmx.net added the comment: No particular reason, besides that it is ripped off of pop(). Your solution (omitting register) gives the same performance. Looks cleaner, of course. The patch tries to provide a clean way of for x in some_set: break, as explained above. See

[issue5243] Missing dependency in distutils build

2009-10-28 Thread Patrick Gerken
Patrick Gerken patrick.ger...@computer.org added the comment: Hi Tarek, I think clib stuff is installed in the right python directory and the ext install step then just finds them. To reproduce the issue, run the old easy_install in a virtualenv. easy_install ReportLab It will then fail

[issue7117] Backport py3k float repr to trunk

2009-10-28 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: r75913: Fix _json.c to use PyOS_string_to_double. Change made after consulting with Bob Ippolito. This completes the removal of calls to PyOS_ascii_strtod. -- ___ Python tracker rep...@bugs.python.org

[issue7192] webbrowser.get(firefox) does not work on Mac with installed Firefox

2009-10-28 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- assignee: - ronaldoussoren components: +Macintosh nosy: +ronaldoussoren ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7192 ___

[issue4908] adding a get_metadata in distutils

2009-10-28 Thread Tarek Ziadé
Tarek Ziadé ziade.ta...@gmail.com added the comment: This patch will be applied for the part that makes DistributionMetadata load files. The other part is waiting for PEP 376. -- priority: - normal resolution: - accepted versions: +Python 3.2 -Python 3.1

[issue7194] test_thread is flaky

2009-10-28 Thread Ned Deily
Ned Deily n...@acm.org added the comment: Duplicate of Issue6186? -- nosy: +ned.deily ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7194 ___ ___

[issue6186] test_thread occasionally reports unhandled exceptions on OS X

2009-10-28 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Ned points out that it may be a duplicate of #7194, which has been fixed. Can you test with the current trunk or 2.6 branch? -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org

[issue7224] One obvious way to do interning

2009-10-28 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: A simple way to try and see a difference would be to import lot of modules. By the way, you shouldn't call it _PySet_Add(), it would cause confusion with the existing PySet_Add(). _PySet_Intern() would be fine. -- nosy: +pitrou

[issue7227] Shell Support for installation of Python Packages (.EGG)

2009-10-28 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- assignee: - tarek components: +Distutils -Demos and Tools nosy: +tarek priority: - normal ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7227

[issue7175] unify pydistutils.cfg and distutils.cfg and use .local

2009-10-28 Thread Ned Deily
Ned Deily n...@acm.org added the comment: /etc is definitely not the right place to put files for OS X framework builds; if necessary, an etc directory could be added under the framework version directory as a sibling of bin and lib. It's also very un-OS X like to be putting things into

[issue7229] Manual entry for time.daylight can be misleading

2009-10-28 Thread Tomas Kubes
New submission from Tomas Kubes mr_na...@centrum.cz: Hello, it is not obvious that the time.daylight data item reports nonzero values even when DST is currently not being used (ie. in winter) but the active timezone has DST defined for some other parts of the year. Current manual entry can be

[issue7175] unify pydistutils.cfg and distutils.cfg and use .local

2009-10-28 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: Ned Deily wrote: Ned Deily n...@acm.org added the comment: /etc is definitely not the right place to put files for OS X framework builds; if necessary, an etc directory could be added under the framework version directory as a

[issue7175] unify pydistutils.cfg and distutils.cfg and use .local

2009-10-28 Thread Ned Deily
Ned Deily n...@acm.org added the comment: I don't think there's a misunderstanding. By putting, I meant reading or writing. IMO, /etc is not the place on OS X to be looking for python-related configuration files, certainly not for framework installs. Likewise for ~/.python and ~/.local.

<    1   2   3   >