title: My googlesearch is not working in multiprocess pool, it gives a MaybeEncodingError
body: <p>Currently I'm trying to use multiple processing to search up book titles find their first 30 summary links with googlesearch on python</p>
  <pre><code>from googlesearch import search
  from bs4 import BeautifulSoup
  import os
  from multiprocessing import Pool
  import json
  import requests
  from urllib.parse import urlparse
  
  SAVE_PDF_PATH = &quot;../books_pdf&quot;
  SAVE_SUM_PATH = &quot;../summary_txt&quot;
  def perform_search(title):
      &quot;&quot;&quot;Perform search for the title summaries and save it's texts into files
      return quadruples of (url, domain, starting depth = 0 , maxdepth) used for crawl&quot;&quot;&quot;
      
      dir_path =f&quot;{SAVE_SUM_PATH}/{title}&quot;
      #print(f&quot;dir_path: {dir_path}&quot;)
      try:
          os.mkdir(dir_path) #create a directory if needed
      except:
          pass
      query = title + &quot; summary&quot;
      print(f&quot;query: {query}&quot;)
      results = list()
      for url in search(query, num = 30, stop = 30, verify_ssl = False):
          results.append(url)
      return results
  def main():
      
      titles = list()
      for title in os.listdir(SAVE_PDF_PATH):
          titles.append(title[:-4])
      
      search_stuff = titles[0:2]
      print(f&quot;search_stuff: {search_stuff}&quot;)
      p = Pool()
      results = p.map(perform_search, titles[0:2])
      p.close()
      p.join()
      
      # p2 = Pool()
      # results = p2.map(crawl, quads)
      # p2.close()
      # p2.join()
      print(f&quot;results: {results}&quot;)
      
  if __name__ == &quot;__main__&quot;:
      main()
  </code></pre>
  <p>The thing is it worked at one point then stopped working, if I comment out the search then the multiprocessing works again.
  Otherwise it gives me this error:</p>
  <pre><code>  File &quot;/Users/yao/Desktop/dkp/School/projects/Stuff_with_Books/summary_scraper/sum_scrape.py&quot;, line 73, in &lt;module&gt;
      main()
    File &quot;/Users/yao/Desktop/dkp/School/projects/Stuff_with_Books/summary_scraper/sum_scrape.py&quot;, line 62, in main
      results = p.map(perform_search, titles[0:2])
    File &quot;/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/pool.py&quot;, line 364, in map
      return self._map_async(func, iterable, mapstar, chunksize).get()
    File &quot;/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/pool.py&quot;, line 771, in get
      raise self._value
  multiprocessing.pool.MaybeEncodingError: Error sending result: '&lt;multiprocessing.pool.ExceptionWithTraceback object at 0x7fa4750c4490&gt;'. Reason: 'TypeError(&quot;cannot pickle '_io.BufferedReader' object&quot;)'
  </code></pre>