Re: What's the best way to write this regular expression?

2012-03-07 Thread John Salerno
On Mar 7, 4:02 pm, Evan Driscoll wrote: > On 01/-10/-28163 01:59 PM, Prasad, Ramit wrote: > > > gz stands for gzip and is a form of compression (like rar/zip ). > > tar stands for a tape archive. It is basically a box that holds the > > files. So you need to "unzip" and then "open the box". > > >

Re: What's the best way to write this regular expression?

2012-03-07 Thread John Salerno
On Mar 7, 11:03 pm, Chris Angelico wrote: > On Thu, Mar 8, 2012 at 7:39 AM, John Salerno wrote: > > it only > > seemed to support Python 2.7. I'm using 3.2. Is 2.7 just the minimum > > version it requires? It didn't say something like "2.7+", so I wasn't > > sure, and I don't want to start instal

Re: what is best method to set sys.stdout to utf-8?

2012-03-07 Thread Laurent Claessens
I would. The io module is more recent an partly replaces codecs. The latter remains for back compatibility and whatever it can do that io cannot. I've a naive question : what is wrong with the following system ? class MyStdOut(object): def __init__(self): self.old_stdout=sys.std

Re: Biologist new to cgi in python

2012-03-07 Thread Tim Roberts
Shane Neeley wrote: > >Here is the function I am using to insert the variable file text inside the >url. Is it even possible to include the upload command in the url? No. You are trying to simulate a "GET" request, but files can only be uploaded via a "POST" request of type multiport/form-data.

Help with MultipartPostHandler

2012-03-07 Thread Shane Neeley
Hi Python Google Group! I hope someone could help me and then one day when I am good I can contribute to the forum as well. Does anyone know what is wrong with my syntax here as I am trying to submit this form using MultipartPostHandler that I installed? import MultipartPostHandler, urllib2 p

Re: Python site-packages permission denied?

2012-03-07 Thread Ned Deily
In article , Chris Rebert wrote: > You generally shouldn't mess with Mac OS X's system copies of Python. > Typically, one installs a separate copy using MacPorts, Fink, or > whatever, and uses that instead. I don't understand what you mean by "mess with". Certainly one should not attempt alte

Re: What's the best way to write this regular expression?

2012-03-07 Thread Chris Angelico
On Thu, Mar 8, 2012 at 7:39 AM, John Salerno wrote: > it only > seemed to support Python 2.7. I'm using 3.2. Is 2.7 just the minimum > version it requires? It didn't say something like "2.7+", so I wasn't > sure, and I don't want to start installing a bunch of stuff that will > clog up my director

python-list@python.org

2012-03-07 Thread rusi
On Mar 8, 3:02 am, Christian wrote: > I play around with redis. Isn't it  possible to handle BitSet with > Python "as" in Java? > > BitSet users = BitSet.valueOf(redis.get(key.getBytes())); > all.or(users); > System.out.println(all.cardinality()) > > I try something with the struct and bitstring l

Re: sys.stdout.detach() results in ValueError

2012-03-07 Thread Benjamin Peterson
Peter Kleiweg xs4all.nl> writes: > Not yet using fp in any way, this script gives the following error: > > Exception ValueError: 'underlying buffer has been detached' in You're probably using print() or some such which tries to write to sys.stdout. It's safest to just write to sys.stdout.buf

PPC Form Filling Jobs

2012-03-07 Thread reena k
http://internetjobs4u.weebly.com -- http://mail.python.org/mailman/listinfo/python-list

Re: "Decoding unicode is not supported" in unusual situation

2012-03-07 Thread Ben Finney
Steven D'Aprano writes: > On Thu, 08 Mar 2012 08:48:58 +1100, Ben Finney wrote: > > I think that's a Python bug. If the latter succeeds as a no-op, the > > former should also succeed as a no-op. Neither should ever get any > > errors when ‘s’ is a ‘unicode’ object already. > > No. The semantics o

Re: Python 3.2 and MS Outlook

2012-03-07 Thread Mark Hammond
On Thursday, 8 March 2012 1:52:48 AM, Greg Lindstrom wrote: Is there documentation showing how to read from a Microsoft Outlook server using Python 3.2. I've done it with 2.x, but can't find anything to help me with 3.2. What problems are you having in 3.2? It should be exactly the same - e

Re: sys.stdout.detach() results in ValueError

2012-03-07 Thread Mark Tolonen
On Mar 7, 4:10 pm, Terry Reedy wrote: > On 3/7/2012 5:35 PM, Peter Kleiweg wrote: > > > > > > > > > > > Dave Angel schreef op de 7e dag van de lentemaand van het jaar 2012: > > >> On 03/07/2012 02:41 PM, Peter Kleiweg wrote: > >>> I want to write out some binary data to stdout in Python3. I > >>>

Re: pickle/unpickle class which has changed

2012-03-07 Thread Gelonida N
On 03/07/2012 09:04 AM, Peter Otten wrote: > Gelonida N wrote: > If you know in advance that your class will undergo significant changes you > may also consider storing more stable data in a file format that can easily > be modified, e. g. json. > Good point, that's what I'm partially doing. I

Re: what is best method to set sys.stdout to utf-8?

2012-03-07 Thread Terry Reedy
On 3/7/2012 3:57 PM, Peter Kleiweg wrote: In Python 3, there seem to be two ways to set sys.stdout to utf-8 after the script has started: sys.stdout = codecs.getwriter('utf-8')(sys.stdout.detach()) sys.stdout = io.TextIOWrapper(sys.stdout.detach(), encoding='utf-8') I guess the seco

Re: sys.stdout.detach() results in ValueError

2012-03-07 Thread Terry Reedy
On 3/7/2012 5:35 PM, Peter Kleiweg wrote: Dave Angel schreef op de 7e dag van de lentemaand van het jaar 2012: On 03/07/2012 02:41 PM, Peter Kleiweg wrote: I want to write out some binary data to stdout in Python3. I thought the way to do this was to call detach on sys.stdout. But apparently,

Re: "Decoding unicode is not supported" in unusual situation

2012-03-07 Thread Terry Reedy
On 3/7/2012 6:26 PM, Steven D'Aprano wrote: On Thu, 08 Mar 2012 08:48:58 +1100, Ben Finney wrote: John Nagle writes: The library bug, if any, is that you can't apply unicode(s, errors='replace') to a Unicode string. TypeError("Decoding unicode is not supported") is raised. How

Re: "Decoding unicode is not supported" in unusual situation

2012-03-07 Thread Steven D'Aprano
On Thu, 08 Mar 2012 08:48:58 +1100, Ben Finney wrote: > John Nagle writes: > >>The library bug, if any, is that you can't apply >> >> unicode(s, errors='replace') >> >> to a Unicode string. TypeError("Decoding unicode is not supported") is >> raised. However >> >> unicode(s) >> >>

Re: sys.stdout.detach() results in ValueError

2012-03-07 Thread Peter Kleiweg
Dave Angel schreef op de 7e dag van de lentemaand van het jaar 2012: > On 03/07/2012 02:41 PM, Peter Kleiweg wrote: > > I want to write out some binary data to stdout in Python3. I > > thought the way to do this was to call detach on sys.stdout. But > > apparently, you can't. Here is a minimal scr

Re: sys.stdout.detach() results in ValueError

2012-03-07 Thread Dave Angel
On 03/07/2012 02:41 PM, Peter Kleiweg wrote: I want to write out some binary data to stdout in Python3. I thought the way to do this was to call detach on sys.stdout. But apparently, you can't. Here is a minimal script: #!/usr/bin/env python3.1 import sys fp = sys.stdout.detach()

Re: are int, float, long, double, side-effects of computer engineering?

2012-03-07 Thread Russ P.
On Mar 6, 7:25 pm, rusi wrote: > On Mar 6, 6:11 am, Xah Lee wrote: > > > some additional info i thought is relevant. > > > are int, float, long, double, side-effects of computer engineering? > > It is a bit naive for computer scientists to club integers and reals > as mathematicians do given that

python-list@python.org

2012-03-07 Thread Christian
I play around with redis. Isn't it possible to handle BitSet with Python "as" in Java? BitSet users = BitSet.valueOf(redis.get(key.getBytes())); all.or(users); System.out.println(all.cardinality()) I try something with the struct and bitstring libs , but haven't any success. Even the follow snip

Re: RE: What's the best way to write this regular expression?

2012-03-07 Thread Evan Driscoll
On 01/-10/-28163 01:59 PM, Prasad, Ramit wrote: gz stands for gzip and is a form of compression (like rar/zip ). tar stands for a tape archive. It is basically a box that holds the files. So you need to "unzip" and then "open the box". Normally programs like WinZip / WinRar / 7-zip will do both

Re: Project

2012-03-07 Thread Ben Finney
Dev Dixit writes: > Please, tell me how to develop project on "how people intract with > social networing sites". Step one: collect data. Step two: ??? Step three: project! -- \ “Try to become not a man of success, but try rather to become a | `\ man of

Re: "Decoding unicode is not supported" in unusual situation

2012-03-07 Thread Ben Finney
John Nagle writes: >The library bug, if any, is that you can't apply > > unicode(s, errors='replace') > > to a Unicode string. TypeError("Decoding unicode is not supported") is > raised. However > > unicode(s) > > will accept Unicode input. I think that's a Python bug. If the la

Re: What's the best way to write this regular expression?

2012-03-07 Thread John Salerno
On Wed, Mar 7, 2012 at 3:34 PM, Ian Kelly wrote: > The setup.py file (as well as the other files) would be inside the > .tar file.  Unlike a Windows zip file, which does both archival and > compression, Unix files are typically archived and compressed in two > separate steps: "tar" denotes the ar

Re: What's the best way to write this regular expression?

2012-03-07 Thread Ian Kelly
On Wed, Mar 7, 2012 at 2:11 PM, John Salerno wrote: > The only files included in the .tar.gz file is a .tar file of the same > name. So I guess the setup option doesn't exist for these particular > packages. The setup.py file (as well as the other files) would be inside the .tar file. Unlike a W

RE: Project

2012-03-07 Thread Prasad, Ramit
> > Pay a smart developer! > > What? For homework? Sure why not? Smart developers could use extra money ;) Ramit Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology 712 Main Street | Houston, TX 77002 work phone: 713 - 216 - 5423 -- This email is confidential and subject to

RE: What's the best way to write this regular expression?

2012-03-07 Thread Prasad, Ramit
> The only files included in the .tar.gz file is a .tar file of the same > name. gz stands for gzip and is a form of compression (like rar/zip ). tar stands for a tape archive. It is basically a box that holds the files. So you need to "unzip" and then "open the box". Normally programs like WinZ

Re: Python site-packages permission denied?

2012-03-07 Thread Chris Rebert
On Wed, Mar 7, 2012 at 1:02 PM, Shane Neeley wrote: > What do I need to do to successfully install a package onto python so that I > can use it as a module? > > I have tried in terminal in the correct directory "python2.7 ./setup.py > install" but it says permission denied. > > Shanes-MacBook-Pr

Re: What's the best way to write this regular expression?

2012-03-07 Thread Benjamin Kaplan
On Wed, Mar 7, 2012 at 4:11 PM, John Salerno wrote: > > On Wed, Mar 7, 2012 at 3:01 PM, Ian Kelly wrote: > > > There is a fork of setuptools called "distribute" that supports Python > > 3. > > Thanks, I guess I'll give this a try tonight! > > > setup.py is a file that should be included at the to

Re: Project

2012-03-07 Thread HoneyMonster
On Wed, 07 Mar 2012 13:06:38 -0500, Rodrick Brown wrote: > Pay a smart developer! What? For homework? -- http://mail.python.org/mailman/listinfo/python-list

Re: What's the best way to write this regular expression?

2012-03-07 Thread John Salerno
On Wed, Mar 7, 2012 at 3:01 PM, Ian Kelly wrote: > There is a fork of setuptools called "distribute" that supports Python 3. Thanks, I guess I'll give this a try tonight! > setup.py is a file that should be included at the top-level of the > .tar files you downloaded.  Generally, to install som

Python site-packages permission denied?

2012-03-07 Thread Shane Neeley
What do I need to do to successfully install a package onto python so that I can use it as a module? I have tried in terminal in the correct directory "python2.7 ./setup.py install" but it says permission denied. Shanes-MacBook-Pro:seisen-urllib2_file-cf4c4c8 chimpsarehungry$ python2.7.1 ./se

Re: What's the best way to write this regular expression?

2012-03-07 Thread Ian Kelly
On Wed, Mar 7, 2012 at 1:39 PM, John Salerno wrote: > Ok, first major roadblock. I have no idea how to install Beautiful > Soup or lxml on Windows! All I can find are .tar files. Based on what > I've read, I can use the easy_setup module to install these types of > files, but when I went to downlo

what is best method to set sys.stdout to utf-8?

2012-03-07 Thread Peter Kleiweg
In Python 3, there seem to be two ways to set sys.stdout to utf-8 after the script has started: sys.stdout = codecs.getwriter('utf-8')(sys.stdout.detach()) sys.stdout = io.TextIOWrapper(sys.stdout.detach(), encoding='utf-8') I guess the second is better. At start-up, type(sys.stdout) i

Re: What's the best way to write this regular expression?

2012-03-07 Thread John Salerno
Ok, first major roadblock. I have no idea how to install Beautiful Soup or lxml on Windows! All I can find are .tar files. Based on what I've read, I can use the easy_setup module to install these types of files, but when I went to download the setuptools package, it only seemed to support Python 2

Re: Python recursive tree, linked list thingy

2012-03-07 Thread Ian Kelly
On Wed, Mar 7, 2012 at 1:03 PM, Ian Kelly wrote: > A set of defective pixels would be the probable choice, since it > offers efficient membership testing. Some actual code, using a recursive generator: def get_cluster(defective, pixel): yield pixel (row, column) = pixel for adjacent

Re: Python recursive tree, linked list thingy

2012-03-07 Thread Alexander Blinne
Am 07.03.2012 20:49, schrieb Wanderer: I have a list of defective CCD pixels and I need to find clusters where a cluster is a group of adjacent defective pixels. This seems to me to be a classic linked list tree search.I take a pixel from the defective list and check if an adjacent pixel is in th

Re: Python recursive tree, linked list thingy

2012-03-07 Thread MRAB
On 07/03/2012 19:49, Wanderer wrote: I have a list of defective CCD pixels and I need to find clusters where a cluster is a group of adjacent defective pixels. This seems to me to be a classic linked list tree search.I take a pixel from the defective list and check if an adjacent pixel is in the

Re: Python recursive tree, linked list thingy

2012-03-07 Thread Ian Kelly
On Wed, Mar 7, 2012 at 12:49 PM, Wanderer wrote: > I have a list of defective CCD pixels and I need to find clusters > where a cluster is a group of adjacent defective pixels. This seems to > me to be a classic linked list tree search.I take a pixel from the > defective list and check if an adjace

RE: Project

2012-03-07 Thread Prasad, Ramit
> > Please, tell me how to develop project on "how people intract with > > social networing sites". > > This sounds more like a social sciences study than anything > programming related... > > And since I don't do such sites, it may be intractable... Or he could be wanting to know ho

Python recursive tree, linked list thingy

2012-03-07 Thread Wanderer
I have a list of defective CCD pixels and I need to find clusters where a cluster is a group of adjacent defective pixels. This seems to me to be a classic linked list tree search.I take a pixel from the defective list and check if an adjacent pixel is in the list. If it is I add the pixel to the c

sys.stdout.detach() results in ValueError

2012-03-07 Thread Peter Kleiweg
I want to write out some binary data to stdout in Python3. I thought the way to do this was to call detach on sys.stdout. But apparently, you can't. Here is a minimal script: #!/usr/bin/env python3.1 import sys fp = sys.stdout.detach() Not yet using fp in any way, this script gives

Re: "Decoding unicode is not supported" in unusual situation

2012-03-07 Thread John Nagle
On 3/7/2012 3:42 AM, Steven D'Aprano wrote: I *think* he is complaining that some other library -- suds? -- has a broken test for Unicode, by using: if type(s) is unicode: ... instead of if isinstance(s, unicode): ... Consequently, when the library passes a unicode *subclass* to the tounicod

Re: Python-2.6.1 ctypes test cases failing

2012-03-07 Thread Terry Reedy
On 3/7/2012 12:43 PM, Naresh Bhat wrote: Hi All, I have the following setup Kernel version: linux-2.6.32.41 Python Version: Python-2.6.1 Hardware target: MIPS 64bit I am just trying to run python test cases, Observed that on my MIPS 64bit system only _ctypes related test cases are failing. I

RE: are int, float, long, double, side-effects of computer engineering?

2012-03-07 Thread Prasad, Ramit
Dennis Lee Bieber wrote: > It wouldn't surprise me to find out that modern CompSci degrees > don't even discuss machine representation of numbers. As a fairly recent graduate, I can assure you that they still do. Well, I should say at least my school did since I cannot speak for every othe

Re: Project

2012-03-07 Thread Rodrick Brown
Pay a smart developer! Sent from my iPhone On Mar 7, 2012, at 4:46 AM, Dev Dixit wrote: > Please, tell me how to develop project on "how people intract with > social networing sites". > -- > http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-

Python-2.6.1 ctypes test cases failing

2012-03-07 Thread Naresh Bhat
Hi All, I have the following setup Kernel version: linux-2.6.32.41 Python Version: Python-2.6.1 Hardware target: MIPS 64bit I am just trying to run python test cases, Observed that on my MIPS 64bit system only _ctypes related test cases are failing. Is there any available patch for this issue

Re: Project

2012-03-07 Thread John Gordon
In Dev Dixit writes: > Please, tell me how to develop project on "how people intract with > social networing sites". First you need a more detailed description of exactly what you want. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is

Re: help: confused about python flavors....

2012-03-07 Thread amar Singh
On Mar 7, 9:41 am, Dennis Lee Bieber wrote: > On Tue, 6 Mar 2012 20:06:37 -0800 (PST), amar Singh > declaimed the following in > gmane.comp.python.general: > > > Hi, > > > I am confused between plain python, numpy, scipy, pylab, matplotlib. > > > I have high familiarity with matlab, but the compu

Project

2012-03-07 Thread Dev Dixit
Please, tell me how to develop project on "how people intract with social networing sites". -- http://mail.python.org/mailman/listinfo/python-list

deal with cookie in python 2.3

2012-03-07 Thread 胡峻
Dear All, right now I use python to capture data from a internal website. The website uses cookie to store authorization data. But there is no HttpCookieProcessor in python 2.3? Is there anybody know, how to deal with cookie in python 2.3? and could give me a sample code? thanks a lot Juli

Re: Porting the 2-3 heap data-structure library from C to Python

2012-03-07 Thread Stefan Behnel
Hrvoje Niksic, 07.03.2012 16:48: > Alec Taylor writes: > >> The source-code used has been made available: >> http://www.cosc.canterbury.ac.nz/research/RG/alg/ttheap.h >> http://www.cosc.canterbury.ac.nz/research/RG/alg/ttheap.c >> >> I plan on wrapping it in a class. > > You should get acquainted

Re: Porting the 2-3 heap data-structure library from C to Python

2012-03-07 Thread Hrvoje Niksic
Alec Taylor writes: > The source-code used has been made available: > http://www.cosc.canterbury.ac.nz/research/RG/alg/ttheap.h > http://www.cosc.canterbury.ac.nz/research/RG/alg/ttheap.c > > I plan on wrapping it in a class. You should get acquainted with the Python/C API, which is the standard

Re: RotatingFileHandler Fails

2012-03-07 Thread arun1
Hi, Actually NonInheritedRotatingFileHandler is rotating the log files but some times it falis and showing I/O errors while the log file limit reaches the given size. Thanks Arun -- View this message in context: http://python.6.n6.nabble.com/RotatingFileHandler-Fails-tp4542769p4554781.html S

Python 3.2 and MS Outlook

2012-03-07 Thread Greg Lindstrom
Is there documentation showing how to read from a Microsoft Outlook server using Python 3.2. I've done it with 2.x, but can't find anything to help me with 3.2. Thanks, --greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Porting the 2-3 heap data-structure library from C to Python

2012-03-07 Thread Stefan Behnel
Alec Taylor, 07.03.2012 15:25: > I am planning to port the 2-3 heap data-structure as described by > Professor Tadao Takaoka in Theory of 2-3 Heaps published in 1999 and > available in PDF: > http://www.cosc.canterbury.ac.nz/tad.takaoka/2-3heaps.pdf > > The source-code used has been made available

Porting the 2-3 heap data-structure library from C to Python

2012-03-07 Thread Alec Taylor
I am planning to port the 2-3 heap data-structure as described by Professor Tadao Takaoka in Theory of 2-3 Heaps published in 1999 and available in PDF: http://www.cosc.canterbury.ac.nz/tad.takaoka/2-3heaps.pdf The source-code used has been made available: http://www.cosc.canterbury.ac.nz/research

GUI components in python

2012-03-07 Thread janaki rajamani
Hi I am stuck with the brain workshop software implemented using python. The code involves a lot of GUI elements and i am familar only with the basic python programming. I would like to know whether there are built in classes to support GUI elements or arethey project dependant. -- janaki -- ht

Re: RotatingFileHandler Fails

2012-03-07 Thread arun1
Hi nac, NTSafeLogging.py is working fine without any errors, but its not rotating the log files as rotatingfilehandler does. Do you have any working sample with NTSafeLogging which rotates the log file. logging issue with subprocess.Popen can be solved using this code import threading lock =

Re: "Decoding unicode is not supported" in unusual situation

2012-03-07 Thread Steven D'Aprano
On Wed, 07 Mar 2012 22:18:50 +1100, Ben Finney wrote: > de...@web.de (Diez B. Roggisch) writes: > >> John Nagle writes: >> >> > I think that somewhere in "suds", they subclass the "unicode" type. >> > That's almost too cute. >> > >> > The proper test is >> > >> >isinstance(s,unicode) >> >> W

Re: "Decoding unicode is not supported" in unusual situation

2012-03-07 Thread Ben Finney
de...@web.de (Diez B. Roggisch) writes: > John Nagle writes: > > > I think that somewhere in "suds", they subclass the "unicode" type. > > That's almost too cute. > > > > The proper test is > > > > isinstance(s,unicode) > > Woot, you finally discovered polymorphism - congratulations! If by “

Need help in wx.ListBox edit

2012-03-07 Thread
Hi , I am using wxWidget for GUI programming. I need help in editing text appended in wx.ListBox(). Which wx API's do I need to use ? I would like to edit text on mouse double click event . Thanks in advance. Praveen. The information in this e-mail is confidential. The contents may not

Re: What's the best way to write this regular expression?

2012-03-07 Thread Paul Rubin
John Salerno writes: > The Beautiful Soup 4 documentation was very clear, and BS4 itself is > so simple and Pythonic. And best of all, since version 4 no longer > does the parsing itself, you can choose your own parser, and it works > with lxml, so I'll still be using lxml, but with a nice, clean

Re: Error importing __init__ declared variable from another package

2012-03-07 Thread Fabio Zadrozny
On Wed, Feb 29, 2012 at 1:38 AM, Jason Veldicott wrote: >> > Hi, >> > >> > I have a simple configuration of modules as beneath, but an import error >> > is reported: >> > >> > /engine >> >    (__init__ is empty here) >> >    engine.py >> > /sim >> >    __init__.py >> > >> > >> > The module engine.

Re: "Decoding unicode is not supported" in unusual situation

2012-03-07 Thread Diez B. Roggisch
John Nagle writes: > I think that somewhere in "suds", they subclass the "unicode" type. > That's almost too cute. > > The proper test is > > isinstance(s,unicode) Woot, you finally discovered polymorphism - congratulations! Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: help: confused about python flavors....

2012-03-07 Thread Mark Lawrence
On 07/03/2012 06:24, Steven D'Aprano wrote: On Tue, 06 Mar 2012 20:06:37 -0800, amar Singh wrote: Hi, I am confused between plain python, numpy, scipy, pylab, matplotlib. Python is a programming language. It comes standard with many libraries for doing basic mathematics, web access, email, e

Re: Get tkinter text to the clipboard

2012-03-07 Thread Peter Otten
bugzilla-mail-...@yandex.ru wrote: > How can I get something from tkinter gui to another program ? > tkinter on python 3.2 on kde4 How about import tkinter root = tkinter.Tk() root.clipboard_clear() root.clipboard_append("whatever") -- http://mail.python.org/mailman/listinfo/python-list

"Decoding unicode is not supported" in unusual situation

2012-03-07 Thread John Nagle
I'm getting line 79, in tounicode return(unicode(s, errors='replace')) TypeError: decoding Unicode is not supported from this, under Python 2.7: def tounicode(s) : if type(s) == unicode : return(s) return(unicode(s, errors='replace')) That would seem to be impossible. But it's

Re: Why this recursive import fails?

2012-03-07 Thread INADA Naoki
I found it is a bug http://bugs.python.org/issue13187 -- http://mail.python.org/mailman/listinfo/python-list

Help: how to protect the module 'sys' and 'os'

2012-03-07 Thread q q
Hi~ alls, I have to limit somebody modify the attr of 'sys'&'os'? e.g. you can't append sys.path. Someone has a good method? now my way: modified the source code of python ,"_PyObject_GenericSetAttrWithDict", because if you want to reset the value, you need to invoke this function. --- best regar

Re: pickle/unpickle class which has changed

2012-03-07 Thread Peter Otten
Gelonida N wrote: > Is there anyhing like a built in signature which would help to detect, > that one tries to unpickle an object whose byte code has changed? No. The only thing that is stored is the "protocol", the format used to store the data. > The idea is to distinguish old and new pickle