Thursday, March 18, 2010

comp.lang.python - 25 new messages in 14 topics - digest

comp.lang.python
http://groups.google.com/group/comp.lang.python?hl=en

comp.lang.python@googlegroups.com

Today's topics:

* Understanding the CPython dict implementation - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/150fc14dec65224b?hl=en
* import antigravity - 9 messages, 6 authors
http://groups.google.com/group/comp.lang.python/t/131eab9e2bf84b60?hl=en
* C-API PyObject_Call - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/03c70fd75579881f?hl=en
* Recall: How to add a library path to pythonpath ? - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/dbf25f145a255d2a?hl=en
* Win32All On 64-Bit Operating Systems - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/4e93abc9b7b9f307?hl=en
* did anybody play with python and window mobile broadband? - 3 messages, 3
authors
http://groups.google.com/group/comp.lang.python/t/ecc479a70693ae98?hl=en
* ARE YOU ARE FAMILIAR WITH ANY COMPUTER LANGUAGE-GET GOOD LUCK - 1 messages,
1 author
http://groups.google.com/group/comp.lang.python/t/c43c7414b52cdef9?hl=en
* url2lib (windows 7) does not notice when network reconnects (getaddrinfo
problem) - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/871467da5febd8de?hl=en
* Nested Scopes unintended behaviour ? - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/776032d9ce6c8f3c?hl=en
* os.walk restart - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/cb80b10e27af49d4?hl=en
* bug in bdist_wininst cross compile? - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/2c92d3fa7e0f7869?hl=en
* sqlite3, memory db and multithreading - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/fbe9426580697037?hl=en
* Feeding differeent data types to a class instance? - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/99e87afb58f3ef3d?hl=en
* converting a timezone-less datetime to seconds since the epoch - 1 messages,
1 author
http://groups.google.com/group/comp.lang.python/t/5572edb842e5284d?hl=en

==============================================================================
TOPIC: Understanding the CPython dict implementation
http://groups.google.com/group/comp.lang.python/t/150fc14dec65224b?hl=en
==============================================================================

== 1 of 1 ==
Date: Wed, Mar 17 2010 10:52 pm
From: Steven D'Aprano


On Tue, 16 Mar 2010 16:04:22 -0400, Terry Reedy wrote:

> On 3/16/2010 7:46 AM, Steven D'Aprano wrote:
>> On Sun, 14 Mar 2010 19:39:46 -0400, Terry Reedy wrote:
>>
>>> I found this PyCon2010 presentation to be excellent: The Mighty
>>> Dictionary, Branden Craig Rhodes, 30 min.
>
> Sorry,
> http://pycon.blip.tv/file/3332763/
>
> which plays fine in FF3.6 on windows
>
>
>>> http://pycon.blip.tv/file/3264041/
>
> wrong file number
>
>> Unfortunately, that clip seems to be unwatchable, at least for me. It
>> crashed the Netscape plugin in Konqueror, and crashed Firefox.
>
> The flash version does not work for me. This is true of about 1/3 of the
> Pycon 2010 videos that I have tried. The .ogv version of this and all
> others that I have tried (hit Download under Comments) plays fine within
> FF3.6 on my windows xp machine. Perhaps there is a linux-specific bug,
> if that is what you are running under.

Amusingly, the FLV files play perfectly for me under Linux, while the OGV
files don't :)

Thanks for the links, the videos are very interesting.

--
Steven

==============================================================================
TOPIC: import antigravity
http://groups.google.com/group/comp.lang.python/t/131eab9e2bf84b60?hl=en
==============================================================================

== 1 of 9 ==
Date: Thurs, Mar 18 2010 12:49 am
From: Lawrence D'Oliveiro


In message <mailman.820.1268725930.23598.python-list@python.org>, Chris
Rebert wrote:

I see that you published my unobfuscated e-mail address on USENET for all to
see. I obfuscated it for a reason, to keep the spammers away. I'm assuming
this was a momentary lapse of judgement, for which I expect an apology.
Otherwise, it becomes grounds for an abuse complaint to your ISP.


== 2 of 9 ==
Date: Thurs, Mar 18 2010 1:17 am
From: Stefan Behnel


Lawrence D'Oliveiro, 18.03.2010 08:49:
> In message<mailman.820.1268725930.23598.python-list@python.org>, Chris
> Rebert wrote:
>
> I see that you published my unobfuscated e-mail address on USENET for all to
> see. I obfuscated it for a reason, to keep the spammers away. I'm assuming
> this was a momentary lapse of judgement, for which I expect an apology.
> Otherwise, it becomes grounds for an abuse complaint to your ISP.

I hope you just had a bad day. Threatening others for figuring out your
e-mail address is even worse than posting with an illegal e-mail address.

Stefan

== 3 of 9 ==
Date: Thurs, Mar 18 2010 1:53 am
From: "Alf P. Steinbach"


* Lawrence D'Oliveiro:
> In message <mailman.820.1268725930.23598.python-list@python.org>, Chris
> Rebert wrote:
>
> I see that you published my unobfuscated e-mail address on USENET for all to
> see. I obfuscated it for a reason, to keep the spammers away. I'm assuming
> this was a momentary lapse of judgement, for which I expect an apology.
> Otherwise, it becomes grounds for an abuse complaint to your ISP.

Hi.

Chris Rebert didn't reveal anything not already present in the posting he
replied to, and indeed in the posting I'm replying to here.

The headers in the article I'm replying to (yours) look like this:


<headers source="your article">
Path:
feeder.eternal-september.org!eternal-september.org!feeder.erje.net!newsfeed.straub-nv.de!news.linkpendium.com!news.linkpendium.com!newsfeeds.ihug.co.nz!lust.ihug.co.nz!ihug.co.nz!not-for-mail
From: Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand>
Newsgroups: comp.lang.python
Subject: Re: import antigravity
Followup-To: comp.lang.python
Date: Thu, 18 Mar 2010 20:49:55 +1300
Organization: Geek Central
Lines: 7
Message-ID: <hnslv3$jjk$2@lust.ihug.co.nz>
References: <hnnclk$eud$1@lust.ihug.co.nz>
<mailman.820.1268725930.23598.python-list@python.org>
NNTP-Posting-Host: 118-92-14-26.dsl.dyn.ihug.co.nz
Mime-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 7Bit
X-Trace: lust.ihug.co.nz 1268898595 20084 118.92.14.26 (18 Mar 2010 07:49:55 GMT)
X-Complaints-To: abuse@ihug.co.nz
NNTP-Posting-Date: Thu, 18 Mar 2010 07:49:55 +0000 (UTC)
User-Agent: KNode/4.3.4
Xref: eternal-september.org comp.lang.python:51777
</headers>


One must assume that you were not aware that you're posting your mail address in
plaintext in every article?


Cheers & hth.,

- Alf


== 4 of 9 ==
Date: Thurs, Mar 18 2010 2:19 am
From: Stefan Behnel


Alf P. Steinbach, 18.03.2010 09:53:
> <headers source="your article">
> Path:
> feeder.eternal-september.org!eternal-september.org!feeder.erje.net!newsfeed.straub-nv.de!news.linkpendium.com!news.linkpendium.com!newsfeeds.ihug.co.nz!lust.ihug.co.nz!ihug.co.nz!not-for-mail
>
> From: Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand>
> Newsgroups: comp.lang.python
> Subject: Re: import antigravity
> Followup-To: comp.lang.python
> Date: Thu, 18 Mar 2010 20:49:55 +1300
> Organization: Geek Central
> Lines: 7
> Message-ID: <hnslv3$jjk$2@lust.ihug.co.nz>
> References: <hnnclk$eud$1@lust.ihug.co.nz>
> <mailman.820.1268725930.23598.python-list@python.org>
> NNTP-Posting-Host: 118-92-14-26.dsl.dyn.ihug.co.nz
> Mime-Version: 1.0
> Content-Type: text/plain; charset="ISO-8859-1"
> Content-Transfer-Encoding: 7Bit
> X-Trace: lust.ihug.co.nz 1268898595 20084 118.92.14.26 (18 Mar 2010
> 07:49:55 GMT)
> X-Complaints-To: abuse@ihug.co.nz
> NNTP-Posting-Date: Thu, 18 Mar 2010 07:49:55 +0000 (UTC)
> User-Agent: KNode/4.3.4
> Xref: eternal-september.org comp.lang.python:51777
> </headers>
>
>
> One must assume that you were not aware that you're posting your mail
> address in plaintext in every article?

Uhm - where?

Stefan

== 5 of 9 ==
Date: Thurs, Mar 18 2010 2:29 am
From: "Alf P. Steinbach"


* Stefan Behnel:
> Alf P. Steinbach, 18.03.2010 09:53:
>> <headers source="your article">
>> Path:
>> feeder.eternal-september.org!eternal-september.org!feeder.erje.net!newsfeed.straub-nv.de!news.linkpendium.com!news.linkpendium.com!newsfeeds.ihug.co.nz!lust.ihug.co.nz!ihug.co.nz!not-for-mail
>>
>>
>> From: Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand>
>> Newsgroups: comp.lang.python
>> Subject: Re: import antigravity
>> Followup-To: comp.lang.python
>> Date: Thu, 18 Mar 2010 20:49:55 +1300
>> Organization: Geek Central
>> Lines: 7
>> Message-ID: <hnslv3$jjk$2@lust.ihug.co.nz>
>> References: <hnnclk$eud$1@lust.ihug.co.nz>
>> <mailman.820.1268725930.23598.python-list@python.org>
>> NNTP-Posting-Host: 118-92-14-26.dsl.dyn.ihug.co.nz
>> Mime-Version: 1.0
>> Content-Type: text/plain; charset="ISO-8859-1"
>> Content-Transfer-Encoding: 7Bit
>> X-Trace: lust.ihug.co.nz 1268898595 20084 118.92.14.26 (18 Mar 2010
>> 07:49:55 GMT)
>> X-Complaints-To: abuse@ihug.co.nz
>> NNTP-Posting-Date: Thu, 18 Mar 2010 07:49:55 +0000 (UTC)
>> User-Agent: KNode/4.3.4
>> Xref: eternal-september.org comp.lang.python:51777
>> </headers>
>>
>>
>> One must assume that you were not aware that you're posting your mail
>> address in plaintext in every article?
>
> Uhm - where?

Well, at least the one that Chris Rebert quoted,
<mailto:ldo@geek-central.gen.new_zealand> (in the 'From:' header).

The point is, if he's upset about Chris quoting that, then he's probably unaware
that he's posting it in plaintext himself.


Cheers,

- Alf


== 6 of 9 ==
Date: Thurs, Mar 18 2010 2:42 am
From: Jussi Piitulainen


Alf P. Steinbach writes:

> The point is, if he's upset about Chris quoting that, then he's
> probably unaware that he's posting it in plaintext himself.

The complaint was not about quoting but about using in public. Chris
sent his piece to three addresses. From his headers, redacted:

Newsgroups: comp.lang.python
To: "Lawrence D'Oliveiro" <ldo@geek-central.gen.[REDACTED]>
Cc: python-list@python.org

Can we stop importing red herrings now?


== 7 of 9 ==
Date: Thurs, Mar 18 2010 3:04 am
From: "Alf P. Steinbach"


* Jussi Piitulainen:
> Alf P. Steinbach writes:
>
>> The point is, if he's upset about Chris quoting that, then he's
>> probably unaware that he's posting it in plaintext himself.
>
> The complaint was not about quoting but about using in public. Chris
> sent his piece to three addresses. From his headers, redacted:
>
> Newsgroups: comp.lang.python
> To: "Lawrence D'Oliveiro" <ldo@geek-central.gen.[REDACTED]>
> Cc: python-list@python.org
>
> Can we stop importing red herrings now?

Oh, I didn't see that -- it's Bad Practice so I didn't look for it.


Cheers,

- Alf


== 8 of 9 ==
Date: Thurs, Mar 18 2010 4:31 am
From: Steve Holden


Jussi Piitulainen wrote:
> Alf P. Steinbach writes:
>
>> The point is, if he's upset about Chris quoting that, then he's
>> probably unaware that he's posting it in plaintext himself.
>
> The complaint was not about quoting but about using in public. Chris
> sent his piece to three addresses. From his headers, redacted:
>
> Newsgroups: comp.lang.python
> To: "Lawrence D'Oliveiro" <ldo@geek-central.gen.[REDACTED]>
> Cc: python-list@python.org
>
> Can we stop importing red herrings now?

Surely the point of such an obvious obfuscation is that humans can
de-obfuscate is easily. The fact that it was then used in an open
newsgroup communication is just part of the shit that happens every day.

Complaining to Chris's ISP is unlikely to be anything other than a waste
of time. Drawing attention to it the way Lawrence did is much more
likely to draw attention to it that simply gracefully letting it pass.

Lawrence, if you are so worried perhaps you should consider not using
e-mail any more. It's clearly too dangerous to suit you.

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
See PyCon Talks from Atlanta 2010 http://pycon.blip.tv/
Holden Web LLC http://www.holdenweb.com/
UPCOMING EVENTS: http://holdenweb.eventbrite.com/

== 9 of 9 ==
Date: Thurs, Mar 18 2010 4:52 am
From: Steven D'Aprano


On Thu, 18 Mar 2010 09:17:43 +0100, Stefan Behnel wrote:

> Lawrence D'Oliveiro, 18.03.2010 08:49:
>> In message<mailman.820.1268725930.23598.python-list@python.org>, Chris
>> Rebert wrote:
>>
>> I see that you published my unobfuscated e-mail address on USENET for
>> all to see. I obfuscated it for a reason, to keep the spammers away.
>> I'm assuming this was a momentary lapse of judgement, for which I
>> expect an apology. Otherwise, it becomes grounds for an abuse complaint
>> to your ISP.
>
> I hope you just had a bad day. Threatening others for figuring out your
> e-mail address is even worse than posting with an illegal e-mail
> address.

No, this is hardly the first time that Lawrence has made such a
wankerific threat:

http://www.mail-archive.com/python-list%40python.org/msg245012.html


I sympathise, because many years ago I lost an email address, made
unusable by spam, after using it unobfuscated in Usenet. But I think that
the spammers have mostly moved on these days. The pickings are much
richer for hijacking people's address books in Hotmail, Facebook or
Outlook, and the state of the art of anti-spam is better too. So I think
that Lawrence needs to HTFU and stop making empty threats over something
so trivial.


--
Steven

==============================================================================
TOPIC: C-API PyObject_Call
http://groups.google.com/group/comp.lang.python/t/03c70fd75579881f?hl=en
==============================================================================

== 1 of 1 ==
Date: Thurs, Mar 18 2010 1:13 am
From: Stefan Behnel


moerchendiser2k3, 17.03.2010 23:35:
>> 1) put the line number information into the message string when you raise
>> the exception
>
> you mean the line and file information of the C code, right?

Funny that you (being the OP) ask *me* what kind of line information *you*
want.

Stefan


==============================================================================
TOPIC: Recall: How to add a library path to pythonpath ?
http://groups.google.com/group/comp.lang.python/t/dbf25f145a255d2a?hl=en
==============================================================================

== 1 of 2 ==
Date: Tues, Mar 16 2010 4:56 am
From: "Barak, Ron"


Barak, Ron would like to recall the message, "How to add a library path to pythonpath ?".

== 2 of 2 ==
Date: Thurs, Mar 18 2010 1:56 am
From: Chris Rebert


On Tue, Mar 16, 2010 at 4:56 AM, Barak, Ron <Ron.Barak@lsi.com> wrote:
> Barak, Ron would like to recall the message, "How to add a library path to pythonpath ?".

Good luck with that. :)

- Chris

==============================================================================
TOPIC: Win32All On 64-Bit Operating Systems
http://groups.google.com/group/comp.lang.python/t/4e93abc9b7b9f307?hl=en
==============================================================================

== 1 of 1 ==
Date: Thurs, Mar 18 2010 1:54 am
From: Tim Golden


On 17/03/2010 20:43, Tim Daneliuk wrote:
> The intent is just to provide as similar as possible a user experience.
>> From a coding POV, it is surely simpler to just use 'winuser' and 'wingroup',
> but I am sort of philosophically wired to not throw information away if
> it's a available from the OS.

It's hardly worth disputing I suppose, but I would argue that simply
presenting the owner & group of a file in Windows is actually doing
a disservice to the user of the app. It's cluttering up the display
with information which is essentially useless. Pretty much the only
time I ever look at a file owner is when I have some knotty security
issue and I need to assess who might have WRITE_DAC permission. The
group - never; it really is a relic.

The file owner & group simply don't play the same role in Windows
security that they do in *nix. The trouble is that there isn't a
simple alternative: most files, even with default security, will
have two or three groups involved in their security at different
levels.

> BTW, wanna beta test a really cool CLI mass file renaming tool????? ;)

Sure -- I'll have a look. But I can't promise any great amount of
time at present :)

TJG


==============================================================================
TOPIC: did anybody play with python and window mobile broadband?
http://groups.google.com/group/comp.lang.python/t/ecc479a70693ae98?hl=en
==============================================================================

== 1 of 3 ==
Date: Thurs, Mar 18 2010 2:20 am
From: News123


Hi,


I'd like to use a mobile broadband device with a windows python app.
Did anybody play already with python and the window mobile broadband
interface?

I'm looking for examples:
- how to connect/disconnect a mobile broadband device (currently I use
rasdial. not sure it's the best solution)
- to obtain the device's current mode (GPRS / EDGE / . . . )
- to obtain the current signal level

Thanks a lot for any pointers

N

== 2 of 3 ==
Date: Thurs, Mar 18 2010 2:26 am
From: "Sanjiva P."


On 03/18/2010 10:20 AM, News123 wrote:
> I'm looking for examples:
> - how to connect/disconnect a mobile broadband device (currently I use
> rasdial. not sure it's the best solution)
> - to obtain the device's current mode (GPRS / EDGE / . . . )
> - to obtain the current signal level
>
> Thanks a lot for any pointers

Well no examples,but most or all of it should work through AT commands.

Did you try plugging the mobile broadband interface in?


== 3 of 3 ==
Date: Thurs, Mar 18 2010 3:07 am
From: "eglyph@gmail.com"


On 18 ÜÐà, 11:20, News123 <news1...@free.fr> wrote:
> I'd like to use a mobile broadband device with a windows python app.
> Did anybody play already with python and the window mobile broadband
> interface?
>

There was a discussion on this subject in some local forum recently. I
assume you're using PythonCE, right?

The best solution proposed there was to use ctypes and WinAPI. You can
find a relatively high level APIs to set up a connection (without need
to go too low level with AT commands) and make your own wrapper.

A good starting point can be found here: http://msdn.microsoft.com/en-us/library/bb416346.aspx
(it's not the only way to to things, btw).

--
regards,
eGlyph

==============================================================================
TOPIC: ARE YOU ARE FAMILIAR WITH ANY COMPUTER LANGUAGE-GET GOOD LUCK
http://groups.google.com/group/comp.lang.python/t/c43c7414b52cdef9?hl=en
==============================================================================

== 1 of 1 ==
Date: Thurs, Mar 18 2010 2:54 am
From: LALITHA N <2ennel.0569@gmail.com>


http://123maza.com/75/expressions

==============================================================================
TOPIC: url2lib (windows 7) does not notice when network reconnects (
getaddrinfo problem)
http://groups.google.com/group/comp.lang.python/t/871467da5febd8de?hl=en
==============================================================================

== 1 of 1 ==
Date: Thurs, Mar 18 2010 3:19 am
From: "eglyph@gmail.com"


On 18 мар, 00:47, News123 <news1...@free.fr> wrote:
> Hi,
>
> I'd like to write a function, that knows when the 'internet' is reachable.
>
> My setup is a windows7 host with a wireless USB modem. The modem might
> connect / disconnect any time.
>
> I thought I write a small function just checking whether I can fetch a url.
> ######### script starts
> import time,urllib2
>
> myurl = "http://www.mysite.com" # or "www.google.com" or whatever you like
>
> while True:
>     connected = False
>     try:
>         urllib2.urlopen(myurl)
>         connected = True
>     except urllib2.URLError as e:
>         print "urlerr %s" % e
>     print "connected",connected
>     time.sleep(1)
> ########## end of script
>
> if the network is connected when I start the script the first time after
> reboot, then  I receive> connected True
>
> As expected
>
> If the network is disconnected when I start the script the first time
> after reboot, then  I receive> urlerr <urlopen error [Errno 11004] getaddrinfo failed>
> > connected False
>
> as expected
>
> Things are getting weired, when my USB wireless modem connects after
> I started my script:
>
> It happens, that I just continue to receive:
>
> > urlerr <urlopen error [Errno 11004] getaddrinfo failed>
> > connected False
>
> however when I use a windows cmd window and I start
> "pingwww.mysite.com", then my python script recovers and reports
>
> > connected True
>
> My perhaps false conclusion is, that getaddrinfo() is not retrying to
> resolve an IP address, when it failed once.
>
> Is this behaviour known? Can this really be possible?
> I can reproduce this issue. not every time, but rather often.
>
> If yes, is there any way to force a new host name lookup under windows?
>
> What else could I be doing wrong?
>
> Thanks a lot in advance for any ideas
>
> N

Actually this should be expected behavior. Windows establishes
connection automatically when you start pinging something, your script
doesn't. Just check the connection state with winapi (ctypes?
pywin32?) and establish it if it isn't already.

--
regards, eGlyph

==============================================================================
TOPIC: Nested Scopes unintended behaviour ?
http://groups.google.com/group/comp.lang.python/t/776032d9ce6c8f3c?hl=en
==============================================================================

== 1 of 1 ==
Date: Thurs, Mar 18 2010 3:21 am
From: Michael Sparks


On Mar 17, 8:29 pm, Terry Reedy <tjre...@udel.edu> wrote:
> On 3/17/2010 11:44 AM, Emile van Sebille wrote:
>
> > On 3/17/2010 8:16 AM Michael Sparks said...
> >> Hi,
>
> >> Is the following behaviour expected ?
>
> > In short, yes. Assignment within a function forces the variable to
> > locals.
>
> In 3.x, one can declare names to be nonlocal (ie, local to some outer
> function, as opposed to local to the current function or module global).
> In your case,
>    nonlocal on
> in your inner swtchfun function would give the behavior you wanted.

Ah, excellent. That makes python closures work more like I'd expect
them to. (A colleague had written the swtchfun I posted, whereas the
generator form was the version I wrote, and he was puzzled as to why
it didn't work as he expected. When I saw it I also couldn't see why.

After hearing it's expected behaviour in 2.6 it's clear that assigning
a name to a value declares the variable to be local, and that unlike
much of python (but like yield) this appears based on static analysis
of the function declaration, rather than dynamic. This does also make
sense since it prevents a name "switching scope" in a function, and a
"nonlocal" keyword also makes sense as a result.

Thanks to Emile for pointing out you can also do this in 2.6:
def Toggler(F, B):
print F("Hello")
print F("Hello")
print F("Hello")
print F("Hello")
print F("Hello")

def Switcher(A,B):
enclose={"on" : True}
def swtchfun(msg, enclose=enclose):
if enclose["on"]:
enclose["on"] = False
print "Switched to A"
return A
else:
enclose["on"] = True
print "Switched to B"
return B
#
return Toggler(swtchfun,True)

Switcher(1,2)


I think personally I'd use the generator form myself, since I think
it's clearer (more clearly loops between the two), but this may be a
useful thing to know occasionally.

Cheers :-)


Michael.

==============================================================================
TOPIC: os.walk restart
http://groups.google.com/group/comp.lang.python/t/cb80b10e27af49d4?hl=en
==============================================================================

== 1 of 1 ==
Date: Thurs, Mar 18 2010 3:25 am
From: Tim Chase


Steve Howell wrote:
> If that's the case, then you might be able to get away with just
> leaving some kind of breadcrumbs whenever you've successfully
> processed a directory or a file,

Unless you're indexing a read-only device (whether hardware
read-only like a CD, or permission-wise read-only like a network
share or a non-priv user walking system directories)...

> Also, I can understand why the operations on the files themselves
> might crash, but can't you catch an exception and keep on chugging?

I also wondered this one, perhaps logging the directory in which
the exception happened to later revisit. :)

-tkc

==============================================================================
TOPIC: bug in bdist_wininst cross compile?
http://groups.google.com/group/comp.lang.python/t/2c92d3fa7e0f7869?hl=en
==============================================================================

== 1 of 1 ==
Date: Thurs, Mar 18 2010 5:06 am
From: Robin Becker


On 17/03/2010 21:37, Gabriel Genellina wrote:
> En Wed, 17 Mar 2010 11:38:16 -0300, Robin Becker <robin@reportlab.com>
> escribió:
>
>> has anyone had any success with cross compilation and bdist_wininst; I
>> have modified build_ext very slightly to fix a small bug in cross
>> compilation related to library order.
>
> Please post your bug report + patch at http://bugs.python.org or it will
> be lost.
>

OK done
--
Robin Becker


==============================================================================
TOPIC: sqlite3, memory db and multithreading
http://groups.google.com/group/comp.lang.python/t/fbe9426580697037?hl=en
==============================================================================

== 1 of 1 ==
Date: Thurs, Mar 18 2010 5:58 am
From: królewna


The problem is simple: I have multiple threads within one program. At
least 2 threads have to have access to in-memory sqlite database. It is
not possible to pass sqlite objects to those threads because an
exception is rised:

ProgrammingError: SQLite objects created in a thread can only be used in
that same thread.The object was created in thread id -1219066176 and
this is thread id -1224475792

Is there any EASY way to use this in-memory db in many threads? Creating
another connection is not a solution as it creates completely new db
instead of connecting to the existing one.

--
Best regards
princess

==============================================================================
TOPIC: Feeding differeent data types to a class instance?
http://groups.google.com/group/comp.lang.python/t/99e87afb58f3ef3d?hl=en
==============================================================================

== 1 of 1 ==
Date: Thurs, Mar 18 2010 6:40 am
From: Christian


On Mar 14, 2:16 pm, kuru <maymunbe...@gmail.com> wrote:
> Hi
>
> Thank you so much for all these great suggestions. I will have time
> today to try all these and see which one works best for me

Answers to your question have spread onto the Python blogosphere as
well.

http://pythonconquerstheuniverse.wordpress.com/2010/03/17/multiple-constructors-in-a-python-class/

http://blog.dowski.com/2010/03/17/my-take-on-multiple-constructors/

That second one is my response.

Christian

==============================================================================
TOPIC: converting a timezone-less datetime to seconds since the epoch
http://groups.google.com/group/comp.lang.python/t/5572edb842e5284d?hl=en
==============================================================================

== 1 of 1 ==
Date: Thurs, Mar 18 2010 6:44 am
From: Chris Withers


Hey Chris,

Chris Rebert wrote:
>> def timestamp(dttm):
>> return time.mktime(dttm.timetuple())
>
> from calendar import timegm
>
> def timestamp(dttm):
> return timegm(dttm.utctimetuple())
> #the *utc*timetuple change is just for extra consistency
> #it shouldn't actually make a difference here

Ah, right. What on earth is timegm doing in calendar?
No way I ever would have thought to look there...

I wonder what the best way to get this stuff documented in the datetime
modules docs is?

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk


==============================================================================

You received this message because you are subscribed to the Google Groups "comp.lang.python"
group.

To post to this group, visit http://groups.google.com/group/comp.lang.python?hl=en

To unsubscribe from this group, send email to comp.lang.python+unsubscribe@googlegroups.com

To change the way you get mail from this group, visit:
http://groups.google.com/group/comp.lang.python/subscribe?hl=en

To report abuse, send email explaining the problem to abuse@googlegroups.com

==============================================================================
Google Groups: http://groups.google.com/?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate