Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #102555
| Path | csiph.com!1.us.feeder.erje.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed0.kamp.net!newsfeed.kamp.net!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | "Martin A. Brown" <martin@linux-ip.net> |
| Newsgroups | comp.lang.python |
| Subject | Re: Exception handling for socket.error in Python 3.5/RStudio |
| Date | Fri, 5 Feb 2016 13:01:22 -0800 |
| Lines | 44 |
| Message-ID | <mailman.18.1454706087.2317.python-list@python.org> (permalink) |
| References | <1067e50c-bcbd-464e-8013-754bd66fda91@googlegroups.com> <alpine.LSU.2.11.1602051237120.2025@znpeba.jbaqresebt.arg> <CALqmhqodOPdebFA_Zmj1fiX3r=L=cHZDU=oc=4xmq+3sJaMG6w@mail.gmail.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=US-ASCII |
| X-Trace | news.uni-berlin.de IDj+whFzoOJzoMsy0qlMHwgS5mTP4FD0MV1oDTRHay/A== |
| Return-Path | <martin@linux-ip.net> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.001 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'subject:Python': 0.05; 'python3': 0.05; 'chunk': 0.07; 'cc:addr:python-list': 0.09; 'ide': 0.09; 'nameerror:': 0.09; 'socket.error': 0.09; 'python': 0.10; 'syntax': 0.13; 'interpreter': 0.15; '23,': 0.16; 'from:addr:martin': 0.16; 'luck,': 0.16; 'received:hsd1.or.comcast.net': 0.16; 'received:io': 0.16; 'received:or.comcast.net': 0.16; 'received:psf.io': 0.16; 'subject:handling': 0.16; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'martin': 0.22; 'cc:no real name:2**0': 0.22; 'code.': 0.23; 'defined': 0.23; '(or': 0.23; 'bigger': 0.23; 'this:': 0.23; '(most': 0.24; 'header:In-Reply-To:1': 0.24; 'skip:" 20': 0.26; 'error': 0.27; 'executing': 0.27; 'received:24': 0.28; 'subject:/': 0.30; 'connection': 0.30; 'you?': 0.30; 'code': 0.30; 'error.': 0.31; 'certain': 0.31; 'getting': 0.33; 'run': 0.33; 'received:comcast.net': 0.33; 'traceback': 0.33; "skip:' 20": 0.34; 'file': 0.34; 'saved': 0.35; 'skip:> 10': 0.35; 'problem.': 0.35; 'reply.': 0.35; 'subject:: ': 0.37; 'there,': 0.37; 'thanks': 0.37; 'charset:us-ascii': 0.37; 'skip:s 40': 0.38; 'still': 0.40; 'your': 0.60; 'received:network': 0.61; 'close': 0.61; 'telling': 0.61; 'strictly': 0.64; 'is)': 0.84; 'absolutely': 0.88 |
| X-X-Sender | mabrown@macron.wonderfrog.net |
| In-Reply-To | <CALqmhqodOPdebFA_Zmj1fiX3r=L=cHZDU=oc=4xmq+3sJaMG6w@mail.gmail.com> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.21rc2 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://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 | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Xref | csiph.com comp.lang.python:102555 |
Show key headers only | View raw
Hi there,
>Thanks for the detailed reply. I edited, saved and opened the file
>again. Still I am getting exactly the same error.
>
>Putting bigger chunk of code and the error again:
[snipped; thanks for the larger chunk]
>Error:
>except socket.error as e:
> ^
>SyntaxError: invalid syntax
I ran your code. I see this:
$ python3 shaunak.bangale.py
Connecting...
Connection succeeded
Traceback (most recent call last):
File "shaunak.bangale.py", line 23, in <module>
ssl_sock.write(bytes(initiation_command, 'UTF-8'))
NameError: name 'initiation_command' is not defined
Strictly speaking, I don't think you are having a Python problem.
* Are you absolutely certain you are (or your IDE is) executing
the same code you are writing?
* How would you be able to tell? Close your IDE. Run the code on
the command-line.
* How much time have you taken to work out what the interpreter is
telling you?
Good luck,
-Martin
--
Martin A. Brown
http://linux-ip.net/
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Exception handling for socket.error in Python 3.5/RStudio shaunak.bangale@gmail.com - 2016-02-05 11:58 -0800
Re: Exception handling for socket.error in Python 3.5/RStudio Nathan Hilterbrand <nhilterbrand@gmail.com> - 2016-02-05 15:07 -0500
Re: Exception handling for socket.error in Python 3.5/RStudio shaunak.bangale@gmail.com - 2016-02-05 12:11 -0800
Re: Exception handling for socket.error in Python 3.5/RStudio shaunak.bangale@gmail.com - 2016-02-05 12:17 -0800
Re: Exception handling for socket.error in Python 3.5/RStudio "Martin A. Brown" <martin@linux-ip.net> - 2016-02-05 12:08 -0800
Re: Exception handling for socket.error in Python 3.5/RStudio shaunak.bangale@gmail.com - 2016-02-05 12:22 -0800
Re: Exception handling for socket.error in Python 3.5/RStudio "Martin A. Brown" <martin@linux-ip.net> - 2016-02-05 12:44 -0800
Re: Exception handling for socket.error in Python 3.5/RStudio "Martin A. Brown" <martin@linux-ip.net> - 2016-02-05 13:01 -0800
Re: Exception handling for socket.error in Python 3.5/RStudio Chris Angelico <rosuav@gmail.com> - 2016-02-06 08:01 +1100
Re: Exception handling for socket.error in Python 3.5/RStudio Bernardo Sulzbach <mafagafogigante@gmail.com> - 2016-02-05 19:08 -0200
Re: Exception handling for socket.error in Python 3.5/RStudio shaunak.bangale@gmail.com - 2016-02-05 13:26 -0800
Re: Exception handling for socket.error in Python 3.5/RStudio Bernardo Sulzbach <mafagafogigante@gmail.com> - 2016-02-05 19:37 -0200
Re: Exception handling for socket.error in Python 3.5/RStudio shaunak.bangale@gmail.com - 2016-02-05 13:57 -0800
Re: Exception handling for socket.error in Python 3.5/RStudio Chris Angelico <rosuav@gmail.com> - 2016-02-06 08:57 +1100
Re: Exception handling for socket.error in Python 3.5/RStudio shaunak.bangale@gmail.com - 2016-02-05 14:35 -0800
Re: Exception handling for socket.error in Python 3.5/RStudio Chris Angelico <rosuav@gmail.com> - 2016-02-06 13:04 +1100
Re: Exception handling for socket.error in Python 3.5/RStudio Shaunak Bangale <shaunak.bangale@gmail.com> - 2016-02-05 13:50 -0700
Re: Exception handling for socket.error in Python 3.5/RStudio Shaunak Bangale <shaunak.bangale@gmail.com> - 2016-02-05 14:00 -0700
Re: Exception handling for socket.error in Python 3.5/RStudio Shaunak Bangale <shaunak.bangale@gmail.com> - 2016-02-05 14:15 -0700
Re: Exception handling for socket.error in Python 3.5/RStudio dieter <dieter@handshake.de> - 2016-02-07 09:23 +0100
Re: Exception handling for socket.error in Python 3.5/RStudio shaunak.bangale@gmail.com - 2016-02-08 00:04 -0800
Re: Exception handling for socket.error in Python 3.5/RStudio shaunak.bangale@gmail.com - 2016-02-19 10:07 -0800
csiph-web