Thanks for the update Jim. 

Also, I happened to try out the Python 2.5 wave.py module in Jython and it appears to work.  At least, it does pass the unit tests and I can read real wave files with it, so so you could add that module to the alpha if you wanted to.

 - Bob


-----Original Message-----
From: Jim Baker <jbaker@zyasoft.com>
To: boblusebob@aim.com
Cc: jython-dev@lists.sourceforge.net
Sent: Sat, 19 Jul 2008 5:57 pm
Subject: Re: [Jython-dev] Fwd: Possible Bugs in Jython 2.5a1 array - Updates

array is not currently at 2.5-level compliance, this is a known issue. But it should be pretty easy to get fixed up.

I'm not certain where the alpha is on the build bot waterfall, but this is a rough guide to where we are in terms of unit test compliance:
http://freya.cs.uiuc.edu:8009/waterfall

- Jim


On Sat, Jul 19, 2008 at 3:48 AM, <boblusebob@aim.com> wrote:
Okay, on further research, a character in Python is a String of one item.  So it is a one 'character' String, not one or more characters.

Still, should:

--------------------------
import array

a = array.array("c", "abc123')

print a
--------------------------------

print

    array('c', 'abc123')      like in Python 2.5.2

or

    array('c', ['a', 'b', 'c', '1', '2', '3'])    like in Jython 2.5a1?


Also, when I use an 'L' type code I get the same value error message as when I used the 'B' type code.

And, when using 'H', Jython just changes it into 'i' and when using 'I' (upper case eye), Jython changes it to 'l' (lower case el).

 - Bob





-----Original Message-----
From: boblusebob@aim.com
To: jython-dev@lists.sourceforge.net
Sent: Sat, 19 Jul 2008 3:29 am
Subject: [Jython-dev] Possible Bugs in Jython 2.5a1 array

Hi,

I have found what I think are two bugs in the Jython 2.5 Alpha code for arrays.  The reason that I am writing here rather than making a bug report is that I am not positive they are bugs since arrays in Jython are a bit complicated (to me anyway).

The first question:

The following runnable short code snippet runs on both Jython and Python (I am running on Windows XP Pro) but gives slightly different results.

-----------------------------------------
import array

a = array.array("c", 'abc123')
print a
print a.tostring()
print


print repr(a.tostring())

for i in a:
    print i,
   
print

-----------------------------------------------

In Python 2.5.2 it prints the following:

    array('c', 'abc123')  # this is where they are different
    abc123

    'abc123'
    a b c 1 2 3

In Jython 2.5a1 it prints:

    array('c',['a', 'b', 'c', '1', '2', '3'])  # this is where they are different
    abc123

    'abc123'
    a b c 1 2 3


Intuitively, the Jython result seems right, an array of char.  But, my understanding of char in Python says that the Jython is wrong.  I think a Python char is 1 or more characters, in other words a string.  the Jython char array is actually several char arrays rather than one char array.


The other problem is unsigned char  -  using a 'B' as the type code.  I receive the following error message in Jython when declaring an array with the 'B' type code ( 'b' - signed char - works ok):


 Traceback (most recent call last):
  File "C:\...\src\charArraysUnsigned.py", line 6, in <module>
    a = array.array("B", 'abc123')
ValueError: typecode must be in [zcbhilfd]

The following very short code snippet should recreate the error in Jython:

---------------------------------
import array

a = array.array("B", 'abc123')

---------------------------------------

I'll open bug reports if someone will confirm that these are bugs and not something that needed to be done to get Java and Python working together.

Thanks,
  Bob


The Famous, the Infamous, the Lame - in your browser. Get the TMZ Toolbar Now!
-------------------------------------------------------------------------

This SF.Net email is sponsored by the Moblin Your Move Developer's challenge

Build the coolest Linux based applications with Moblin SDK & win great prizes

Grand prize is a trip for two to an Open Source event anywhere in the world

http://moblin-contest.org/redirect.php?banner_id=100&url=/

_______________________________________________

Jython-dev mailing list

Jython-dev@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/jython-dev


The Famous, the Infamous, the Lame - in your browser. Get the TMZ Toolbar Now!

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Jython-dev mailing list
Jython-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-dev




--
Jim Baker
jbaker@zyasoft.com