LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-15-2006, 08:32 AM   #1
gobi_dgm
Member
 
Registered: Feb 2005
Location: Bangalore
Distribution: FC3
Posts: 137

Rep: Reputation: 15
Question Fatal Python error


Hi,
I'm facing a weird Python error. I tried unmarshalling a hash and got this error. There is lot of free space available and this is nowhere linked to that.

[root@amd result_hashes]# python
Python 2.4 (#1, Feb 8 2006, 18:31:16)
[GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import marshal
>>> fd=open('runed_result.hash','rb')
>>> hash=marshal.load(fd)
Fatal Python error: PyString_InternInPlace: strings only please!
Aborted

The above is the error message i got. I couldn find any relevant answer in google too. Any help is appreciated.

Thanks in advance
gobi
 
Old 11-15-2006, 01:41 PM   #2
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 47
You are marshalling a file object... I guess you meant something like
Code:
hash=marshal.load(fd.readline())
 
Old 11-15-2006, 10:16 PM   #3
gobi_dgm
Member
 
Registered: Feb 2005
Location: Bangalore
Distribution: FC3
Posts: 137

Original Poster
Rep: Reputation: 15
Thanks for your reply. marshal.load() expects file descriptor as its argument and the file i used was initially dumped by marshal in a different machine. The python versions in both the machines are same and i'm still trying to find what went wrong. Any help is appreciated.

Thanks
Gobi
 
Old 11-16-2006, 02:39 AM   #4
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 47
You're right. I have found plenty of references to that problem via Google but no real solution. Some say it's a memory problem, some say that marshal is not safe.

Personally I always use cPickle and I have never had an issue. Additionally, it's independant of the Python version.

Do you have the possibility to try with cPickle instead of marshal?
 
Old 11-17-2006, 12:32 AM   #5
gobi_dgm
Member
 
Registered: Feb 2005
Location: Bangalore
Distribution: FC3
Posts: 137

Original Poster
Rep: Reputation: 15
I solved the problem. I used FTP ASCII mode to transfer those hashes from other machine to mine. But i found FTP with BINARY mode solved that problem and now unmarshalling is proper.
As you suggested i will try with cpickle instead of marshal.
Thanks for all your help.


Gobi
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sound Server Fatal Error: Error - artsmessage: /tmp/mcop-root is accessible owned... m07hm4n Linux - Software 1 08-14-2006 01:01 PM
error when tying to run python script(bash error?) shanenin Programming 5 01-10-2006 10:01 AM
Mandrake Move 9.2 error, fatal server error:( silentwhispers Mandriva 1 12-16-2004 11:36 PM
MDK 9.1 Fatal Error in Stage 1: Exec Format Error Beano Mandriva 5 09-12-2004 03:04 PM
Fatal error sunoj81 Linux - General 1 11-03-2003 08:27 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration