title: Python 2to3 not working
body: <p>I'm currently going through the python challenge, and i'm up to level 4, <a href="http://www.pythonchallenge.com/pc/def/linkedlist.php" rel="nofollow">see here</a> I have only been learning python for a few months, and i'm trying to learn python 3 over 2.x so far so good, except when i use this bit of code, here's the python 2.x version:</p>
  
  <pre><code>import urllib, re
  prefix = "http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing="
  findnothing = re.compile(r"nothing is (\d+)").search
  nothing = '12345'
  while True:
      text = urllib.urlopen(prefix + nothing).read()
      print text
      match = findnothing(text)
      if match:
          nothing = match.group(1)
          print "   going to", nothing
      else:
          break
  </code></pre>
  
  <p>So to convert this to 3, I would change to this:</p>
  
  <pre><code>import urllib.request, urllib.parse, urllib.error, re
  prefix = "http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing="
  findnothing = re.compile(r"nothing is (\d+)").search
  nothing = '12345'
  while True:
      text = urllib.request.urlopen(prefix + nothing).read()
      print(text)
      match = findnothing(text)
      if match:
          nothing = match.group(1)
          print("   going to", nothing)
      else:
          break
  </code></pre>
  
  <p>So if i run the 2.x version it works fine, goes through the loop, scraping the url and goes to the end, i get the following output:</p>
  
  <pre><code>and the next nothing is 72198
     going to 72198
  and the next nothing is 80992
     going to 80992
  and the next nothing is 8880
     going to 8880 etc
  </code></pre>
  
  <p>If i run the 3.x version, i get the following output:</p>
  
  <pre><code>b'and the next nothing is 44827'
  Traceback (most recent call last):
    File "C:\Python32\lvl4.py", line 26, in &lt;module&gt;
      match = findnothing(b"text")
  TypeError: can't use a string pattern on a bytes-like object
  </code></pre>
  
  <p>So if i change the r to a b in this line</p>
  
  <pre><code>findnothing = re.compile(b"nothing is (\d+)").search
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>b'and the next nothing is 44827'
     going to b'44827'
  Traceback (most recent call last):
    File "C:\Python32\lvl4.py", line 24, in &lt;module&gt;
      text = urllib.request.urlopen(prefix + nothing).read()
  TypeError: Can't convert 'bytes' object to str implicitly
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>I'm pretty new to programming, so please don't bite my head off.</p>
  
  <p>_bk201</p>