Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Python 3.3 from .manylinux-install.sh #21

Merged
merged 1 commit into from
Nov 30, 2018
Merged

Drop Python 3.3 from .manylinux-install.sh #21

merged 1 commit into from
Nov 30, 2018

Conversation

mgedmin
Copy link
Member

@mgedmin mgedmin commented Nov 30, 2018

This was overlooked when dd38abc
dropped Python 3.3 from the other files.

This was overlooked when dd38abc
dropped Python 3.3 from the other files.
Copy link
Member

@jamadden jamadden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mgedmin
Copy link
Member Author

mgedmin commented Nov 30, 2018

A very strange failure on Appveyor for Python 2.7 (32-bit only).

zope-testrunner --test-path=src
Running zope.testrunner.layer.UnitTests tests:
  Set up zope.testrunner.layer.UnitTests in 0.000 seconds.
Error in test test_random (zope.index.text.tests.test_ricecode.TestRiceCode)
Traceback (most recent call last):
  File "c:\python27\lib\unittest\case.py", line 329, in run
    testMethod()
  File "c:\python27\lib\site-packages\zope\index\text\tests\test_ricecode.py", line 25, in test_random
    l2 = decode_deltas(l_0, deltas)
  File "c:\python27\lib\site-packages\zope\index\text\ricecode.py", line 185, in decode_deltas
    deltas = enc_deltas.tolist()
AttributeError: 'list' object has no attribute 'tolist'
  Ran 720 tests with 0 failures, 1 errors and 0 skipped in 0.968 seconds.
Tearing down left over layers:
  Tear down zope.testrunner.layer.UnitTests in 0.000 seconds.
Command exited with code 1

Note that while "appveyor/branch" failed, "appveyor/pr" succeeded, so this failure appears to be non-deterministic?!

@jamadden
Copy link
Member

so this failure appears to be non-deterministic?!

Well the test case is called test_random 🤷‍♂️

@jamadden
Copy link
Member

so this failure appears to be non-deterministic?!

Yup, that error will happen when the randomly sized list turns out to be 0.

        for size in [10, 20, 50, 100, 200]:
            l = list(range(random.randint(1, size), size + random.randint(1, size)))
            l_0, deltas = encode_deltas(l)

In that case, encode_deltas returns a list as its second value, instead of a RiceCode object:

def encode_deltas(l):
    """Encode deltas in list *l* using a :class:`RiceCode` of size 6."""
    if len(l) == 1:
        return l[0], []

@mgedmin
Copy link
Member Author

mgedmin commented Nov 30, 2018

Under what cicrumstances can

            l = list(range(random.randint(1, size), size + random.randint(1, size)))

produce an empty list?

The smallest case seems to be when the 1st randint returns the largest possible value and the second the smallest, which turns it into list(range(size, size+1)), and it should have one item in it. What am I missing?

EDIT: my brain, since it's not the input list that's size 0, it's the returned value.

@jamadden
Copy link
Member

jamadden commented Nov 30, 2018

What am I missing?

Sorry, I misspoke. I meant size one, not size 0. The code snippet is correct.

@mgedmin
Copy link
Member Author

mgedmin commented Nov 30, 2018

Anyway, this is a separate bug: #22.

@mgedmin mgedmin merged commit 740285a into master Nov 30, 2018
@mgedmin mgedmin deleted the drop-py33 branch November 30, 2018 17:10
@jamadden jamadden mentioned this pull request Nov 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants