jython shelve problem

View: New views
3 Messages — Rating Filter:   Alert me  

jython shelve problem

by J. Van Brimmer-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm trying to use shelve in a small Jython program, but every time I
try to run it, I get an error message:

"TypeError: open() got an unexpected keyword argument 'writeback'"

Here's my code:

#---- begin -------#

#! c:\jython2.2.1\jython.jar

import os, sys, shelve
shelfpath = sys.path[0]
print
print "Path to the shelf directory:", shelfpath
print
path = ('%s''\\''%s''.''db') % (shelfpath, 'accounts_database')
print
print "This is the path to the shelf:" , path

file = shelve.open(path, 'c', writeback=True)
print file

#---- end --------#


My configuration:
Windows Vista
Eclipse 3.3.2
Jython2.2.1
Python2.5.2
jdk1.5.0_12

Jython, Python and Java JRE all set up to run in Eclipse. I'm trying to
run this program in Eclipse.

Why doesn't the "writeback" argument work?


Thanks in advance for any help




-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Jython-users mailing list
Jython-users@...
https://lists.sourceforge.net/lists/listinfo/jython-users

Re: jython shelve problem

by J. Van Brimmer-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I think I found the reason. What I don't know is if this is a bug, or
if Jython is designed this way.

In the Jython shelve.py module there is no writeback argument option on
the "open" function. But, it is there in the python2.5.2 shelve.py
module.

So,does Jython just not support the writeback option, or is this a bug?
It looks like it was taken out on purpose. But, what's the reason?

Thanks in advance for any help or answers.


Quoting "J. Van Brimmer" <jevb+jython@...>: J. Van Brimmer once said:

> I'm trying to use shelve in a small Jython program, but every time I
> try to run it, I get an error message:
>
> "TypeError: open() got an unexpected keyword argument 'writeback'"
>
> Here's my code:
>
> #---- begin -------#
>
> #! c:\jython2.2.1\jython.jar
>
> import os, sys, shelve
> shelfpath = sys.path[0]
> print
> print "Path to the shelf directory:", shelfpath
> print
> path = ('%s''\\''%s''.''db') % (shelfpath, 'accounts_database')
> print
> print "This is the path to the shelf:" , path
>
> file = shelve.open(path, 'c', writeback=True)
> print file
>
> #---- end --------#
>
>
> My configuration:
> Windows Vista
> Eclipse 3.3.2
> Jython2.2.1
> Python2.5.2
> jdk1.5.0_12
>
> Jython, Python and Java JRE all set up to run in Eclipse. I'm trying to
> run this program in Eclipse.
>
> Why doesn't the "writeback" argument work?
>
>
> Thanks in advance for any help
>
>
>
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Jython-users mailing list
> Jython-users@...
> https://lists.sourceforge.net/lists/listinfo/jython-users
>


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Jython-users mailing list
Jython-users@...
https://lists.sourceforge.net/lists/listinfo/jython-users

Re: jython shelve problem

by marvingreenberg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

J. Van Brimmer wrote:

> I think I found the reason. What I don't know is if this is a bug, or
> if Jython is designed this way.
>
> In the Jython shelve.py module there is no writeback argument option on
> the "open" function. But, it is there in the python2.5.2 shelve.py
> module.
>
> So,does Jython just not support the writeback option, or is this a bug?
> It looks like it was taken out on purpose. But, what's the reason?
>  
Jython is at version 2.2 of python.  So there will be many differences
between the libraries for python 2.5/

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Jython-users mailing list
Jython-users@...
https://lists.sourceforge.net/lists/listinfo/jython-users
LightInTheBox - Buy quality products at wholesale price