Skip to content

Commit

Permalink
Merge pull request #33 from zopefoundation/appveyor
Browse files Browse the repository at this point in the history
Add an appveyor.yml
  • Loading branch information
mgedmin committed Aug 21, 2020
2 parents 676dac6 + 28fe9af commit 21435c7
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 3 deletions.
5 changes: 3 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
5.2 (unreleased)
================

- Nothing changed yet.
- Fix TypeError: 'error' object is not subscriptable during error handling on
Windows (`#33 <https://github.com/zopefoundation/zope.sendmail/pull/33>`_).


5.1 (2020-07-31)
================

- Use ``pywin32`` again, not any longer the meanwhile outdated fork named ``pypiwin32``.
Add some information for installation with buildout.
(`#30 <https://github.com/zopefoundation/zope.sendmail/blob/master/docs/usage.rst>`_)
(`#30 <https://github.com/zopefoundation/zope.sendmail/issues/30>`_)

- Support ``bytes`` messages; consistently convert messages
using a "text" type (i.e. ``str`` for Python 3, ``unicode`` for Python 2)
Expand Down
35 changes: 35 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
environment:

matrix:
- python: 27
- python: 27-x64
- python: 35
- python: 35-x64
- python: 36
- python: 36-x64
- python: 37
- python: 37-x64
- python: 38
- python: 38-x64

install:
- "SET PATH=C:\\Python%PYTHON%;c:\\Python%PYTHON%\\scripts;%PATH%"
- ps: |
$env:PYTHON = "C:\\Python${env:PYTHON}"
if (-not (Test-Path $env:PYTHON)) {
curl -o install_python.ps1 https://raw.githubusercontent.com/matthew-brett/multibuild/11a389d78892cf90addac8f69433d5e22bfa422a/install_python.ps1
.\install_python.ps1
}
- ps: if (-not (Test-Path $env:PYTHON)) { throw "No $env:PYTHON" }
- echo "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 > "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\vcvars64.bat"
- python -m pip install -U pip
- pip install -U setuptools
- pip install -U -e .[test]

build: false

test_script:
- zope-testrunner --test-path=src

on_success:
- echo Build succesful!
8 changes: 7 additions & 1 deletion src/zope/sendmail/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@
import sys
if sys.platform == 'win32': # pragma: no cover
import win32file
import winerror
import pywintypes

def _os_link(src, dst):
return win32file.CreateHardLink(dst, src, None)
else:
_os_link = os.link
pywintypes = None

try:
import ConfigParser as configparser
Expand Down Expand Up @@ -269,7 +272,10 @@ def _process_one_file(self, filename):
return
# XXX: Silently ignoring all other errno
except Exception as e: # pragma: no cover
if e[0] == 183 and e[1] == 'CreateHardLink':
if (pywintypes is not None
and isinstance(e, pywintypes.error)
and e.funcname == 'CreateHardLink'
and e.winerror == winerror.ERROR_ALREADY_EXISTS):
# file exists, win32
return
# XXX: Silently ignoring all other causes here.
Expand Down

0 comments on commit 21435c7

Please sign in to comment.