Giter VIP home page Giter VIP logo

Comments (3)

JNRowe avatar JNRowe commented on August 26, 2024

No immediate idea, and I can't duplicate it here.

Ξ Projects/alchemist git:(master) ▶ ipython
Python 2.7.3 (default, Dec 27 2012, 21:12:10) 
Type "copyright", "credits" or "license" for more information.

IPython 0.13 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: %cd ~/Projects/pyisbn/
/home/jay/Projects/pyisbn

In [2]: from tests import test_data

In [3]: isbns = test_data.TEST_BOOKS.values()

In [4]: isbns.insert(40, '123')

In [5]: import pyisbn

In [6]: filter(lambda s: not pyisbn.validate(s), isbns)
---------------------------------------------------------------------------
IsbnError                                 Traceback (most recent call last)
<ipython-input-6-1288e1dd640e> in <module>()
----> 1 filter(lambda s: not pyisbn.validate(s), isbns)

<ipython-input-6-1288e1dd640e> in <lambda>(s)
----> 1 filter(lambda s: not pyisbn.validate(s), isbns)

/home/jay/Projects/pyisbn/pyisbn/__init__.pyc in validate(isbn)
    420 
    421     """
--> 422     isbn = _isbn_cleanse(isbn)
    423     return isbn[-1].upper() == calculate_checksum(isbn[:-1])

/home/jay/Projects/pyisbn/pyisbn/__init__.pyc in _isbn_cleanse(isbn, checksum)
    337                 raise IsbnError('non-digit checksum')
    338         else:
--> 339             raise IsbnError('ISBN must be either 10 or 13 characters long')
    340     else:
    341         if len(isbn) == 8:

IsbnError: ISBN must be either 10 or 13 characters long

In [7]:

The only thing I'd guess at from looking at your paste is that your terminal got itself in a bad state. Given the way the output is mixed it looks like a buffering problem unrelated to pyisbn.

Can you reproduce the problem using the plain python interpreter, or on a non-Windows system?

from pyisbn.

sardeie avatar sardeie commented on August 26, 2024

I can't reproduce it in the regular python interpreter, but have done so several times in ipython although not consistently. You're probably right in your guess. For now, I'll keep an eye out and let you know if anything interesting happens. Thanks man.

from pyisbn.

JNRowe avatar JNRowe commented on August 26, 2024

have done so several times in ipython although not consistently.

FWIW, I've just tried a few more times and still can't reproduce it.

For now, I'll keep an eye out and let you know if anything interesting happens.

Absolutely.

I'm closing this issue as it doesn't appear to be pyisbn related, but feel free to re-open it or open another one if some new information comes to light.

from pyisbn.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.