[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] uic triggering DeprecationWarning for 'U' universal newlines mode
From:       Phil Thompson <phil () riverbankcomputing ! com>
Date:       2018-10-26 9:06:26
Message-ID: 0C1B5BF4-E731-496A-9608-5FC2FBE7AAC1 () riverbankcomputing ! com
[Download RAW message or body]

On 25 Oct 2018, at 9:41 pm, Kyle Altendorf <sda@fstab.net> wrote:
> 
> Phil,
> 
> I'm getting a bunch of deprecation warnings from uic.  Could we remove the 'U' \
> specification for open()? 
> https://ci.appveyor.com/project/KyleAltendorf/stlib/builds/19797968#L20879
> 
> c:\projects\stlib\venv\lib\site-packages\PyQt5\uic\objcreator.py:152: \
> DeprecationWarning: 'U' mode is deprecated plugin = open(filename, 'rU')
> 
> 
> https://docs.python.org/3/library/functions.html#open
> > Deprecated since version 3.4, will be removed in version 4.0: The 'U' mode.
> 
> My impression is that this is likely a carry-over from py2 and that in py3 it's \
> default and controlled by the newline parameter to open() anyways.  I forget where \
> PyQt5 stands at the moment on py2 support but even if that's still required \
> something like the following shouldn't be too intrusive. 
> plugin = open(filename, 'r' if sys.version_info >= (3,) else 'rU')
> 
> Thanks for any consideration.  For now I'll filter them.
> 
> https://docs.pytest.org/en/latest/warnings.html#deprecationwarning-and-pendingdeprecationwarning
> 

It should be Ok to just remove the second argument completely.

Thanks,
Phil
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic