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


Groups > linux.debian.maint.python > #11419

Re: AttributeError: module 'socket' has no attribute 'timeout'

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Alexandros Afentoulis <alexaf@bloom.re>
Newsgroups linux.debian.maint.python
Subject Re: AttributeError: module 'socket' has no attribute 'timeout'
Date Thu, 25 Apr 2019 10:20:01 +0200
Message-ID <xQHLP-3OM-1@gated-at.bofh.it> (permalink)
References <xQGZr-3fY-3@gated-at.bofh.it>
X-Mailbox-Line From debian-python-request@lists.debian.org Thu Apr 25 08:18:43 2019
Old-Return-Path <alexaf@bloom.re>
X-Amavis-Spam-Status No, score=-7 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, LDO_WHITELIST=-5] autolearn=ham autolearn_force=no
X-Policyd-Weight using cached result; rate: -4.6
X-Greylist delayed 642 seconds by postgrey-1.36 at bendel; Thu, 25 Apr 2019 08:18:31 UTC
MIME-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Language en-US
Content-Transfer-Encoding 8bit
Authentication-Results ORIGINATING; auth=pass smtp.auth=alexaf@bloom.re smtp.mailfrom=alexaf@bloom.re
X-Mailing-List <debian-python@lists.debian.org> archive/latest/16893
List-ID <debian-python.lists.debian.org>
List-URL <https://lists.debian.org/debian-python/>
List-Archive https://lists.debian.org/msgid-search/eaef9e87-bffd-efad-cd0e-dae92ef444b5@bloom.re
Approved robomod@news.nic.it
Lines 26
Organization linux.* mail to news gateway
Sender robomod@news.nic.it
X-Original-Date Thu, 25 Apr 2019 11:07:45 +0300
X-Original-Message-ID <eaef9e87-bffd-efad-cd0e-dae92ef444b5@bloom.re>
X-Original-References <CAB+BSg_YBw+a2L2+PnNoM1MWq+6tGgcJ=Eyo_g0ZC_J2sTLEbw@mail.gmail.com>
Xref csiph.com linux.debian.maint.python:11419

Show key headers only | View raw


On 4/25/19 10:04 AM, Artem Golubev wrote:
> Hello,  I’m using python3.5, python3.7 on Debian 9 stretch
> This is my code:

[snip]

> 
> When I execute my code I receive this error
> 
> ***************
> Traceback (most recent call last):
>    File "/root/python/projects/test/socket.py", line 7, in <module>
>      sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> AttributeError: module 'socket' has no attribute 'AF_INET'
> 

Hi,

the problem is you've named your file 'socket', and that precedes the 
python module 'socket' when importing. Try renaming it.

Since your question is not specific to debian python packaging though, 
it would be probably better to ask elsewhere, e.g. 
https://stackoverflow.com/

Cheers

Back to linux.debian.maint.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

AttributeError: module 'socket' has no attribute 'timeout' Artem Golubev <agolubev.n@gmail.com> - 2019-04-25 09:30 +0200
  Re: AttributeError: module 'socket' has no attribute 'timeout' Alexandros Afentoulis <alexaf@bloom.re> - 2019-04-25 10:20 +0200
  Re: AttributeError: module 'socket' has no attribute 'timeout' Neil Williams <codehelp@debian.org> - 2019-04-25 10:20 +0200

csiph-web