Python/MySQL problem on Windows

2006-09-20 Thread Eric Smith
I'm trying to use Python 2.4.3 and pywin32-209 to access a MySQL
database on Windows Server 2003 Standard Edition, and not having much
luck. It seems like parts of the MySQLdb module are not getting loaded
correctly, but no error message is given during the import, even if I
give a "-vv" on the command line.

I'm trying to do:

import MySQLdb
db = MySQLdb.connection (db="database", user="user", passwd="password")
cursor = db.cursor ()

It won't give me a cursor object, instead claiming "AttributeError: cursor".
Sure enough, if I do a

dir (db)

I get:

['affected_rows', 'autocommit', 'change_user', 'character_set_name',
 'close', 'commit', 'dump_debug_info', 'errno', 'error', 'escape',
 'escape_string', 'field_count', 'get_host_info', 'get_proto_info',
 'get_server_info', 'info', 'insert_id', 'kill', 'next_result', 'ping',
 'query', 'rollback', 'select_db', 'set_server_option', 'shutdown',
 'sqlstate', 'stat', 'store_result', 'string_literal', 'thread_id',
 'use_result', 'warning_count']

There seem to be a lot of attributes missing, not just cursor.

But the database connection is live and works, as I can use the
undocumented db.query() function to do an insert into the database,
and that works fine.

I can run my same Python script on Fedora Core 5 and it works fine.

I'm at wit's end; can anyone suggest what might be wrong, or how to
debug it?  (Unfortunately replacing Windows with Linux on the server
machine is not currently a viable option.)

I can provide the "-vv" output if that's useful, but there didn't
appear to be anything unusual in it.

Thanks!
Eric Smith

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


Re: Python/MySQL problem on Windows

2006-09-20 Thread Eric Smith
Carsten Haese <[EMAIL PROTECTED]> writes:
> What happens if you use connect(...) instead of connection(...)?

Then it works!  :-)

I could have sworn that I got the use of connection() from published
sample code, but I must be mistaken.

Thanks!
Eric
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: [Python-Dev] PEP 382: Namespace Packages

2009-04-06 Thread Eric Smith
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> On Apr 6, 2009, at 9:21 AM, Jesse Noller wrote:
>
>> On Thu, Apr 2, 2009 at 4:33 PM, M.-A. Lemburg  wrote:
>>> On 2009-04-02 17:32, Martin v. Löwis wrote:
 I propose the following PEP for inclusion to Python 3.1.
>>>
>>> Thanks for picking this up.
>>>
>>> I'd like to extend the proposal to Python 2.7 and later.
>>>
>>
>> -1 to adding it to the 2.x series. There was much discussion around
>> adding features to 2.x *and* 3.0, and the consensus seemed to *not*
>> add new features to 2.x and use those new features as carrots to help
>> lead people into 3.0.
>
> Actually, isn't the policy just that nothing can go into 2.7 that
> isn't backported from 3.1?  Whether the actual backport happens or not
> is up to the developer though.  OTOH, we talked about a lot of things
> and my recollection is probably fuzzy.

I believe Barry is correct. The official policy is "no features in 2.7
that aren't also in 3.1". I personally think I'm not going to put anything
else in 2.7, specifically the ',' formatter stuff from PEP 378. 3.1 has
diverged too far from 2.7 in this regard to make the backport easy to do.
But this decision is left up to the individual committer.

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


Re: [python-committers] [RELEASED] Python 3.2 beta 2

2010-12-22 Thread Eric Smith

On 12/22/2010 8:46 AM, Georg Brandl wrote:

Am 22.12.2010 02:15, schrieb Nick Coghlan:

On Wed, Dec 22, 2010 at 6:18 AM, Georg Brandl  wrote:

Since PEP 3003, the Moratorium on Language Changes, is in effect, there
are no changes in Python's syntax and built-in types in Python 3.2.


Minor nit - we actually did tweak a few of the builtin types a bit
(mostly the stuff to improve Sequence ABC conformance and to make
range objects more list-like)


Indeed, I'll fix this wording for the next announcement.  (And I will
mention SSL, sorry Antoine).


If you're only going to mention some vague "some builtins had minor 
changes", then I'm fine with that. If you're going to enumerate all such 
changes, that will be a bigger job. There were 2 such changes I'm aware 
of: str.format_map (#6081) and the addition of alternate ("#") 
formatting to float, complex and decimal (#7094) __format__ methods.


For this announcement I don't think it's necessary to list them all.

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