Skip to content

Commit

Permalink
Demonstrate #273
Browse files Browse the repository at this point in the history
  • Loading branch information
kurtmckee committed Jun 13, 2021
1 parent 36c3b7f commit cd9a1f8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/runtests.py
Expand Up @@ -40,6 +40,7 @@
import threading
import time
import unittest
import urllib.error
import warnings
import xml.sax
import zlib
Expand Down Expand Up @@ -404,6 +405,12 @@ def test_unicode_2(self):
r = feedparser.api._open_resource(s, '', '', '', '', [], {}, {})
self.assertEqual(s, r)

def test_http_client_ascii_unicode_encode_error(self):
"""Confirm that a Unicode character doesn't cause a UnicodeEncodeError crash."""
url = 'https://0.0.0.0/ô'
with self.assertRaises(urllib.error.URLError):
feedparser.api._open_resource(url, '', '', '', '', [], {}, {})


def make_safe_uri_test(rel, expect, doc):
def fn(self):
Expand Down

0 comments on commit cd9a1f8

Please sign in to comment.