[issue30091] DeprecationWarning: invalid escape sequence: Only appears on first run

2017-04-17 Thread Jon Dufresne
New submission from Jon Dufresne: After upgrading to Python 3.6, I'm working towards cleaning up "DeprecationWarning: invalid escape sequence". I've noticed that the Deprecation warning only appears on the first run. It looks like once the code is compiled to `__pycache

[issue30091] DeprecationWarning: invalid escape sequence: Only appears on first run

2017-04-17 Thread Jon Dufresne
Jon Dufresne added the comment: I see. I think if the goal is for developers to see and fix these DeprecationWarnings, it would help if the warnings were reproducible without taking steps different from normal Python development. TBH, this is the first time I've ever used the -B CLI arg

[issue30091] DeprecationWarning: invalid escape sequence: Only appears on first run

2017-04-17 Thread Jon Dufresne
Jon Dufresne added the comment: Understood. Thanks for the response. I'll have to keep this in mind as I debug these warnings in the future. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python

[issue30296] Remove unnecessary tuples, lists, sets, and dicts from Lib

2017-05-07 Thread Jon Dufresne
New submission from Jon Dufresne: Lib has some patterns that could be easily discovered and cleaned up. Doing so will reduce the number of unnecessary temporary lists in memory and unnecessary function calls. It will also take advantage of Python's own rich features in a way that bette

[issue28867] NamedTemporaryFile does not generate a ResourceWarning for unclosed files (unlike TemporaryFile)

2017-06-03 Thread Jon Dufresne
Changes by Jon Dufresne : -- pull_requests: +2015 ___ Python tracker <http://bugs.python.org/issue28867> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36743] Docs: Descript __get__ signature defined differently across the docs

2019-04-27 Thread Jon Dufresne
New submission from Jon Dufresne : Here: https://docs.python.org/3/reference/datamodel.html#object.__get__ The __get__ signature is defined as: object.__get__(self, instance, owner) But here: https://docs.python.org/3/howto/descriptor.html#descriptor-protocol It is defined as: descr

[issue28867] NamedTemporaryFile does not generate a ResourceWarning for unclosed files (unlike TemporaryFile)

2016-12-04 Thread Jon Dufresne
New submission from Jon Dufresne: When using unittest, I'll frequently enable -Wall to help catch code smells and potential bugs. One feature of this, I'm told when files aren't explicitly closed with an error like: "ResourceWarning: unclosed file <...>"

[issue28867] NamedTemporaryFile does not generate a ResourceWarning for unclosed files (unlike TemporaryFile)

2016-12-06 Thread Jon Dufresne
Changes by Jon Dufresne : -- keywords: +patch Added file: http://bugs.python.org/file45783/namedtemporaryfile-resourcewarning.patch ___ Python tracker <http://bugs.python.org/issue28

[issue28867] NamedTemporaryFile does not generate a ResourceWarning for unclosed files (unlike TemporaryFile)

2016-12-07 Thread Jon Dufresne
Jon Dufresne added the comment: Thanks for the review. I have updated the patch. Now all warnings during tests handled. Please let me know if there are any other concerns with the changes. -- Added file: http://bugs.python.org/file45789/namedtemporaryfile-resourcewarning-2.patch

[issue28867] NamedTemporaryFile does not generate a ResourceWarning for unclosed files (unlike TemporaryFile)

2016-12-07 Thread Jon Dufresne
Jon Dufresne added the comment: Just for some context, the e.close() is handling this bit of code: https://github.com/python/cpython/blob/d8132c4da7c46587221c5a244224b770d03860b6/Lib/urllib/request.py#L739-L754 When there is no error, http_error_302() will close the passed fp, on error, it

[issue28867] NamedTemporaryFile does not generate a ResourceWarning for unclosed files (unlike TemporaryFile)

2016-12-11 Thread Jon Dufresne
Jon Dufresne added the comment: I've taken a new approach to resolve the urllib issues. I believe HTTPError _should not_ warn when __del__ is called as HTTPError wraps an existing resource instead of generating its own. IIUC, in this case, I believe it falls to the responsibility of

[issue28867] NamedTemporaryFile does not generate a ResourceWarning for unclosed files (unlike TemporaryFile)

2016-12-11 Thread Jon Dufresne
Jon Dufresne added the comment: I decided to try a new direction. Instead of modifying _TemporaryFileCloser to handle urllib, I've changed urllib classes to not inherit from _TemporaryFileCloser. The urllib classes are not temporary files as built by tempfile, so I believe this makes

[issue23171] csv.writer.writerow() does not accept generator (must be coerced to list)

2015-01-05 Thread Jon Dufresne
New submission from Jon Dufresne: The csv.writer.writerow() does not accept a generator as input. I find this counter-intuitive and against the spirit of similar APIs. If the generator is coerced to a list, everything works as expected. See the following test script which fails on the line

[issue23171] csv.writer.writerow() does not accept generator (must be coerced to list)

2015-01-05 Thread Jon Dufresne
Jon Dufresne added the comment: I have created an initial patch such that writerow() now allows generators. I have also added a unit test to demonstrate the fix. The code now coerces iterators (and generators) to a list, then operates on the result. I would have preferred to simply iterate

[issue23178] csv.reader does not handle BOM

2015-01-06 Thread Jon Dufresne
New submission from Jon Dufresne: The following test script demonstrates that Python's csv library does not handle a BOM. I would expect the returned row to be equal to expected and to print 'True' to stdout. In the wild, it is typical for other CSV writers to add a B

[issue7651] Python3: guess text file charset using the BOM

2015-01-07 Thread Jon Dufresne
Changes by Jon Dufresne : -- nosy: +jdufresne ___ Python tracker <http://bugs.python.org/issue7651> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23250] http.cookies HttpOnly attribute does not use suggested case-style of HTTP standard

2015-01-16 Thread Jon Dufresne
New submission from Jon Dufresne: See http://tools.ietf.org/html/rfc6265#section-5.2.6 Relevant section: --- 5.2.6. The HttpOnly Attribute If the attribute-name case-insensitively matches the string HttpOnly", the user agent MUST append an attribute to the cookie-attribute-list wi

[issue23250] http.cookies HttpOnly attribute does not use suggested case-style of HTTP standard

2015-01-16 Thread Jon Dufresne
Changes by Jon Dufresne : -- keywords: +patch Added file: http://bugs.python.org/file37729/http-only-case.patch ___ Python tracker <http://bugs.python.org/issue23

[issue23277] Cleanup unused and duplicate imports in tests

2015-01-19 Thread Jon Dufresne
New submission from Jon Dufresne: Ran variations of the command: $ find . -wholename '*/test/*.py' | xargs flake8 --select=F401,F811 To look for unused or duplicate imports. The attached patch removes them. -- components: Tests files: cleanup-unused-imports.patch keywo

[issue20361] -W command line options and PYTHONWARNINGS environmental variable should not override -b / -bb command line options

2016-10-19 Thread Jon Dufresne
Changes by Jon Dufresne : -- nosy: +jdufresne ___ Python tracker <http://bugs.python.org/issue20361> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22431] Change format of test runner output

2016-10-19 Thread Jon Dufresne
Changes by Jon Dufresne : -- nosy: +jdufresne ___ Python tracker <http://bugs.python.org/issue22431> ___ ___ Python-bugs-list mailing list Unsubscribe: