[issue12578] Erratic socket.gaierror: [Errno 11004] when using smtplib

2011-07-17 Thread David Ward

New submission from David Ward :

When migrating from python 2.7.1 to 2.7.2 (or 3.2) I get unpredictable /erratic 
exceptions thrown on constucting smtplib.SMTP:

socket.gaierror: [Errno 11004] getaddrinfo failed 

Here is the call stack:

  File "**\mail.py", line 41, in Mail
server = smtplib.SMTP(MAILSERVER)
  File "c:\python27\lib\smtplib.py", line 250, in __init__
(code, msg) = self.connect(host, port)
  File "c:\python27\lib\smtplib.py", line 306, in connect
self.sock = self._get_socket(host, port, self.timeout)
  File "c:\python27\lib\smtplib.py", line 284, in _get_socket
return socket.create_connection((host, port), timeout)
  File "c:\python27\lib\socket.py", line 380, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
socket.gaierror: [Errno 11004] getaddrinfo failed

MAILSERVER is a local address. There are no known DNS issues on our local 
network. 

If I try to reduce the code to a small repro (e.g. sending mail in a loop or 
calling getaddrinfo), I cannot reproduce the problem.

This code had worked unchanged for many years and many previous python releases 
all the way back to 2.3.

Platform is Windows 7 x64, AMD64 build of python 2.7.2 (or 3.2).

Reverting back to 2.7.1 solves the problem.

--
components: Library (Lib)
messages: 140525
nosy: David.Ward
priority: normal
severity: normal
status: open
title: Erratic socket.gaierror: [Errno 11004] when using smtplib
type: behavior
versions: Python 2.7

___
Python tracker 
<http://bugs.python.org/issue12578>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25187] bdist_rpm fails due to wrong hardcoded assumption about RPM filename format

2015-09-19 Thread David Ward

New submission from David Ward:

bdist_rpm wrongly assumes a hard-coded format for the filename of the 
non-source RPM which is generated when it calls rpmbuild, specifically:
"%{arch}/%{name}-%{version}-%{release}.%{arch}.rpm"

The format used by rpmbuild is actually specified by the RPM macro 
%{_rpmfilename}. With the /usr/lib/rpm/macros file that is shipped with 
official releases of RPM (at http://rpm.org), %{_rpmfilename} evaluates to the 
value above. However this value cannot be assumed: the directory "%{arch}/" is 
dropped under the Mock chroot environment 
(https://fedoraproject.org/wiki/Mock). Mock is used to build all official 
Fedora Project packages (by Koji) as well as unofficial packages (by Copr). 
These two build systems also target Extra Packages for Enterprise Linux (EPEL) 
in addition to Fedora releases.

As a result, bdist_rpm fails when trying to move the non-source RPM to the 
'dist' folder after it is built by rpmbuild.

The attached patch causes bdist_rpm to evaluate "%{_rpmfilename}" instead of 
relying on the hard-coded value.

--
components: Distutils
files: python-bdist_rpm-evaluate-_rpmfilename.patch
keywords: patch
messages: 251136
nosy: dpward, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: bdist_rpm fails due to wrong hardcoded assumption about RPM filename 
format
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: 
http://bugs.python.org/file40523/python-bdist_rpm-evaluate-_rpmfilename.patch

___
Python tracker 
<http://bugs.python.org/issue25187>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25187] bdist_rpm fails due to wrong hardcoded assumption about RPM filename format

2016-04-10 Thread David Ward

David Ward added the comment:

Ping to review patch please...

--

___
Python tracker 
<http://bugs.python.org/issue25187>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25187] bdist_rpm fails due to wrong hardcoded assumption about RPM filename format

2016-04-11 Thread David Ward

David Ward added the comment:

Please review this revised patch. Thank you.

--
Added file: 
http://bugs.python.org/file42432/python-bdist_rpm-evaluate-_rpmfilename.patch

___
Python tracker 
<http://bugs.python.org/issue25187>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25627] distutils : file "bdist_rpm.py" does not quote filenames when executing the rpm command

2016-04-11 Thread David Ward

David Ward added the comment:

This revised patch has a small change so that the subprocess output is decoded 
from a byte sequence to a string, which is necessary when running this under 
Python 3.

With this change, this worked for me on Fedora 23 with Python 3.4.3.

It also worked on Fedora 23 with Python 2.7.11, but I had to apply the patch by 
hand, because of small differences in the original file as a result of SVN 
revisions 54854 and 57699 for Python 3.0. I also had to add "import subprocess" 
to the top of this file.

--
nosy: +dpward
Added file: http://bugs.python.org/file42437/issue25627_6.diff

___
Python tracker 
<http://bugs.python.org/issue25627>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25187] bdist_rpm fails due to wrong hardcoded assumption about RPM filename format

2016-04-11 Thread David Ward

David Ward added the comment:

Thanks again for your feedback. I revised this patch as requested to conform to 
changes also being made in issue 25627. Please review this new patch.

I tested this successfully under both Python 3.4.3 and Python 2.7.11 on Fedora 
23. Note that "import subprocess" must additionally be added to this file for 
Python 2.7, after applying this patch and/or the one in issue 25627. (I also 
tested this successfully with the latest patch from both issues applied at the 
same time.)

--
Added file: 
http://bugs.python.org/file42438/python-bdist_rpm-evaluate-_rpmfilename.patch

___
Python tracker 
<http://bugs.python.org/issue25187>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com