Skip to content
Snippets Groups Projects
  1. Aug 05, 2018
    • Damian Johnson's avatar
      Better error message if file objects aren't seekable · 8ec17d80
      Damian Johnson authored
      As reported by teor, stem.descriptor's parse_file() function cannot accept
      stdin...
      
        https://trac.torproject.org/projects/tor/ticket/23859
      
      The trouble is that not all file objects in python are seekable. I'd *like*
      to handle address this transparently by buffering the content...
      
        try:
          descriptor_file.tell()
        except IOError:
          # file's not seekable, wrapping in a buffer that is
      
          descriptor_file = io.BytesIO(descriptor_file.read())
      
      This works great if our stream has content...
      
        % cat my_descriptors | python demo.py
      
      *But* hangs indefinitely if no EOF is present in the stream.
      
        % python demo.py   <= hangs
      
      Turns out non-blocking, platform independent reading of streams like stdin is
      pretty tricky...
      
        http://eyalarubas.com/python-subproc-nonblock.html
      
      As such simply providing callers with a more descriptive exception. If they
      know their stream won't block *they* can add the above wrapper to provide
      us with a seekable file object.
      8ec17d80
  2. Aug 04, 2018
  3. Aug 03, 2018
  4. Jul 31, 2018
  5. Jul 29, 2018
  6. Jul 24, 2018
  7. Jul 23, 2018
  8. Jul 22, 2018
  9. Jul 20, 2018
    • Damian Johnson's avatar
      Add missing changelog entries · c30a7e48
      Damian Johnson authored
      Skimmed over our history to fill in changelog gaps. We only include user facing
      adjustments to existing features so this didn't include most of our recent work
      (stem.client wasn't part of Stem 1.6, and we don't note testing or development
      changes).
      c30a7e48
  10. Jul 19, 2018
  11. Jul 18, 2018
  12. Jul 17, 2018
    • Damian Johnson's avatar
      Type hashing produced inconsistant values · 7792a9bf
      Damian Johnson authored
      Hashing classes (ie. "hash(type(my_obj))") sometimes provides inconsistant
      values between interpreter invocations. Common builtin types (int, str, etc)
      are consistant, but custom classes appear to vary.
      
      Generally speaking this is fine. Hash value consistancy is only highly
      important within an interpreter invocation. But full consistancy is nice and
      easy to achieve.
      
      Hashing the string representation of our module name instead.
      7792a9bf
  13. Jul 16, 2018
  14. Jul 15, 2018
  15. Jul 12, 2018
Loading