1. cthedot
  2. cssutils
Issue #20 resolved

CSSParser.parseUrl() error with Python 3.3

Arfrever Frehtes Taifersar Arahesis
created an issue

Test suite fails with Python 3.3 (and passes with previous versions).

$ nosetests-3.3 build/lib
......................................................................................................................................................................................................................................................E...................................................................................................................
======================================================================
ERROR: CSSParser.parseUrl()
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/cssutils/build/lib/cssutils/_fetch.py", line 24, in _defaultFetcher
    res = urllib.request.urlopen(request)
  File "/usr/lib64/python3.3/urllib/request.py", line 160, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib64/python3.3/urllib/request.py", line 479, in open
    response = meth(req, response)
  File "/usr/lib64/python3.3/urllib/request.py", line 591, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib64/python3.3/urllib/request.py", line 517, in error
    return self._call_chain(*args)
  File "/usr/lib64/python3.3/urllib/request.py", line 451, in _call_chain
    result = func(*args)
  File "/usr/lib64/python3.3/urllib/request.py", line 599, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/cssutils/build/lib/tests/test_parse.py", line 143, in test_parseUrl
    self.assertRaises(urllib.error.HTTPError, parser.parseUrl, 'http://cthedot.de/not-present.css')
  File "/usr/lib64/python3.3/unittest/case.py", line 571, in assertRaises
    return context.handle('assertRaises', callableObj, args, kwargs)
  File "/usr/lib64/python3.3/unittest/case.py", line 135, in handle
    callable_obj(*args, **kwargs)
  File "/tmp/cssutils/build/lib/cssutils/parse.py", line 201, in parseUrl
    overrideEncoding=encoding)
  File "/tmp/cssutils/build/lib/cssutils/util.py", line 838, in _readUrl
    r = fetcher(url)
  File "/tmp/cssutils/build/lib/cssutils/_fetch.py", line 27, in _defaultFetcher
    log.warn(e, error=OSError)
  File "/tmp/cssutils/build/lib/cssutils/errorhandler.py", line 98, in __handle
    raise error(msg)
OSError: HTTP Error 404: Not Found

----------------------------------------------------------------------
Ran 362 tests in 10.267s

FAILED (errors=1)

Comments (6)

  1. Log in to comment