encoding in lxml

2008-11-03 Thread jasiu85
Hey, I have a problem with character encoding in LXML. Here's how it goes: I read an HTML document from a third-party site. It is supposed to be in UTF-8, but unfortunately from time to time it's not. I parse the document like this: html_doc = HTML(string_with_document) Then I retrieve some inf

Re: Do I need a lock here?

2008-10-28 Thread jasiu85
On Oct 27, 10:12 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > jasiu85 schrieb: > > > > > Hey, > > > Please take a look at the code of the two threads below: > > > COMMON_DICT = {} > > > def thread_1(): > >     global

Do I need a lock here?

2008-10-27 Thread jasiu85
Hey, Please take a look at the code of the two threads below: COMMON_DICT = {} def thread_1(): global COMMON_DICT local_dict = prepare_dict() COMMON_DICT = local_dict def thread_2(): global COMMON_DICT local_dict = COMMON_DICT use_dict(local_dict) Do I need a lock to pr