Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'completeness': 0.05; 'attribute': 0.07; 'python': 0.08; 'to:name:python- list@python.org': 0.15; "'a'": 0.16; '712': 0.16; 'currencies': 0.16; 'disclaimers': 0.16; 'disclaimers,': 0.16; 'from:addr:jpmorgan.com': 0.16; 'handy': 0.16; 'received:155.180': 0.16; 'received:155.180.234': 0.16; 'received:159.53': 0.16; 'received:159.53.110': 0.16; 'received:bankone.net': 0.16; 'received:exchad.jpmchase.net': 0.16; 'received:jpmchase.com': 0.16; 'received:jpmchase.net': 0.16; 'received:svr.bankone.net': 0.16; 'securities,': 0.16; 'subject:instance': 0.16; 'suggestions?': 0.16; 'url:disclosures': 0.16; 'url:jpmorgan': 0.16; 'instance': 0.18; 'header:In-Reply-To:1': 0.22; 'string': 0.24; 'creating': 0.25; 'guess': 0.26; 'looks': 0.27; 'not.': 0.28; 'received:169': 0.28; 'received:169.254': 0.28; 'see,': 0.29; 'class': 0.29; 'kelly': 0.30; 'received:155': 0.30; 'received:159': 0.30; 'str': 0.30; 'error': 0.30; 'on,': 0.31; 'version': 0.32; 'accuracy': 0.32; 'thanks': 0.32; 'it.': 0.33; 'object': 0.33; 'test': 0.34; 'header:Received:8': 0.34; 'subject:getting': 0.34; 'to:addr:python-list': 0.35; 'phone:': 0.35; '...': 0.35; 'passed': 0.37; 'but': 0.37; 'charset:us- ascii': 0.37; 'getting': 0.38; 'to:addr:python.org': 0.40; 'subject': 0.61; 'offers': 0.62; 'said:': 0.67; 'information,': 0.69; 'legal': 0.72; 'url:email': 0.72; 'blank': 0.74; 'bank': 0.75; 'sale': 0.75; 'investment': 0.77; 'purchase': 0.78; '2.7.': 0.84; 'difference.': 0.84; 'ian,': 0.84; 'received:169.254.8': 0.84 X-DKIM: OpenDKIM Filter v2.1.3 sj3.jpmchase.com q2FKQ9Kc017830 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=jpmorgan.com; s=smtpout; t=1331843170; bh=5sdvsdsmWUnc05zRPkpjCQFtNJypJg92yFnLyqyv6yY=; h=From:To:Subject:Date:Message-ID:References:In-Reply-To: Content-Transfer-Encoding:MIME-Version:Content-Type; b=OO+xDIJcMXyYI/WUm3ZS6nQ9ert7qA89AxgAAJ+UeWbt9nBeJgURNNQHf4qWpeFsy rqhKXb2wrnqvKa+AgGwvqOxY7LQbb5HY6uxXxK3P9FNaTnMqQHDxqHR4xL7RywoJVa FO0PnvIeA59/WB3E98xFz1T0xmO7Fqi1Cfq5VA6o= From: "Prasad, Ramit" To: "python-list@python.org" Subject: RE: Context Manager getting str instead of AttributeError instance Thread-Topic: Context Manager getting str instead of AttributeError instance Thread-Index: Ac0C0ee2HWpMrUyoSZqdW3mY/u0AugADC2TOAAA7KnAACcw1AAAHQnFw Date: Thu, 15 Mar 2012 20:25:46 +0000 References: <5B80DD153D7D744689F57F4FB69AF474026B9264@SCACMX008.exchad.jpmchase.net> <5B80DD153D7D744689F57F4FB69AF474026B9625@SCACMX008.exchad.jpmchase.net> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.67.79.38] Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-DLP-FWD: Yes Content-Type: text/plain; charset="us-ascii" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1331843179 news.xs4all.nl 6844 [2001:888:2000:d::a6]:51905 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:21710 > > =2E=2E=2E=0D=0A> > (, "'A' object h= as no attribute 'x'",=0D=0A> )=0D=0A> > Att= ributeError: 'A' object has no attribute 'x'=0D=0A> >=0D=0A> > As you can s= ee, I am getting a string while you are not=2E=0D=0A> =0D=0A>Ian Kelly said= : =0D=0A> Looks like a version difference=2E I don't have Python 2=2E6 han= dy to=0D=0A> test on, but I get a str in Python 2=2E5 and an AttributeError= instance=0D=0A> in Python 2=2E7=2E=0D=0A=0D=0AThanks Ian, that was the key= ! I guess I will just have to work around it=2E=0D=0AAny suggestions? I am = thinking about just creating a blank instance of =0D=0Athe error class sinc= e that the class gets passed successfully=2E=0D=0A=0D=0A=0D=0ARamit=0D=0A= =0D=0A=0D=0ARamit Prasad | JPMorgan Chase Investment Bank | Currencies Tech= nology=0D=0A712 Main Street | Houston, TX 77002=0D=0Awork phone: 713 - 216 = - 5423=0D=0A=0D=0A--=0D=0A=0D=0AThis email is confidential and subject to i= mportant disclaimers and=0D=0Aconditions including on offers for the purcha= se or sale of=0D=0Asecurities, accuracy and completeness of information, vi= ruses,=0D=0Aconfidentiality, legal privilege, and legal entity disclaimers,= =0D=0Aavailable at http://www=2Ejpmorgan=2Ecom/pages/disclosures/email=2E