Re: [Python-Dev] Database import problems

2005-02-01 Thread Guido van Rossum
On Tue, 01 Feb 2005 10:32:43 -0500, Steve Holden [EMAIL PROTECTED] wrote:
 I wonder if there is a developer with MySQL or sqlite and the
 appropriate Python interface module who can help me to understand a
 problem I'm experiencing trying to use PEP 302-style import hooks.
[...]

I sent Steve a private reply pointing out the line
sys.modules['path'] = path in os.py.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Python reference count question

2005-02-01 Thread Aahz
On Tue, Feb 01, 2005, cedric paille wrote:

 Hi all, i'm working on an app that embed python 2.3 with Gnu/Linux,
 and i'd like to have some precisions:

python-dev is for the core developers to discuss bugs and patches.
Please use comp.lang.python for questions about using Python.  Thanks.
-- 
Aahz ([EMAIL PROTECTED])   * http://www.pythoncraft.com/

Given that C++ has pointers and typecasts, it's really hard to have a serious 
conversation about type safety with a C++ programmer and keep a straight face.
It's kind of like having a guy who juggles chainsaws wearing body armor 
arguing with a guy who juggles rubber chickens wearing a T-shirt about who's 
in more danger.  --Roy Smith, c.l.py, 2004.05.23
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] complex I/O problem

2005-02-01 Thread Neal Becker
If I call print on a complex value, I may get this:
'(2+2j)'

But this is not acceptable as input:
complex ('(2+2j)')
Traceback (most recent call last):
  File stdin, line 1, in ?
ValueError: complex() arg is a malformed string

Whatever format is used for output should be accepted as input!

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] complex I/O problem

2005-02-01 Thread A.M. Kuchling
On Tue, Feb 01, 2005 at 11:11:37AM -0500, Neal Becker wrote:
 complex ('(2+2j)')
 Traceback (most recent call last):
   File stdin, line 1, in ?
 ValueError: complex() arg is a malformed string
 
 Whatever format is used for output should be accepted as input!

This isn't true in general; it's not true of strings, for example, nor
of files.  Parsing complex numbers would be pretty complicated,
because it would have to accept '(2+2j)', '2+2j', '3e-6j', and perhaps
even '4j+3'.  It seems easier to just use eval() than to make
complex() implement an entire mini-parser.

--amk
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] complex I/O problem

2005-02-01 Thread Josiah Carlson

A.M. Kuchling [EMAIL PROTECTED] wrote:
 
 On Tue, Feb 01, 2005 at 11:11:37AM -0500, Neal Becker wrote:
  complex ('(2+2j)')
  Traceback (most recent call last):
File stdin, line 1, in ?
  ValueError: complex() arg is a malformed string
  
  Whatever format is used for output should be accepted as input!
 
 This isn't true in general; it's not true of strings, for example, nor
 of files.  Parsing complex numbers would be pretty complicated,
 because it would have to accept '(2+2j)', '2+2j', '3e-6j', and perhaps
 even '4j+3'.  It seems easier to just use eval() than to make
 complex() implement an entire mini-parser.


Which brings up the fact that while some things are able to make the
eval(str(obj)) loop, more are able to make the eval(repr(obj)) loop
(like strings themselves...).

 - Josiah

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: Moving towards Python 3.0 (was Re: [Python-Dev] Speed up functioncalls)

2005-02-01 Thread Fred L. Drake, Jr.
On Monday 31 January 2005 14:08, Glyph Lefkowitz wrote:
  As it stands, this idiom works most of the time, and if an EMFILE errno
  triggered the GC, it would always work.

That might help things on Unix, but I don't think that's meaningful.  Windows 
is much more sensitive to files being closed, and the refcount solution 
supports that more effectively than delayed garbage collection strategies.

With the current approach, you can delete the file right away after releasing 
the last reference to the open file object, even on Windows.  You can't do 
that with delayed GC since Windows will be convinced that the file is still 
open and refuse to let you delete it.  To fix that, you'd have to trigger GC 
from the failed removal operation and try again.

I think we'd find there are a lot more operations that need that support than 
we'd like to think.


  -Fred

-- 
Fred L. Drake, Jr.  fdrake at acm.org

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Is msvcr71.dll re-redistributable?

2005-02-01 Thread Thomas Heller
The 2.4 python.org installer installs msvcr71.dll on the target system.

If someone uses py2exe or a similar tool to create a frozen application,
is he allowed to redistribute this msvcr71.dll to other users together
with his application or not, even if he doesn't own MSVC?

This was asked on the py2exe users list, but I could not answer this
question.  Googling for msvcr71.dll finds some site which offer to
download it, and they pretend that they are not violating any license,
but I wasn't able to find definite words from MS about that.

Thanks,

Thomas

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] python-dev Summary for 2004-12-16 through 2004-12-31 [draft]

2005-02-01 Thread Brett C.
Paul Moore wrote:
On Mon, 31 Jan 2005 14:02:20 -0800, Brett C. [EMAIL PROTECTED] wrote:
2.5 was released just before the time this summary covers so most stuff was on 
bug
fixes discovered after the release.

Give Guido the time machine keys back!
Fine, but I was going to go back in time, win the lottery, and give so much 
money to the PSF that a bunch of people were going to work on Python full-time 
for the rest of their lives.  It's your fault, Paul, that isn't going to happen 
now.  =)

I assume you meant 2.4, or is this a blatant attempt to get back ahead
of schedule with summaries? :-)
=)  No, it's a typo.  Problem of always using and working on 2.5 but having to 
remember when I am dealing with older versions.

Paul.
PS If you look in this month's python-dev archives, you'll see
evidence of /F's last attempt to steal the time machine, with a
message posted from the far future of Feb 23rd, 2005. He clearly
stalled the machine, as he posted from an alternate reality. Let this
be a warning!
Will actually be nice to finally not have to automatically skip the first line 
in the archive page thanks to that funky email.

-Brett
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] mimetypes and _winreg

2005-02-01 Thread Mike Brown
Following up on this 12 Jun 2004 post...

Garth wrote:
 Thomas Heller wrote:
 Mike Brown [EMAIL PROTECTED] writes:
 I thought it would be nice to try to improve the mimetypes module by having 
 it, on Windows, query the Registry to get the mapping of filename 
 extensions 
 to media types, since the mimetypes code currently just blindly checks 
 posix-specific paths for httpd-style mapping files. However, it seems that 
 the 
 way to get mappings from the Windows registry is excessively slow in Python.
 
 I'm told that the reason has to do with the limited subset of APIs that are 
 exposed in the _winreg module. I think it is that EnumKey(key, index) is 
 querying for the entire list of subkeys for the given key every time you 
 call 
 it. Or something. Whatever the situation is, the code I tried below is way 
 slower than I think it ought to be.
 
 Does anyone have any suggestions (besides write it in C)? Could _winreg 
 possibly be improved to provide an iterator or better interface to get the 
 subkeys? (or certain ones? There are a lot of keys under HKEY_CLASSES_ROOT, 
 and I only need the ones that start with a period).
 
 See this post I made some time ago:
 http://mail.python.org/pipermail/python-dev/2004-January/042198.html
 
 Should I file this as a feature request?
 
 If you still think it should be changed in the core, you should work on
 a patch.
 
 I could file a patch if no one else is looking at it. The solution would 
 be to use RegEnumKeyEx and remove RegQueryInfoKey. This loses
 compatability with win16 which I guess is ok.
 
 Garth

I would say it looks like no one else was looking at it, and Garth apparently 
didn't submit a patch. It's beyond my means to come up with a patch myself. 
Would someone be willing to take a look at it?

Sorry, but I really want access to registry subkeys to stop being so dog-slow. 
:)

Thanks for taking a look,

-Mike
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Is msvcr71.dll re-redistributable?

2005-02-01 Thread Vincent Wehren
Thomas Heller wrote:
The 2.4 python.org installer installs msvcr71.dll on the target system.
If someone uses py2exe or a similar tool to create a frozen application,
is he allowed to redistribute this msvcr71.dll to other users together
with his application or not, even if he doesn't own MSVC?

According to the EULA, you may distribute anything listed in redist.txt:
2.2	Redistributable Code-General.   Microsoft grants you a 
nonexclusive, royalty-free right to reproduce and distribute the object 
code form of any portion of the Software listed in REDIST.TXT 
(Redistributable Code).  For general redistribution requirements for 
Redistributable Code, see Section 3.1, below.

So the right to distribute is coupled to the a) the EULA and b) 
redist.txt. (As a side note, the Microsoft Visual C++ Toolkit 2003 for 
example contains NO redistributables per redist.txt).

In the case of not owning a compiler at all, chances seem pretty slim 
you have any rights to distribute anything.

--
Vincent Wehren












This was asked on the py2exe users list, but I could not answer this
question.  Googling for msvcr71.dll finds some site which offer to
download it, and they pretend that they are not violating any license,
but I wasn't able to find definite words from MS about that.
Thanks,
Thomas
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/vwehren%40home.nl
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com