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


Groups > comp.lang.python > #31823

'generator ignored GeneratorExit''

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <charleshixsn@earthlink.net>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'exception': 0.03; 'ignored': 0.05; 'except:': 0.07; 'try:': 0.07; 'doing?': 0.09; 'path)': 0.09; 'worked.': 0.09; 'def': 0.10; 'encoding': 0.15; '*should*': 0.16; 'correctly,': 0.16; 'message-id:@earthlink.net': 0.16; 'read:': 0.16; 'received:dsl.mindspring.com': 0.16; 'subject:generator': 0.16; 'fix': 0.17; 'module,': 0.17; 'yield': 0.17; 'appears': 0.18; 'changes': 0.20; 'import': 0.21; "i've": 0.23; 'raise': 0.24; 'tried': 0.25; 'header:User-Agent:1': 0.26; 'run': 0.28; 'code': 0.31; 'print': 0.32; 'problem': 0.33; 'to:addr:python-list': 0.33; 'whatever': 0.35; 'path': 0.35; 'open': 0.35; 'except': 0.36; 'but': 0.36; 'to:addr:python.org': 0.39; 'fil': 0.84; 'reporting,': 0.84
Date Sat, 20 Oct 2012 13:03:32 -0700
From Charles Hixson <charleshixsn@earthlink.net>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:10.0.7) Gecko/20120922 Icedove/10.0.7
MIME-Version 1.0
To python-list@python.org
Subject 'generator ignored GeneratorExit''
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2568.1350769123.27098.python-list@python.org> (permalink)
Lines 23
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1350769123 news.xs4all.nl 6974 [2001:888:2000:d::a6]:48906
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:31823

Show key headers only | View raw


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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web