This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
标题: Add sethostname()
类型: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.3
process
状态: closed Resolution: fixed
Dependencies: 后续:
分配给: 抄送列表: giampaolo.rodola, loewis, pitrou, rosslagerwall
优先级: normal 关键字: patch

Created on 2011-01-08 08:16 by rosslagerwall, last changed 2022-04-11 14:57 by admin. This issue is now closed.

文件
文件名 上传时间 Description 编辑
sethostname.patch rosslagerwall, 2011-01-08 08:16 Patch + test for issue
sethostname_v2.patch rosslagerwall, 2011-02-26 08:34 simplified
sethostname_v3.patch pitrou, 2011-02-26 12:18
Messages (8)
msg125761 - (view) Author: Ross Lagerwall (rosslagerwall) (Python committer) 日期: 2011-01-08 08:16
This patch adds sethostname to the socket module (since socket has gethostname()).
msg129508 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) 日期: 2011-02-26 08:11
I'm not sure why you use PyTuple_Size() and PyTuple_GetItem().
You should be able to do a first call to PyArg_ParseTuple() (using the "S" specifier to mandate a bytes object), and call PyErr_Clear() and fallback to the second PyArg_ParseTuple() if the first one fails.
msg129511 - (view) Author: Ross Lagerwall (rosslagerwall) (Python committer) 日期: 2011-02-26 08:34
Here is a simplified version.
msg129533 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) 日期: 2011-02-26 12:18
New patch including a check for PyObject_GetBuffer()'s return value, the missing declaration of HAVE_SETHOSTNAME in pyconfig.h.in, and a test for giving a bytes values to the function.
msg129567 - (view) Author: Ross Lagerwall (rosslagerwall) (Python committer) 日期: 2011-02-26 16:07
The patch looks good.

Just to be clear, on my system running "autoreconf" adds the correct stuff to pyconfig.h.in

Isn't it best to leave it up to the committer to generate "configure" and "pyconfig.h.in", especially since different autoconf versions can create a lot of differences?
msg129568 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) 日期: 2011-02-26 16:13
> The patch looks good.
> 
> Just to be clear, on my system running "autoreconf" adds the correct
> stuff to pyconfig.h.in

Ah, strange. I used "autoconf" and it didn't...

> Isn't it best to leave it up to the committer to generate "configure"
> and "pyconfig.h.in", especially since different autoconf versions can
> create a lot of differences?

Right, but in this case the version was the same and it was easier to
create the patch that way.
msg129569 - (view) Author: Ross Lagerwall (rosslagerwall) (Python committer) 日期: 2011-02-26 16:18
> Ah, strange. I used "autoconf" and it didn't...

From the man page of autoreconf:
 Run  `autoconf'  (and  `autoheader', `aclocal', `automake', `autopoint'    
 (formerly `gettextize'), and `libtoolize' where appropriate) repeatedly
 to  remake  the GNU Build System files in the DIRECTORIES or the direc‐
 tory trees driven by CONFIGURE-AC (defaulting to `.').

I guess it autoheader that regenerates pyconfig.h.in
msg129732 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) 日期: 2011-02-28 23:33
Patch committed in r88685 (3.3), closing.
历史
日期 用户 动作 参数
2022-04-11 14:57:11admin修改github: 55075
2011-02-28 23:33:16pitrou修改状态: open -> closed
抄送: loewis, pitrou, giampaolo.rodola, rosslagerwall
消息: + msg129732

resolution: fixed
stage: patch review -> resolved
2011-02-26 16:18:03rosslagerwall修改抄送: loewis, pitrou, giampaolo.rodola, rosslagerwall
消息: + msg129569
2011-02-26 16:13:40pitrou修改抄送: loewis, pitrou, giampaolo.rodola, rosslagerwall
消息: + msg129568
2011-02-26 16:07:34rosslagerwall修改抄送: loewis, pitrou, giampaolo.rodola, rosslagerwall
消息: + msg129567
2011-02-26 12:18:48pitrou修改文件: + sethostname_v3.patch
抄送: loewis, pitrou, giampaolo.rodola, rosslagerwall
消息: + msg129533
2011-02-26 08:34:40rosslagerwall修改文件: + sethostname_v2.patch
抄送: loewis, pitrou, giampaolo.rodola, rosslagerwall
消息: + msg129511
2011-02-26 08:11:04pitrou修改抄送: loewis, pitrou, giampaolo.rodola, rosslagerwall
消息: + msg129508
2011-01-10 17:04:37pitrou修改抄送: + pitrou

type: enhancement
stage: patch review
2011-01-08 08:16:15rosslagerwall创建