Skip to content

Removed deprecation warnings#358

Merged
pganssle merged 1 commit intodateutil:masterfrom
thierryba:master
Apr 17, 2017
Merged

Removed deprecation warnings#358
pganssle merged 1 commit intodateutil:masterfrom
thierryba:master

Conversation

@thierryba
Copy link
Copy Markdown
Contributor

No description provided.

@pganssle
Copy link
Copy Markdown
Member

@thierryba @jdufresne What deprecation warnings is this removing? I'm not seeing any warnings in the CI for other PRs, nor in my own instance of python 3.6.

I'm not really opposed to these changes either way, but I can't replicate the issue.

@pganssle pganssle added this to the 2.6.1 milestone Apr 17, 2017
@jdufresne
Copy link
Copy Markdown
Contributor

Take a look at the release notes for Python 3.6:

https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior

A backslash-character pair that is not a valid escape sequence now generates a DeprecationWarning. Although this will eventually become a SyntaxError, that will not be for several Python releases. (Contributed by Emanuel Barry in bpo-27364.)

@jdufresne
Copy link
Copy Markdown
Contributor

jdufresne commented Apr 17, 2017

@pganssle I too was having trouble consistently reproducing the warnings, so I dug into this a bit deeper. It looks like something with __pycache__ means that the warnings will only appears sometimes. I'm going to follow through with a bug report to python.org about it. In the mean time, you can consisently see the warnings by using the following script from a checkout of the master branch. WARNING: Script will run git clean -dxff and could remove unsaved work.

#!/bin/bash

set -e
set -x

git clean -dxff

ROOT=$(git rev-parse --show-toplevel)
NAME=$(basename ${ROOT})

VENV=~/.venv/${NAME}
rm -rf ${VENV}
python36 -m venv ${VENV}
. ${VENV}/bin/activate
python -b -Wall setup.py test

After running this, I see the following at the top of my test output:

.../dateutil/dateutil/tz/win.py:197: DeprecationWarning: invalid escape sequence \{
  tzkeyname = text_type("{kn}\{name}").format(kn=TZKEYNAME, name=name)
.../dateutil/dateutil/tz/win.py:247: DeprecationWarning: invalid escape sequence \{
  tzkeyname = text_type('{kn}\{sn}').format(kn=TZKEYNAME,
.../dateutil/dateutil/parser.py:50: DeprecationWarning: invalid escape sequence \.
  _split_decimal = re.compile("([\.,])")

@jdufresne
Copy link
Copy Markdown
Contributor

Python issue: https://bugs.python.org/issue30091

@jdufresne jdufresne mentioned this pull request Apr 17, 2017
@pganssle
Copy link
Copy Markdown
Member

pganssle commented Apr 17, 2017

@jdufresne Ah, interesting. That kinda seems like they are going to make non-backwards-compatible changes to Python at some point in the future, but I'd heard that there "won't be a Python 4.0". I guess we'll see if they break SemVer or the idea of keeping everything on Python 3.

Thanks for the info.

@pganssle pganssle merged commit 7530691 into dateutil:master Apr 17, 2017
@pganssle pganssle mentioned this pull request Jun 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants