mitsuhiko / phpserialize

A PHP serializer implementation for Python
http://pypi.python.org/pypi/phpserialize
Other
128 stars 69 forks source link

phpserialize doesn't work with Python 3 #2

Open msabramo opened 13 years ago

msabramo commented 13 years ago

I have changes to make it work at:

https://github.com/msabramo/phpserialize/tree/python3.x

$ python -m pytest -x
===================================== test session starts ======================================
platform darwin -- Python 3.2.2 -- pytest-2.1.3
collected 10 items 

tests/test_phpserialize.py ..........

================================== 10 passed in 0.21 seconds ===================================

Obviously, you don't want to pull these changes into master and break Python 2.x compatibility, which is why I didn't send a pull request (I didn't see a way to request that it be pulled into an upstream branch that doesn't exist yet...?).

Cheers, Marc

jstasiak commented 11 years ago

It looks like this one can be closed as Python 3 is supported.

smurfix commented 9 years ago

no it's not, one test fails

FAIL: test_dumps_dict (tests.PhpSerializeTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/mnt/d/src/git/nikola/phpserialize/tests.py", line 36, in test_dumps_dict
    b'a:3:{s:1:"a";i:1;s:1:"c";i:3;s:1:"b";i:2;}')
AssertionError: b'a:3:{s:1:"b";i:2;s:1:"c";i:3;s:1:"a";i:1;}' != b'a:3:{s:1:"a";i:1;s:1:"c";i:3;s:1:"b";i:2;}'
smurfix commented 9 years ago

… oops, false negative, that's just dictionary ordering. Nevertheless,l to be fixed.