Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #31823 > unrolled thread

'generator ignored GeneratorExit''

Started byCharles Hixson <charleshixsn@earthlink.net>
First post2012-10-20 13:03 -0700
Last post2012-10-20 13:03 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  'generator ignored GeneratorExit'' Charles Hixson <charleshixsn@earthlink.net> - 2012-10-20 13:03 -0700

#31823 — 'generator ignored GeneratorExit''

FromCharles Hixson <charleshixsn@earthlink.net>
Date2012-10-20 13:03 -0700
Subject'generator ignored GeneratorExit''
Message-ID<mailman.2568.1350769123.27098.python-list@python.org>
If I run the following code in the same module, it works correctly, but 
if I import it I get the message:
Exception RuntimeError: 'generator ignored GeneratorExit' in <generator 
object getNxtFile at 0x7f932f884f50> ignored

def getNxtFile (startDir, exts = ["txt", "utf8"]):
     try:
         for    path    in    getNxtPath (startDir, exts):
             try:
                 fil    =    open (path, encoding = "utf-8-sig")
                 yield    fil
             except:
                 print ("Could not read:  ", path)
     except    GeneratorExit:
         raise    StopIteration

The message appears to be purely informational, but I *would* like to 
fix whatever problem it's reporting, and none of the changes that I've 
tried have worked.  What *should* I be doing?

-- 
Charles Hixson

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web