Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #4133
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!69.16.185.11.MISMATCH!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!cu4g2000vbb.googlegroups.com!not-for-mail |
|---|---|
| From | "ivdneut@gmail.com" <ivdneut@gmail.com> |
| Newsgroups | comp.lang.python |
| Subject | unpickling derived LogRecord in python 2.7 from python2.6 |
| Date | Wed, 27 Apr 2011 06:56:43 -0700 (PDT) |
| Organization | http://groups.google.com |
| Lines | 33 |
| Message-ID | <dddb61de-6964-41c4-9f14-d9d1d5fdb2b7@cu4g2000vbb.googlegroups.com> (permalink) |
| NNTP-Posting-Host | 145.23.254.101 |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1 |
| X-Trace | posting.google.com 1303912603 27215 127.0.0.1 (27 Apr 2011 13:56:43 GMT) |
| X-Complaints-To | groups-abuse@google.com |
| NNTP-Posting-Date | Wed, 27 Apr 2011 13:56:43 +0000 (UTC) |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | cu4g2000vbb.googlegroups.com; posting-host=145.23.254.101; posting-account=W0yZ_goAAADAYkC_Qnpsg0MUvOyZ5Sm4 |
| User-Agent | G2/1.0 |
| X-HTTP-Via | 1.1 bips01.knmi.nl:80 (IronPort-WSA/6.3.7-013) |
| X-HTTP-UserAgent | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.16) Gecko/20110322 Fedora/3.6.16-1.fc14 Firefox/3.6.16,gzip(gfe) |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:4133 |
Show key headers only | View raw
Hello all,
I have a service that runs in python 2.6.4. This service sends
LogRecords to a log monitoring app on my workstation running python
2.7. The LogRecord class is derived:
class LogRecord(logging.LogRecord):
def __init__(self, name, level, fn, lno, user, hostname, msg,
args, exc_info, func=None):
if sys.version_info[1] > 4:
logging.LogRecord.__init__(self, name, level, fn, lno,
msg, args, exc_info, func)
else:
logging.LogRecord.__init__(self, name, level, fn, lno,
msg, args, exc_info)
Now when I try to unpickle it:
record = cPickle.loads(data)
I get a TypeError exception:
TypeError: ('__init__() takes at least 8 arguments (1 given)', <class
'...gRecord'>, ())
I've searched the web and this group, but most results are old. It
worked when my workstation still ran python 2.6.
Thank you,
Ian.
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
unpickling derived LogRecord in python 2.7 from python2.6 "ivdneut@gmail.com" <ivdneut@gmail.com> - 2011-04-27 06:56 -0700
Re: unpickling derived LogRecord in python 2.7 from python2.6 Peter Otten <__peter__@web.de> - 2011-04-27 18:41 +0200
Re: unpickling derived LogRecord in python 2.7 from python2.6 Vinay Sajip <vinay_sajip@yahoo.co.uk> - 2011-04-27 13:39 -0700
Re: unpickling derived LogRecord in python 2.7 from python2.6 Peter Otten <__peter__@web.de> - 2011-04-28 09:22 +0200
Re: unpickling derived LogRecord in python 2.7 from python2.6 "ivdneut@gmail.com" <ivdneut@gmail.com> - 2011-04-29 01:36 -0700
csiph-web