[issue10655] Wrong powerpc define in Python/ceval.c
New submission from adrian : In Python/ceval.c is following line: #if defined(__ppc__) /* <- Don't know if this is the correct symbol; this section should work for GCC on any PowerPC platform, irrespective of OS. POWER? Who knows :-) */ which seems wrong and aborts the build on powerpc. Changing it to __powerpc__ fixes it for me. The following output of gcc confirms it: $ gcc -dM -E -x c /tmp/foo.c | grep powerpc #define __powerpc__ 1 #define __powerpc 1 #define powerpc 1 Whereas there are no defines containing "ppc" -- components: Build messages: 123652 nosy: adrian priority: normal severity: normal status: open title: Wrong powerpc define in Python/ceval.c versions: Python 3.1 ___ Python tracker <http://bugs.python.org/issue10655> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10655] Wrong powerpc define in Python/ceval.c
adrian added the comment: Here is a patch that I had to include in my Linux PowerPC build of 2.7 and 3.2 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -31,10 +31,12 @@ typedef unsigned long long uint64; -#if defined(__ppc__) /* <- Don't know if this is the correct symbol; this +#if defined(__ppc__) || defined (__powerpc__) /* <- Don't know if + this is the correct symbol; this section should work for GCC on any PowerPC platform, irrespective of OS. - POWER? Who knows :-) */ + POWER? Who knows :-) + __powerpc__ is necessary for Linux */ #define READ_TIMESTAMP(var) ppc_getcounter(&var) -- ___ Python tracker <http://bugs.python.org/issue10655> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43374] Apple refuses apps written in Python
Adrian added the comment: My apologies, you may disregard any libraries not downloaded from python.org <http://python.org/> I am strictly speaking about the following items related to this mailing list: • Contents/Frameworks/Python.framework/Versions/3.9/lib/libformw.5.dylib/_wadd_wchnstr • Contents/Frameworks/Python.framework/Versions/3.9/lib/libformw.5.dylib/_wins_wch • Contents/Frameworks/Python.framework/Versions/3.9/lib/libformw.5.dylib/_win_wch • Contents/Frameworks/Python.framework/Versions/3.9/lib/libformw.5.dylib/_win_wchnstr • Contents/Frameworks/Python.framework/Versions/3.9/lib/libformw.5.dylib/_win_wchnstr • Contents/Frameworks/Python.framework/Versions/3.9/lib/libpanelw.5.dylib/_SP • Contents/Frameworks/Python.framework/Versions/3.9/lib/libformw.5.dylib/_SP • Contents/Frameworks/Python.framework/Versions/3.9/lib/libformw.5.dylib/___sprintf_chk • Contents/Frameworks/Python.framework/Versions/3.9/lib/libcrypto.1.1.dylib/___sprintf_chk • Contents/Frameworks/Python.framework/Versions/3.9/Python/___sprintf_chk • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawn • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawn_file_actions_addclose • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawn_file_actions_adddup2 • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawn_file_actions_addopen • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawn_file_actions_destroy • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawn_file_actions_init • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawnattr_destroy • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawnattr_init • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawnattr_setflags • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawnattr_setpgroup • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawnattr_setsigdefault • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawnattr_setsigmask • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawnp • Contents/Frameworks/Python.framework/Versions/3.9/lib/libssl.1.1.dylib/___sprintf_chk • Contents/Frameworks/Python.framework/Versions/3.9/lib/libmenuw.5.dylib/_SP • Contents/Frameworks/Python.framework/Versions/3.9/lib/libpanelw.5.dylib/__nc_panelhook • Contents/Frameworks/Python.framework/Versions/3.9/lib/libformw.5.dylib/__nc_wcrtomb All of them are part of Python 3.9 for Mac downloaded from: https://www.python.org/downloads/ <https://www.python.org/downloads/> -- Adrian > On 2 Mar 2021, at 16:54, Ned Deily <mailto:rep...@bugs.python.org>> wrote: > > > Ned Deily mailto:n...@python.org>> added the comment: > >> From where are you getting the Python that you are using in the app? A >> number of those libraries are not part of the python.org >> <http://python.org/> Mac binaries. And are you compiling with c++ by any >> chance? > > -- > > ___ > Python tracker mailto:rep...@bugs.python.org>> > <https://bugs.python.org/issue43374 <https://bugs.python.org/issue43374>> > ___ > -- ___ Python tracker <https://bugs.python.org/issue43374> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43374] Apple refuses apps written in Python
Adrian added the comment: My apologies, you may disregard any libraries not downloaded from python.org <http://python.org/> I am strictly speaking about the following items related to this mailing list: • Contents/Frameworks/Python.framework/Versions/3.9/lib/libformw.5.dylib/_wadd_wchnstr • Contents/Frameworks/Python.framework/Versions/3.9/lib/libformw.5.dylib/_wins_wch • Contents/Frameworks/Python.framework/Versions/3.9/lib/libformw.5.dylib/_win_wch • Contents/Frameworks/Python.framework/Versions/3.9/lib/libformw.5.dylib/_win_wchnstr • Contents/Frameworks/Python.framework/Versions/3.9/lib/libformw.5.dylib/_win_wchnstr • Contents/Frameworks/Python.framework/Versions/3.9/lib/libpanelw.5.dylib/_SP • Contents/Frameworks/Python.framework/Versions/3.9/lib/libformw.5.dylib/_SP • Contents/Frameworks/Python.framework/Versions/3.9/lib/libformw.5.dylib/___sprintf_chk • Contents/Frameworks/Python.framework/Versions/3.9/lib/libcrypto.1.1.dylib/___sprintf_chk • Contents/Frameworks/Python.framework/Versions/3.9/Python/___sprintf_chk • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawn • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawn_file_actions_addclose • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawn_file_actions_adddup2 • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawn_file_actions_addopen • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawn_file_actions_destroy • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawn_file_actions_init • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawnattr_destroy • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawnattr_init • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawnattr_setflags • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawnattr_setpgroup • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawnattr_setsigdefault • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawnattr_setsigmask • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawnp • Contents/Frameworks/Python.framework/Versions/3.9/lib/libssl.1.1.dylib/___sprintf_chk • Contents/Frameworks/Python.framework/Versions/3.9/lib/libmenuw.5.dylib/_SP • Contents/Frameworks/Python.framework/Versions/3.9/lib/libpanelw.5.dylib/__nc_panelhook • Contents/Frameworks/Python.framework/Versions/3.9/lib/libformw.5.dylib/__nc_wcrtomb All of them are part of Python 3.9 for Mac downloaded from: https://www.python.org/downloads/ <https://www.python.org/downloads/> -- Adrian > On 2 Mar 2021, at 16:54, Ned Deily wrote: > > > Ned Deily added the comment: > >> From where are you getting the Python that you are using in the app? A >> number of those libraries are not part of the python.org Mac binaries. And >> are you compiling with c++ by any chance? > > -- > > ___ > Python tracker > <https://bugs.python.org/issue43374> > ___ > -- ___ Python tracker <https://bugs.python.org/issue43374> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43374] Apple refuses apps written in Python
Adrian added the comment: Hi Ned, I have a ticket opened with Apple. They refuse the software as it, they are in a position of absolute power, to reject and drop many years of work on a dime. What am I suppose to do? I can fix my own software, but then there are dependencies like Python itself. Hence my question on this forum. I don’t expect miracles or people doing works for free for me to solve my problem. I think I am not the only one confronted with this problem, Python has a pretty large installed base. I am looking for practical suggestions. Regards, Adrian > On 2 Mar 2021, at 18:20, Ned Deily wrote: > > > Ned Deily added the comment: > > BTW, if you haven't already, I would strongly suggest you ask on one of the > Apple Developer Forums. My first guess is that the App Store validation > process is trying to incorrectly apply rules to your local Python framework > (from the Python.org installed framework). But that's just a guess at this > point. > > -- > > ___ > Python tracker > <https://bugs.python.org/issue43374> > ___ > -- ___ Python tracker <https://bugs.python.org/issue43374> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43374] Apple refuses apps written in Python
Adrian added the comment: Hi Ned, Yes, I have submitted Python apps to Mac App Store since 2009, for 12 years. Each new push opens a new pandoras box with different questions asked than previously. There is no learning curve, is just walls with more walls behind each submission. The official reasoning behind all these controls is more security for end-users at the cost of less and less freedom for developers. The app is a the result of the collaboration effort of many people and years of IETF works related to standards based real-time communications. Two years ago we almost dropped the app because of almost impossible to solve issues raised by Apple. In the last year we spent many efforts to see if and how we can still comply with the more and more authoritarian demands of Apple to keep these works alive. I resigned myself to the thought that at some point we will hit a unsolvable issue, I just hope is not this one and now. Adrian > On 2 Mar 2021, at 18:36, Ned Deily wrote: > > > Ned Deily added the comment: > >> What am I suppose to do? > > I appreciate that it's a nasty problem. Unfortunately, this is unknown > territory for me: I have no experience with the Mac App Store and this is the > first time I've run across a report like this. So the question again is: what > has changed? Were you able to successfully submit Python apps before? If so, > exactly what version worked and what version is failing now/ There are some > differences in how we have and are now building the Mac binaries for the > python.org installers. But I'm working blind here. Perhaps some other > people have experience with this. > > -- > > ___ > Python tracker > <https://bugs.python.org/issue43374> > ___ > -- ___ Python tracker <https://bugs.python.org/issue43374> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43374] Apple refuses apps written in Python
New submission from Adrian : My company maintains several Python related projects, one of them being an application published for many years in the Mac App Store. During the submittion of the last update for the app, we were refused by Apple to publish the software with the following reason: Guideline 2.5.1 - Performance Your app links against the following non-public framework(s): • Contents/Frameworks/Python.framework/Versions/3.9/lib/libformw.5.dylib/_wadd_wchnstr • Contents/Frameworks/Python.framework/Versions/3.9/lib/libformw.5.dylib/_wins_wch • Contents/Frameworks/Python.framework/Versions/3.9/lib/libformw.5.dylib/_win_wch • Contents/Frameworks/Python.framework/Versions/3.9/lib/libformw.5.dylib/_win_wchnstr • Contents/Frameworks/Python.framework/Versions/3.9/lib/libformw.5.dylib/_win_wchnstr • Contents/Frameworks/libpython3.9.dylib/___sprintf_chk • Contents/Frameworks/libpython3.9.dylib/_posix_spawn • Contents/Frameworks/libpython3.9.dylib/_posix_spawn_file_actions_addclose • Contents/Frameworks/libpython3.9.dylib/_posix_spawn_file_actions_adddup2 • Contents/Frameworks/libpython3.9.dylib/_posix_spawn_file_actions_addopen • Contents/Frameworks/libpython3.9.dylib/_posix_spawn_file_actions_destroy • Contents/Frameworks/libpython3.9.dylib/_posix_spawn_file_actions_init • Contents/Frameworks/libpython3.9.dylib/_posix_spawnattr_destroy • Contents/Frameworks/libpython3.9.dylib/_posix_spawnattr_init • Contents/Frameworks/libpython3.9.dylib/_posix_spawnattr_setflags • Contents/Frameworks/libpython3.9.dylib/_posix_spawnattr_setpgroup • Contents/Frameworks/libpython3.9.dylib/_posix_spawnattr_setsigdefault • Contents/Frameworks/libpython3.9.dylib/_posix_spawnattr_setsigmask • Contents/Frameworks/libpython3.9.dylib/_posix_spawnp • Contents/Frameworks/libcrypto.1.1.dylib/___sprintf_chk • Contents/Frameworks/libp11-kit.0.dylib/___sprintf_chk • Contents/Frameworks/Python.framework/Versions/3.9/lib/libpanelw.5.dylib/_SP • Contents/Frameworks/Python.framework/Versions/3.9/lib/libformw.5.dylib/_SP • Contents/Frameworks/Python.framework/Versions/3.9/lib/libformw.5.dylib/___sprintf_chk • Contents/Frameworks/libmpfr.6.dylib/___sprintf_chk • Contents/Frameworks/libgnutls.30.dylib/___sprintf_chk • Contents/Frameworks/libgnutls.30.dylib/_p11_kit_space_strdup • Contents/Frameworks/libgnutls.30.dylib/_p11_kit_space_strlen • Contents/Frameworks/libidn2.0.dylib/_sprintf • Contents/Frameworks/libx264.157.dylib/___sprintf_chk • Contents/Frameworks/Python.framework/Versions/3.9/lib/libcrypto.1.1.dylib/___sprintf_chk • Contents/Frameworks/libssl.1.1.dylib/___sprintf_chk • Contents/Frameworks/libxml2.2.dylib/___sprintf_chk • Contents/Frameworks/Python.framework/Versions/3.9/Python/___sprintf_chk • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawn • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawn_file_actions_addclose • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawn_file_actions_adddup2 • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawn_file_actions_addopen • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawn_file_actions_destroy • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawn_file_actions_init • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawnattr_destroy • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawnattr_init • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawnattr_setflags • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawnattr_setpgroup • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawnattr_setsigdefault • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawnattr_setsigmask • Contents/Frameworks/Python.framework/Versions/3.9/Python/_posix_spawnp • Contents/Frameworks/Python.framework/Versions/3.9/lib/libssl.1.1.dylib/___sprintf_chk • Contents/Frameworks/libhogweed.6.dylib/_nettle_buffer_space • Contents/Frameworks/libicui18n.67.dylib/_sprintf • Contents/Frameworks/Python.framework/Versions/3.9/lib/libmenuw.5.dylib/_SP • Contents/Frameworks/libavfilter.7.dylib/_avformat_match_stream_specifier • Contents/Frameworks/libmpc.3.dylib/___sprintf_chk • Contents/Frameworks/libunistring.2.dylib/___sprintf_chk • Contents/Frameworks/libunistring.2.dylib/_sprintf • Contents/Frameworks/Python.framework/Versions/3.9/lib/libpanelw.5.dylib/__nc_panelhook • Contents/Frameworks/Python.framework/Versions/3.9/lib/libformw.5.dylib/__nc_wcrtomb Next Steps The use of non-public APIs is not permitted on the App Store as it can lead to a poor user experience should these APIs change. -- components: C API, Interpreter Core, macOS messages: 387947 nosy: adigeo, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: Apple refuses apps written in Python type: security versions: Python 3.9 ___ Python tracker
[issue43374] Apple refuses apps written in Python
Adrian added the comment: Terry, After opening issues on this and other mailing lists (PyObjc) Apple validated our app without a comment. Adrian > On 5 Mar 2021, at 21:51, Terry J. Reedy wrote: > > > Terry J. Reedy added the comment: > > Adrian, when responding by email, please delete the copy of the email you are > responding to, except maybe a line or two, as it is redundant when posted on > the web page. -- ___ Python tracker <https://bugs.python.org/issue43374> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33017] Special set-cookie setting will bypass Cookielib
Adrian Chaves added the comment: So, PoC shows how an empty domain attribute (Domain=) is erroneously turned into a dot (.). I want to add that a dot (Domain=.) should be turned into an empty string (the specification asks to remove a leading dot if found). -- nosy: +adrian2 ___ Python tracker <https://bugs.python.org/issue33017> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31242] Add SSLContext.set_verify_callback()
Change by Adrian Freund : -- nosy: +freundTech ___ Python tracker <https://bugs.python.org/issue31242> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31242] Add SSLContext.set_verify_callback()
Change by Adrian Freund : -- keywords: +patch pull_requests: +29536 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/31391 ___ Python tracker <https://bugs.python.org/issue31242> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46779] Add ssl.CERT_REQUIRED_NO_VERIFY as possible value for ssl.SSLContext.verify_mode
New submission from Adrian Freund : Some networked applications might require connecting to client with invalid certificates but still requiring the client to send a certificate. ssl.SSLContext.verify_mode currently supports the following options: ssl.CERT_NONE: Don't require the client to send a certificate and don't validate it if they send one anyways. ssl.CERT_OPTIONAL: Don't require the client to send a certificate but validate it if they send one. ssl.CERT_REQUIRED: Require the client to send a certificate and validate it. There is currently no option for servers that want to require the client to send a certificate but don't validate it. This would for example be needed it a server should accept clients with self-signed certificates and then store their certificates to recognize them again later. A concrete example is the KDEConnect protocol. An alternative solution would be bpo-31242. That would also solve this problem is a more general, but also more complicated way. I think that the solution proposed here this issue is better for it's simplicity and also solves most usecases for bpo-31242. Note that a ssl.CERT_REQUIRED_NO_VERIFY was already proposed in bpo-18293, but that issue was closed because it was specifically in relation to a deprecated api. The mentioned values are however also used in modern asyncio apis. -- assignee: christian.heimes components: SSL messages: 413416 nosy: christian.heimes, freundTech priority: normal severity: normal status: open title: Add ssl.CERT_REQUIRED_NO_VERIFY as possible value for ssl.SSLContext.verify_mode type: enhancement versions: Python 3.11 ___ Python tracker <https://bugs.python.org/issue46779> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31242] Add SSLContext.set_verify_callback()
Adrian Freund added the comment: I also need this feature for something I'm working on, so I looked into it a bit and pushed a small proof of concept implementation to GitHub (See PR 31391). I'm not sure if I'll have enough time to finish and clean up this implementation, but at least there is a starting point. I also opened bpo-46779 as a simpler method to solve most of the usecases that would be solved by this api. -- versions: +Python 3.11 -Python 3.8 ___ Python tracker <https://bugs.python.org/issue31242> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1001] 2to3 crashes on input files with no trailing newlines
Changes by Adrian Holovaty: -- components: Demos and Tools severity: normal status: open title: 2to3 crashes on input files with no trailing newlines type: crash __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1001> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1001] 2to3 crashes on input files with no trailing newlines
New submission from Adrian Holovaty: The 2to3 Python 3k migration utility crashes with the following traceback on any input file that does *not* have a trailing newline. It doesn't seem to matter whether the input file needs modifications or not. RefactoringTool: Can't parse /path/to/testing2.py: ParseError: bad input: type=0, value='', context=('\n', (2, 0)) RefactoringTool: No files need to be modified. RefactoringTool: There was 1 error: RefactoringTool: Can't parse /path/to/testing2.py: ParseError: bad input: type=0, value='', context=('\n', (2, 0)) -- nosy: +adrianholovaty __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1001> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1001] 2to3 crashes on input files with no trailing newlines
Adrian Holovaty added the comment: (Sorry, the previous error snippet isn't a traceback as I had said. It's the error text.) __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1001> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1034] [patch] Add 2to3 support for displaying warnings as Python comments
New submission from Adrian Holovaty: Per a Python-3000 mailing list discussion here -- http://mail.python.org/pipermail/python-3000/2007-August/009835.html -- I have implemented an addition to the 2to3 utility that enables warnings to be output as comments in Python source code instead of being logged to stdout. See the attached patch and a description of the changes here: http://mail.python.org/pipermail/python-3000/2007-August/009881.html -- components: Demos and Tools files: 2to3_insert_comment.diff messages: 55331 nosy: adrianholovaty severity: normal status: open title: [patch] Add 2to3 support for displaying warnings as Python comments __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1034> __ 2to3_insert_comment.diff Description: Binary data ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1034] [patch] Add 2to3 support for displaying warnings as Python comments
Adrian Holovaty added the comment: I'm also attaching 2to3_comment_warnings.diff, which is an example of how we could integrate the insert_comment() method from the first patch to replace the current functionality of fixes.basefix.BaseFix.warning(). __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1034> __ 2to3_comment_warnings.diff Description: Binary data ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1001] 2to3 crashes on input files with no trailing newlines
Adrian Holovaty added the comment: I just checked, and, yes, it's been fixed. __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1001> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9708] cElementTree iterparse does not support "parser" argument
New submission from Adrian Nye : The (python) ElementTree library began in 2.7 to support the "parser" argument, but cElementTree does not support it. Either cElementTree should support it, or the documentation should mention that it does not. -- components: XML messages: 115173 nosy: adrian_nye priority: normal severity: normal status: open title: cElementTree iterparse does not support "parser" argument versions: Python 2.7 ___ Python tracker <http://bugs.python.org/issue9708> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10605] ElementTree documentation
New submission from Adrian Nye : TreeBuilder doc does not mention its "entity" argument which is the main way to deal with html entity encodings which are unfortunately a common problem in XML. Also the doc needs a discussion of the relationship of TreeBuilder and XMLParser. The former has "entity", and the latter has "encoding", but what happens is you need both? Needs examples of using these two classes. -- components: XML messages: 123076 nosy: adrian_nye priority: normal severity: normal status: open title: ElementTree documentation type: feature request versions: Python 2.7 ___ Python tracker <http://bugs.python.org/issue10605> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9234] argparse: aliases for positional arguments (subparsers)
Adrian Sampson added the comment: Thanks for the pointer, Éric. Here's a quick patch that integrates the same functionality into the existing subparser class. -- keywords: +patch Added file: http://bugs.python.org/file20026/argparse-aliases.patch ___ Python tracker <http://bugs.python.org/issue9234> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9234] argparse: aliases for positional arguments (subparsers)
Adrian Sampson added the comment: Sorry I'm slow. Here's a new patch that includes tests. I'll also write documentation if that would be helpful, although I'm not very familiar with the style recommendations. -- Added file: http://bugs.python.org/file20034/argparse-aliases.patch ___ Python tracker <http://bugs.python.org/issue9234> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9234] argparse: aliases for positional arguments (subparsers)
Adrian Sampson added the comment: Great. I've added a simple example to the documentation for argparse. I also added a space to the comma separator in the alias list, but I'm worried that adding 'aliases:' will make the help less readable (especially if every command in a long list has aliases). -- Added file: http://bugs.python.org/file20073/argparse-aliases.patch ___ Python tracker <http://bugs.python.org/issue9234> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9234] argparse: aliases for positional arguments (subparsers)
Adrian Sampson added the comment: Thanks for the suggestion, Steven. I hadn't yet internalized the difference between dest and metavar. This version of the patch modifies metavar instead. Because it looks like this issue is up for 3.2b2, I've modified NEWS and ACKS (I hope this was the right thing to do). I also see the logic behind both help styles Steven depicts. If there's any interest, I can implement the other (hg) style or make it an option. -- Added file: http://bugs.python.org/file20101/argparse-aliases.patch ___ Python tracker <http://bugs.python.org/issue9234> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10918] **kwargs unnecessarily restricted in API
New submission from Adrian Dries : An API such as in, e.g. futures: def submit(self, fn, *args, **kwargs): pass cannot be used thus: submit(foo, 1, 2, fn=bar) I can see two options: either mangle the named parameters: def submit(__self, __fn, *args, **kwargs): pass Or fiddle with *args: def submit(*args, **kwargs): self, fn = args[:2] args = args[2:] -- components: Library (Lib) messages: 126367 nosy: avdd priority: normal severity: normal status: open title: **kwargs unnecessarily restricted in API type: behavior versions: Python 3.2 ___ Python tracker <http://bugs.python.org/issue10918> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10918] **kwargs unnecessarily restricted in API
Adrian Dries added the comment: What now? Python 3.1.3 (r313:86834, Jan 17 2011, 22:33:40) [GCC 4.4.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> def foo(f, **kw): ... pass ... >>> foo(1, **{'f': 2}) Traceback (most recent call last): File "", line 1, in TypeError: foo() got multiple values for keyword argument 'f' >>> -- ___ Python tracker <http://bugs.python.org/issue10918> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10918] **kwargs unnecessarily restricted in concurrent.futures 'submit' API
Adrian Dries added the comment: The futures case is one example of a broader API design issue. Note also that 'self' is similarly restricted. You might think these are 'corner cases', but to me it is poor API design. There may well be a reasonable case for passing 'self' as a keyword arg; what right has the API to dictate otherwise? I think Python's private name mangling provides a reasonably clean, self-documenting solution, pushing the 'corner' case further to the corner (the restriction would then be on the much-less-likely mangled names). -- ___ Python tracker <http://bugs.python.org/issue10918> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10918] **kwargs unnecessarily restricted in concurrent.futures 'submit' API
Adrian Dries added the comment: No, private mangling applies to any identifier in class-scope: Python 2.6.4 (r264:75706, Dec 7 2009, 18:45:15) [GCC 4.4.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> class C: ... def f(__x): pass ... >>> import inspect >>> inspect.getargspec(C.f) ArgSpec(args=['_C__x'], varargs=None, keywords=None, defaults=None) >>> -- ___ Python tracker <http://bugs.python.org/issue10918> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10918] **kwargs unnecessarily restricted in concurrent.futures 'submit' API
Adrian Dries added the comment: Have your cake and eat it: def submit(self, fn, args, kw): # submit implementation def sugar(*args, **kw): return args[0].submit(args[1], args[2:], kw) -- ___ Python tracker <http://bugs.python.org/issue10918> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2940] Building Python fails on SunOS
New submission from Adrian M <[EMAIL PROTECTED]>: $ uname -a SunOS ro1estw 5.9 Generic_117171-12 sun4u sparc SUNW,Sun-Fire-880 gcc 2.6.3 When running ./configure I'm getting warnings like: configure: WARNING: curses.h: present but cannot be compiled configure: WARNING: curses.h: check for missing prerequisite headers? configure: WARNING: curses.h: see the Autoconf documentation configure: WARNING: curses.h: section "Present But Cannot Be Compiled" configure: WARNING: curses.h: proceeding with the preprocessor's result configure: WARNING: curses.h: in the future, the compiler will take precedence This happens for many other headers as well (dlfcn.h, fcntl.h, and many others - i'll attach the whole list of messages). Then, the ./configure step ends with the following message : checking size of int... configure: error: cannot compute sizeof (int) -- components: Build files: config_logs.zip messages: 67183 nosy: syraxes severity: normal status: open title: Building Python fails on SunOS type: compile error versions: Python 2.5 Added file: http://bugs.python.org/file10397/config_logs.zip __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2940> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2940] Building Python fails on SunOS
Adrian M <[EMAIL PROTECTED]> added the comment: Also, please check: http://bugs.python.org/issue1544306 (exactly the same issue that has just been closed because of the lack of feedback from the original reporter) Here is another (old) report referring to the very same issue happening on Solaris: http://bugs.python.org/issue1234473 (an issue that doesn't seem to be solved) I have no idea whether this is a real "Python bug" or not. I'm just reporting a build "issue" that I'm experiencing when trying to compile python on this particular (non-typical) platform. So, I have the access to this SunOS machine and the you (the Python developers) have the knowledge. Let's just work together and try to discover why the building process is not working out-of-the-box on SunOS, rather that imply that it's not a real python bug. __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2940> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3330] webbrowser module doesn't correctly handle '|' character.
New submission from Adrian Petrescu <[EMAIL PROTECTED]>: The webbrowser module seems to treat URLs containing the "|" character differently based on whether the browser is already running or not. For instance, consider the following python script: import webbrowser url = "http://foo.com/bar.html?var=x|y|z" webbrowser.open(url) If you run this script while the browser is already running (so that webbrowser.open creates a new tab) this behaves as you would expect, with the given URL as an address. However, if a browser is not already running, when webbrowser.open creates it, it seems to interpret the "|" as a seperator character, so that the browser will open with THREE tabs, one open to "http://foo.com/bar.html?var=x";, one to "http://y"; and one to "http://z";. This is clearly a bug, webbrowser module should be smart enough to escape the "|" character if the browser is interpreting that line differently. This happens in Linux with Python 2.5 and Firefox 3.0. Not sure if it happens with anything else. -- components: Library (Lib) messages: 69488 nosy: AdrianP severity: normal status: open title: webbrowser module doesn't correctly handle '|' character. type: behavior versions: Python 2.5 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3330> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3330] webbrowser module doesn't correctly handle '|' character.
Adrian Petrescu <[EMAIL PROTECTED]> added the comment: Just as an aside, the reason I consider this a fairly serious bug is that the Google Charts API urls make heavy use of the '|' character, which means if I want to have Python use it by opening the user's browser, it won't work if they don't already have a browser open. ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3330> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7747] Function variable wrongly reported unassigned
New submission from Adrian May : Hi folks, The attached program says: $ ./bug.py a None b Traceback (most recent call last): File "./bug.py", line 49, in print number(s) File "./bug.py", line 34, in foo while eat != None: UnboundLocalError: local variable 'eat' referenced before assignment but I reckon it is assigned. (I haven't tried it on a newer python because the junk I want to use with python says it only works with 2.5.2.) Cheers, Adrian. -- components: Interpreter Core files: bug.py messages: 98101 nosy: adrianmay severity: normal status: open title: Function variable wrongly reported unassigned type: compile error versions: Python 2.5 Added file: http://bugs.python.org/file15963/bug.py ___ Python tracker <http://bugs.python.org/issue7747> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7747] Function variable wrongly reported unassigned
Adrian May added the comment: OK, Thanks. Sorry for the hassle. Adrian. -- type: behavior -> compile error ___ Python tracker <http://bugs.python.org/issue7747> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35448] ConfigParser .read() - handling of nonexistent files
Adrian Wielgosik added the comment: Yeah, I lost steam on this issue, sorry. Go ahead :) -- ___ Python tracker <https://bugs.python.org/issue35448> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42128] Structural Pattern Matching (PEP 634)
Adrian Freund added the comment: For the last few days I've been working with pattern matching and it's ast for a bit, while trying to add support for it to mypy. During this I noticed an inconsistency in the ast: ast.MatchAs has an attribute name which is of type identifier (in C) and type str (in python). This seams really inconsistent with the rest of the ast, where identifiers are always wrapped in a ast.Name object. The only other exception to this is ast.Attribute. Judging from Grammar/python.gram this seems deliberate: as_pattern[expr_ty]: | pattern=or_pattern 'as' target=capture_pattern { _Py_MatchAs(pattern, target->v.Name.id, EXTRA) } Could someone shed some light on why MatchAs directly references an identifier instead of an ast.Name? -- nosy: +freundTech ___ Python tracker <https://bugs.python.org/issue42128> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42128] Structural Pattern Matching (PEP 634)
Adrian Freund added the comment: Thanks for the response. Looks like I overlooked the imports, global, nonlocal, ... because I only searched for usages of identifier, but they use lists of identifiers. In that case I agree that it isn't inconsistent. -- ___ Python tracker <https://bugs.python.org/issue42128> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43489] Can't install, nothing to install
New submission from Adrian LeDeaux : Python 2.7 won't install. I get the error "there is nothing to install" or something to that effect. I am using MacOS High Sierra 10.13.6. I tried both installer downloads. None worked. And I got the same error every time. Anyone have any ideas on what is going on? -- messages: 388642 nosy: aledeaux priority: normal severity: normal status: open title: Can't install, nothing to install ___ Python tracker <https://bugs.python.org/issue43489> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43490] IDLE freezes at random
New submission from Adrian LeDeaux : My IDLE shell keeps freezing when using the turtle module. I am using MacOS High Sierra 13.10.6. It says it is fine, but I can't get the window open. I have to restart the shell entirely. I can't type or do anything. I have to do the [command]+[Q] shortcut and then open the app again. Any ideas? -- messages: 388643 nosy: aledeaux priority: normal severity: normal status: open title: IDLE freezes at random versions: Python 3.10 ___ Python tracker <https://bugs.python.org/issue43490> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43490] IDLE freezes at random
Adrian LeDeaux added the comment: Only when using the turtle module does it happen. -- type: -> behavior versions: -Python 3.10 ___ Python tracker <https://bugs.python.org/issue43490> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43490] IDLE freezes at random
Adrian LeDeaux added the comment: My processor is Intel core 2 duo. -- ___ Python tracker <https://bugs.python.org/issue43490> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43489] Can't install, nothing to install
Adrian LeDeaux added the comment: First, I am not asking for guesses. I am getting the installers from the www.python.org website, and I am running them with the MacOS installer app. The format is .mpkg -- Added file: https://bugs.python.org/file49874/Screen Shot 2021-03-13 at 8.45.18 PM.png ___ Python tracker <https://bugs.python.org/issue43489> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43489] Can't install, nothing to install
Adrian LeDeaux added the comment: The main reason I am trying to install this is because I want to use pygame. Is pygame compatible with version 2.7.28? -- ___ Python tracker <https://bugs.python.org/issue43489> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43489] Can't install, nothing to install
Adrian LeDeaux added the comment: Alright! Thanks for the help! I will try that. -- ___ Python tracker <https://bugs.python.org/issue43489> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43531] Turtle module does not work
New submission from Adrian LeDeaux : So when I try to do the command "import turtle" all I get back is: Traceback (most recent call last): File "", line 1, in import turtle File "/Users/Virsatech/Documents/turtle.py", line 2, in t = turtle.Pen() AttributeError: partially initialized module 'turtle' has no attribute 'Pen' (most likely due to a circular import) that error exactly. And I have tried many times. Anyone know how to fix? -- assignee: terry.reedy components: IDLE messages: 388931 nosy: aledeaux, terry.reedy priority: normal severity: normal status: open title: Turtle module does not work type: behavior versions: Python 3.10 ___ Python tracker <https://bugs.python.org/issue43531> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43531] Turtle module does not work
Adrian LeDeaux added the comment: Oh, OK. I am not an expert on python so I did not understand the error. Thanks for the help, and I will update you if the problems continue. -- ___ Python tracker <https://bugs.python.org/issue43531> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43531] Turtle module does not work
Adrian LeDeaux added the comment: That fixed it. -- ___ Python tracker <https://bugs.python.org/issue43531> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43531] Turtle module does not work
Adrian LeDeaux added the comment: OK. -- ___ Python tracker <https://bugs.python.org/issue43531> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43761] Documenting dataclass and namedtuple changes for structural pattern matching
New submission from Adrian Freund : PEP 634 structural pattern matching adds an auto-generated __match_args__ attribute to classes with the dataclass decorator and to namedtuples. This change is currently not documented in the dataclass and namedtuple documentation, nor is it mentioned in PEP 557 Data Classes. I would suggest adding mentions of this behaviour in those three places. Additionally I think adding a new parameter to switch off generating __match_args__ to dataclass should be considered, as everything else generated by dataclass can be switched off using a parameter. -- assignee: docs@python components: Documentation messages: 390413 nosy: brandtbucher, docs@python, freundTech, gvanrossum priority: normal severity: normal status: open title: Documenting dataclass and namedtuple changes for structural pattern matching versions: Python 3.10 ___ Python tracker <https://bugs.python.org/issue43761> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43764] Turning off generation of __match_args__ for dataclasses
New submission from Adrian Freund : The dataclass decorator can take multiple parameters to enable or disable the generation of certain methods. PEP 634 Structural Pattern Matching extends dataclasses to also generate a __match_args__ attribute. I think adding a parameter to enable and disable generation of __match_args__ should be to dataclass should also be considered for consistency. Note that setting compare=False on a dataclass.field already excludes that field from __match_args__, but there is no way to disable generation of __match_args__ completely. -- components: Library (Lib) messages: 390429 nosy: brandtbucher, eric.smith, freundTech, gvanrossum priority: normal severity: normal status: open title: Turning off generation of __match_args__ for dataclasses versions: Python 3.10 ___ Python tracker <https://bugs.python.org/issue43764> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43761] Documenting dataclass and namedtuple changes for structural pattern matching
Adrian Freund added the comment: Ok. I created https://bugs.python.org/issue43764 for that. -- ___ Python tracker <https://bugs.python.org/issue43761> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43764] Turning off generation of __match_args__ for dataclasses
Adrian Freund added the comment: > I assume the OP wants to have a class that doesn't allow positional patterns. > The right way to spell that is indeed to add > >__match_args__ = () > >to the class, there's no need to add another flag to @dataclass. The same however is also true for all the other stuff generated by @dataclass. You can for example disable generation of the init method using def __init__(self): pass and dataclass still has a parameter to disable it. I agree that a new parameter isn't strictly required to achieve functionality, however I would still argue that it should be added for consistency with the rest of the dataclass api. -- ___ Python tracker <https://bugs.python.org/issue43764> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43761] Documenting dataclass and namedtuple changes for structural pattern matching
Adrian Freund added the comment: I agree that __match_args__ shouldn't have to be added to the documentation of any class that supports it, however dataclass and (maybe to a lesser extend) NamedTuple aren't themselves classes, but aid in creating own classes. Their effects on classes generated by them should be documented. The documentation also mentions other fields/methods generated by dataclass and NamedTyple. -- ___ Python tracker <https://bugs.python.org/issue43761> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43761] Documenting dataclass and namedtuple changes for structural pattern matching
Adrian Freund added the comment: I think for namedtuple a short mention in the opening paragraph, where it also mentions the generation of a docstring and __repr__ method should be enough. -- ___ Python tracker <https://bugs.python.org/issue43761> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43892] Make match patterns explicit in the AST
Change by Adrian Freund : -- nosy: +freundTech ___ Python tracker <https://bugs.python.org/issue43892> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43994] change representation of match as / capture as `Name(..., ctx=Store())`
Adrian Freund added the comment: I already brought this up on the main pattern matching issue some time ago (https://bugs.python.org/issue42128#msg388554), where the consensus was that not using a Name is consistent with other parts of the ast, such as `import ... as identifier`, `except ... as identifier` and others. For mypy having a Name node there would slightly simplify the code (I'm currently inserting a dummy NameExpr at AST-Conversion. +0 from me. -- ___ Python tracker <https://bugs.python.org/issue43994> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39875] urllib.request.urlopen sends POST data as query string
Adrian Petrescu added the comment: This is not a bug, you've just misunderstood the urllib API. If you want to pass POST data as a payload, it's the second `data` parameter to `urlopen`: https://bugs.python.org/?@action=confrego&otk=KX9AqsI0JnOLkplIY1AGKXAmDKa38COy -- nosy: +apetresc ___ Python tracker <https://bugs.python.org/issue39875> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39875] urllib.request.urlopen sends POST data as query string
Adrian Petrescu added the comment: (Oops, that was a bad paste! I meant this link: https://docs.python.org/2/library/urllib.html#urllib.urlopen) -- ___ Python tracker <https://bugs.python.org/issue39875> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43127] Unable to install Python 3.9.1 - Windows 10
New submission from Adrian Lloyd : I get the following error when I try to install Python 3.9.1 on windows 10 0x80070659 The installation is forbidden by system policy. The log gives more information: [13A0:0FC0][2021-02-04T16:41:04]e000: Error 0x80070659: Failed to install MSI package. [13A0:0FC0][2021-02-04T16:41:04]e000: Error 0x80070659: Failed to configure per-user MSI package. [13A0:0FC0][2021-02-04T16:41:04]i319: Applied execute package: core_JustForMe, result: 0x80070659, restart: None [13A0:0FC0][2021-02-04T16:41:04]e000: Error 0x80070659: Failed to execute MSI package. I have looked on earlier posts and stack overflow and all suggest a registry fix to set DisableMSI = 0 in the registry, but according to windows documentation this doesn't apply to windows 10. Also the Installer folder which would contain this parameter doesn't exist. Can you help? -- messages: 386485 nosy: adrian.e.d.lloyd priority: normal severity: normal status: open title: Unable to install Python 3.9.1 - Windows 10 versions: Python 3.9 ___ Python tracker <https://bugs.python.org/issue43127> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42405] Add distutils mvsccompiler support for Windows ARM64 build
New submission from Adrian Vladu : To add support for building packages that have C extensions on Windows ARM64, some fixes are required in the integrated distutils wrapper for Visual Studio compiler (Lib/distutils/msvc9compiler.py) This is a hardcoded fix that needs to be improved so that it applies only on windows arm64: https://github.com/ader1990/cpython/commit/b8c59c9b96a7ad11094224b5631aae3b89323f7a Any suggestions are welcome. -- components: Windows messages: 381407 nosy: avladu, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Add distutils mvsccompiler support for Windows ARM64 build type: compile error versions: Python 3.10 ___ Python tracker <https://bugs.python.org/issue42405> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42405] Add distutils mvsccompiler support for Windows ARM64 build
Change by Adrian Vladu : -- keywords: +patch pull_requests: +22291 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23399 ___ Python tracker <https://bugs.python.org/issue42405> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42405] Add distutils mvsccompiler support for Windows ARM64 build
Adrian Vladu added the comment: This fix is __required__ to build a lot of important packages in the python ecosystem, like numpy, pandas, pywin32 and probably a lot more, as most of these important packages have not migrated to setuptools and usually maintain support for multiple python versions. I know that there is a way to change all the packages to use the canonical approach to compile things, but most of them have a tweaked compiler on top of the msvc9compiler.py compiler. I do not see a change in all the python packages to happen as fast as a small backwards compatible commit in the main cpython code. I see this commit as a fix for the win-arm64 package build and not an "extra" feature. As I can see it, not adding this fix here will require a split of trees that are going to be used just for this reason. I will add the fix to setuptools too, but that will not change the above (maintaining separate branches for people who want to use those packages). -- ___ Python tracker <https://bugs.python.org/issue42405> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42405] Add distutils mvsccompiler support for Windows ARM64 build
Adrian Vladu added the comment: Thank you for the suggestion, I will update the PR accordingly to change the __msvccompiler.py. I just need to find a good candidate that uses that implementation to check if the compilation gets fixed. -- ___ Python tracker <https://bugs.python.org/issue42405> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24700] array compare is hideously slow
Changes by Adrian Wielgosik : -- pull_requests: +3042 ___ Python tracker <http://bugs.python.org/issue24700> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24700] array compare is hideously slow
Adrian Wielgosik added the comment: Added a PR with a fast path that triggers when compared arrays store values of the same type. In this fast path, no Python objects are created. For big arrays the runtime reduction can reach 50-100x. It's possible to optimize the comparison loop a bit more - for example array('B') comparison could use memcmp and become extra 10x faster, and other types could receive similar treatment - but I wanted to keep the code relatively simple. Code duplication with macros is a bit ugly, but that's the best I could come up with so far. Benchmark results: TestBefore After % of old time Equal, same stored type (new fast path) array('i', range(0))20.4ns 22.07ns 108.15% array('i', range(1))33.39ns 22.32ns 66.86% array('i', range(10)) 152.0ns 31.21ns 20.54% array('i', range(1))447.7us 6.571us 1.47% array('i', range(10)) 4.626ms 67.24us 1.45% array('i', [1<<30]*10)) 5.234ms 65.8us 1.26% array('B', range(10)) 151.8ns 28.53ns 18.79% array('B', range(250)) 3.14us 194.5ns 6.19% array('B', [1,2,3]*1000)37.76us 2.088us 5.53% array('d', range(10)) 311.9ns 31.22ns 10.01% array('d', range(10)) 2.889ms 99.3us 3.44% Equal, different types (slow path) array('X', range(0))20.37ns 19.45ns 95.48% array('X', range(1))34.87ns 34.42ns 98.72% array('X', range(10)) 169.1ns 169.0ns 99.97% array('X', range(1))462.2us 444.8us 96.23% array('X', range(10)) 4.752ms 4.571ms 96.20% Not equal: first element (X) different array('i', [X] + [1,2,3]*1) 42.77ns 21.84ns 51.06% Not equal: last element (X) different array('i', [1,2,3]*1 + [X]) 375.4us 19.8us 5.27% -- nosy: +Adrian Wielgosik ___ Python tracker <http://bugs.python.org/issue24700> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31453] ssl.PROTOCOL_TLS only select TLSv1.2
New submission from Adrian Vollmer: According to the documentation (https://docs.python.org/2/library/ssl.html#ssl.PROTOCOL_TLS), using ssl_version = ssl.PROTOCOL_TLS in a server socket should offer all TLS/SSL versions. However, it only offers TLSv1_2. I attached a proof of concept. $ python3 poc.py 3.5.4 (default, Aug 12 2017, 14:08:14) [GCC 7.1.0] OpenSSL 1.1.0f 25 May 2017 [SSL: UNSUPPORTED_PROTOCOL] unsupported protocol (_ssl.c:719) [SSL: UNSUPPORTED_PROTOCOL] unsupported protocol (_ssl.c:719) b'test\n' $ python2 poc.py 2.7.13 (default, Jan 19 2017, 14:48:08) [GCC 6.3.0 20170118] OpenSSL 1.1.0f 25 May 2017 [SSL: UNSUPPORTED_PROTOCOL] unsupported protocol (_ssl.c:661) [SSL: UNSUPPORTED_PROTOCOL] unsupported protocol (_ssl.c:661) test To connect with s_client: $ for i in {tls1,tls1_1,tls1_2} ; do echo test | openssl s_client -connect localhost: -CAfile server.pem -quiet -$i ; done 140164347663616:error:1409442E:SSL routines:ssl3_read_bytes:tlsv1 alert protocol version:../ssl/record/rec_layer_s3.c:1399:SSL alert number 70 139926441944320:error:1409442E:SSL routines:ssl3_read_bytes:tlsv1 alert protocol version:../ssl/record/rec_layer_s3.c:1399:SSL alert number 70 depth=0 C = AU, ST = Some-State, O = Internet Widgits Pty Ltd verify return:1 read:errno=0 -- assignee: christian.heimes components: SSL files: poc.py messages: 302081 nosy: adrianv, christian.heimes priority: normal severity: normal status: open title: ssl.PROTOCOL_TLS only select TLSv1.2 type: behavior versions: Python 2.7, Python 3.5 Added file: https://bugs.python.org/file47139/poc.py ___ Python tracker <https://bugs.python.org/issue31453> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31453] ssl.PROTOCOL_TLS only select TLSv1.2
Adrian Vollmer added the comment: Debian buster/sid -- ___ Python tracker <https://bugs.python.org/issue31453> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31453] ssl.PROTOCOL_TLS only select TLSv1.2
Adrian Vollmer added the comment: I read about that, but I don't understand. If I use openssl s_server -port , I can connect using either one of the three protocols. Even if that's the new default, is there no way now to get python on Buster/Sid to use OpenSSL in a non-default mode and have it offer all three versions? -- ___ Python tracker <https://bugs.python.org/issue31453> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31453] ssl.PROTOCOL_TLS only select TLSv1.2
Adrian Vollmer added the comment: Doesn't seem to do anything: >>> ctx.options 2181170175L >>> ctx.options & ~(ssl.OP_NO_TLSv1 | ssl.OP_NO_TLSv1_1) 2181170175L -- ___ Python tracker <https://bugs.python.org/issue31453> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31453] ssl.PROTOCOL_TLS only select TLSv1.2
Adrian Vollmer added the comment: Okay, thanks for your time! -- ___ Python tracker <https://bugs.python.org/issue31453> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31453] Debian Sid/Buster: Cannot enable TLS 1.0/1.1 with PROTOCOL_TLS
Adrian Vollmer added the comment: I have a workaround for now: versions = [ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_TLSv1_1, ssl.PROTOCOL_TLSv1_2, ] firstbytes = s.recv(16, socket.MSG_PEEK) ss = ssl.wrap_socket( s, server_side=True, certfile="server.pem", keyfile="server.pem", # ssl_version=versions[ord(firstbytes[10])-1] # python2 ssl_version=versions[firstbytes[10]-1] ) How much of an ugly hack is this? :) -- versions: -Python 3.6, Python 3.7 ___ Python tracker <https://bugs.python.org/issue31453> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35448] ConfigParser .read() - handling of nonexistent files
New submission from Adrian Wielgosik : Documentation of ConfigParser says: > If a file named in filenames cannot be opened, that file will be ignored. > This is designed so that you can specify an iterable of potential > configuration file locations (for example, the current directory, the user’s > home directory, and some system-wide directory), and all existing > configuration files in the iterable will be read. While this is a useful property, it can also be a footgun. The first read() example in the Quick Start section contains just a single file read: >>> config.read('example.ini') I would expect that this basic usage is very popular. If the file doesn't exist, the normal usage pattern fails in a confusing way: from configparser import ConfigParser config = ConfigParser() config.read('config.txt') value = config.getint('section', 'option') ---> configparser.NoSectionError: No section: 'section' In my opinion, this error isn't very obvious to understand and debug, unless you have read that piece of .read() documentation. This behavior did also bite me even more, with another usage pattern I've found in a project I maintain: > config.read('global.txt') > config.read('local.txt') Here, both files are expected to exist, with the latter one extending or updating configuration from the first file. If one of the files doesn't exist (eg mistake during deployment), there's no obvious error, but the program will be configured in different way than intended. Now, I'm aware that all of this can be avoided by simply using `read_file()`: > with open('file.txt') as f: >config.read_file(f) But again, `.read()` is the one usually mentioned first in both the official documentation, and most independent guides, so it's easy to get wrong. Due to this, I propose adding an extra parameter to .read(): read(filenames, encoding=None, check_exist=False) that, when manually set to True, will throw exception if any of input files doesn't exist; and to use this parameter by default in Quick Start section of ConfigParser documentation. If this is a reasonable idea, I could try and make a PR. For comparison, the `toml` Python library has the following behavior: - if argument is a single filename and file doesn't exist, it throws - if argument is a list of filenames and none exist, it throws - if argument is a list of filenames and at least one exists, it works, but prints a warning for each nonexistent file. For the record, seems like this issue was also mentioned in https://bugs.python.org/issue490399 -- components: Library (Lib) messages: 331439 nosy: Adrian Wielgosik priority: normal severity: normal status: open title: ConfigParser .read() - handling of nonexistent files type: behavior ___ Python tracker <https://bugs.python.org/issue35448> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30545] Enum equality across modules: comparing objects instead of values
Changes by Adrian Wan : -- nosy: +adrianwan2 status: pending -> open ___ Python tracker <http://bugs.python.org/issue30545> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33094] dataclasses: ClassVar attributes are not working properly
New submission from Adrian Stachlewski : Class variables should behave in the same way whether with or without ClassVar annotation. Unfortunately there are not. class A: __slots__ = () x: ClassVar = set() A() # it's ok @dataclass class B: __slots__ = () x = set() B() # ok too @dataclass class C: __slots__ = () # cannot use set() because of error x: ClassVar = field(default_factory=set) C() # AttributeError: 'C' object has no attribute 'x' Exception is raised from __init__ method, with flag init=False nothing changes. Python version: 3.7.0b2 -- components: Library (Lib) messages: 314017 nosy: stachel priority: normal severity: normal status: open title: dataclasses: ClassVar attributes are not working properly type: behavior versions: Python 3.7 ___ Python tracker <https://bugs.python.org/issue33094> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33094] dataclasses: ClassVar attributes are not working properly
Adrian Stachlewski added the comment: Thanks for explaining. I was trying to do something like @dataclass class A: x: ClassVar = set() and thanks to you I know it should be @dataclass class A: x: ClassVar[Set] = set() If you are looking for improved error message, it's probably should be somehow connected to not proper usage of annotation. I've ended with default_factory because x: ClassVar = set() wasn't working and there was no error with default_factory and without slots. -- ___ Python tracker <https://bugs.python.org/issue33094> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33100] dataclasses and __slots__ - non-default argument (member_descriptor)
New submission from Adrian Stachlewski : I've tried to declare two classes @dataclass class Base: __slots__ = ('x',) x: Any @dataclass class Derived(Base): x: int y: int As long as I correctly understood PEP 557 (inheritance part), changing type of variable is possible. This code produce error: TypeError: non-default argument 'y' follows default argument 'x' variable in Derived class has changed default from MISSING to member_descriptor and that's the reason of the exception. -- components: Library (Lib) messages: 314077 nosy: stachel priority: normal severity: normal status: open title: dataclasses and __slots__ - non-default argument (member_descriptor) type: behavior versions: Python 3.7, Python 3.8 ___ Python tracker <https://bugs.python.org/issue33100> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33094] dataclasses: ClassVar attributes are not working properly
Adrian Stachlewski added the comment: Once more same mistake. 'x' should be declared as: - x: ClassVar[set] = set() - x: ClassVar[Set[Any]] = set() -- ___ Python tracker <https://bugs.python.org/issue33094> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33100] dataclasses and __slots__ - non-default argument (member_descriptor)
Adrian Stachlewski added the comment: I don't really get your point. @dataclass class Base: __slots__ = ('x',) x: Any This case is described in PEP 557 as correct, so I don't understand why you want to generate error. Also inheritance without defining slots is correct as stated in data model. In my opinion, member_descriptor should be treated same as MISSING and everything should work correctly. -- ___ Python tracker <https://bugs.python.org/issue33100> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33100] dataclasses and __slots__ - non-default argument (member_descriptor)
Adrian Stachlewski added the comment: There's also another major problem. Because Base.x has value, __init__ is not prepared correctly (member_descriptor is passed as default). @dataclass class Base: __slots__ = ('x',) x: Any Base() # No TypeError exception Fixing this should be quite easy, if you want I can prepare PR. -- ___ Python tracker <https://bugs.python.org/issue33100> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33094] dataclasses: ClassVar attributes are not working properly
Adrian Stachlewski added the comment: There's nothing to do, thanks for help one more again. -- status: pending -> open ___ Python tracker <https://bugs.python.org/issue33094> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34334] QueueHandler logs exc_info twice
New submission from Adrian Dries : Since Python 3.7 logging.handlers.QueueHandler logs tracebacks twice:: >>> import logging >>> from logging.handlers import QueueHandler, QueueListener >>> from queue import Queue >>> q = Queue() >>> logging.getLogger().addHandler(QueueHandler(q)) >>> listener = QueueListener(q, logging.StreamHandler()) >>> listener.start() >>> try: 1/0 ... except: logging.exception('Look out!') ... Look out! Traceback (most recent call last): File "", line 1, in ZeroDivisionError: division by zero Traceback (most recent call last): File "", line 1, in ZeroDivisionError: division by zero Patching QueueHandler.prepare() to set exc_text to None seems to fix this. -- components: Library (Lib) messages: 323100 nosy: avdd priority: normal severity: normal status: open title: QueueHandler logs exc_info twice type: behavior versions: Python 3.7 ___ Python tracker <https://bugs.python.org/issue34334> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34918] Python 3 tkinter measurement problem
New submission from Adrian Keister : tkinter.Tk().winfo_screenmmwidth() and tkinter.Tk().winfo_screenmmheight() give manifestly incorrect values in Windows. This does not appear to be an issue in Linux. I have not tested a Mac. The values reported in Windows are too large by as much as 58%. Searching online seems to indicate that the issue is some applications in Windows are "dpi aware"; unfortunately, none of the so-called work-arounds I've found actually fix the problem. The tkinter.Tk().winfo_screenwidth() and tkinter.Tk().winfo_screenheight() functions, reporting their results in pixels, appear to be correct. A MWE is simply import tkinter tkinter.Tk().winfo_screenmmwidth() This reports a 508 mm on my 15.6" screen, when the true value is closer to 343 mm. This is a 48% error, and hence an unusable result. Thank you for your time! -- components: Tkinter messages: 327265 nosy: Ackbach priority: normal severity: normal status: open title: Python 3 tkinter measurement problem type: behavior versions: Python 3.6 ___ Python tracker <https://bugs.python.org/issue34918> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14985] os.path.isfile and os.path.isdir inconsistent on OSX Lion
New submission from Adrian Bastholm : os.path.isfile doesn't reckognize a .picasa.ini file as a file and os.path.isdir doesn't reckognize a directory as a directory code: def traverse (targetDir): currentDir = targetDir dirs = os.listdir(targetDir) #dirs = [x for x in os.listdir('.') if x.endswith('.JPG')] for entry in dirs: if os.path.isdir(entry): print("Traversing " + entry) traverse(entry) else: print("Not dir: " + entry) if os.path.isfile(entry): print("Processing " + " " + currentDir + " " + entry) else: print("Not file: " + entry) print("\n") return True The test directory contains jpg files and a folder with some other jpgs and a subfolder containing jpgs -- assignee: ronaldoussoren components: Macintosh messages: 162133 nosy: javahaxxor, ronaldoussoren priority: normal severity: normal status: open title: os.path.isfile and os.path.isdir inconsistent on OSX Lion type: behavior versions: Python 3.2 ___ Python tracker <http://bugs.python.org/issue14985> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14986] print() fails on latin1 characters on OSX
New submission from Adrian Bastholm : print(listentry) fails on folder name with swedish (latin1) characters Error: File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/encodings/mac_roman.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\u030a' in position 33: character maps to -- assignee: ronaldoussoren components: Macintosh messages: 162134 nosy: javahaxxor, ronaldoussoren priority: normal severity: normal status: open title: print() fails on latin1 characters on OSX versions: Python 3.2 ___ Python tracker <http://bugs.python.org/issue14986> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14986] print() fails on latin1 characters on OSX
Adrian Bastholm added the comment: The char in question: 'å'. It is a folder with this character in the name. My encoding is UTF-8. Running print("\u030a") gives a blank line U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE General Character Properties In Unicode since: 1.1 Unicode category: Letter, Uppercase Canonical decomposition: U+0041 LATIN CAPITAL LETTER A + U+030A COMBINING RING ABOVE Various Useful Representations UTF-8: 0xC3 0x85 UTF-16: 0x00C5 C octal escaped UTF-8: \303\205 XML decimal entity: Å Annotations and Cross References See also: • U+212B ANGSTROM SIGN Equivalents: • U+0041 LATIN CAPITAL LETTER A U+030A COMBINING RING ABOVE The code: def traverse (targetDir): currentDir = targetDir dirs = os.listdir(targetDir) for entry in dirs: if os.path.isdir(entry): print("Traversing " + entry) traverse(entry) else: print("Not dir: " + entry) if os.path.isfile(entry): print("Processing " + " " + currentDir + " " + entry) else: print("Not file: " + entry) print("\n") -- ___ Python tracker <http://bugs.python.org/issue14986> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14986] print() fails on latin1 characters on OSX
Adrian Bastholm added the comment: The last post is the CAPITAL Å. The following is the small letter "å" U+00E5 LATIN SMALL LETTER A WITH RING ABOVE General Character Properties In Unicode since: 1.1 Unicode category: Letter, Lowercase Canonical decomposition: U+0061 LATIN SMALL LETTER A + U+030A COMBINING RING ABOVE Various Useful Representations UTF-8: 0xC3 0xA5 UTF-16: 0x00E5 C octal escaped UTF-8: \303\245 XML decimal entity: å Annotations and Cross References Notes: • Danish, Norwegian, Swedish, Walloon Equivalents: • U+0061 LATIN SMALL LETTER A U+030A COMBINING RING ABOVE -- ___ Python tracker <http://bugs.python.org/issue14986> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14985] os.path.isfile and os.path.isdir inconsistent on OSX Lion
Adrian Bastholm added the comment: You're right, my code was shite. Strange though it seemed to work on some files. The following updated version does everything as intended with the help of os.path.join: def traverse (targetDir): currentDir = targetDir dirs = os.listdir(targetDir) for entry in dirs: if os.path.isdir(os.path.join(currentDir,entry)): print("Traversing " + os.path.join(targetDir,entry)) traverse(os.path.join(targetDir,entry)) else: if os.path.isfile(os.path.join(targetDir,entry)): print("Processing" + " " + os.path.join(currentDir,entry)) else: print("Not file: " + entry) print("\n") -- ___ Python tracker <http://bugs.python.org/issue14985> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14986] print() fails on latin1 characters on OSX
Adrian Bastholm added the comment: Output in console: Python 3.2.3 (v3.2.3:3d0686d90f55, Apr 10 2012, 11:25:50) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> print(sys.stdout) <_io.TextIOWrapper name='' mode='w' encoding='UTF-8'> >>> import os >>> print([(k, os.environ[k]) for k in os.environ if k.startswith('LC')]) [('LC_CTYPE', 'UTF-8')] >>> print([(k, os.environ[k]) for k in os.environ if k.startswith('LANG')]) [] >>> import locale >>> print(locale.getlocale()) Traceback (most recent call last): File "", line 1, in File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/locale.py", line 524, in getlocale return _parse_localename(localename) File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/locale.py", line 433, in _parse_localename raise ValueError('unknown locale: %s' % localename) ValueError: unknown locale: UTF-8 >>> print('\u00e5') å >>> print('\u0061\u030a') å ** Output from Eclipse: <_io.TextIOWrapper name='' mode='w' encoding='MacRoman'> [] [] (None, None) å Traceback (most recent call last): File "/Users/adyhasch/Documents/PythonWorkspace/PatternRenamer/src/prenamer.py", line 70, in print('\u0061\u030a') File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/encodings/mac_roman.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\u030a' in position 1: character maps to I'm running PyDev .. -- ___ Python tracker <http://bugs.python.org/issue14986> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14986] print() fails on latin1 characters on OSX
Adrian Bastholm added the comment: my code runs fine in a console window, so it's some kind of configuration error. Sorry for wasting your time guys .. It would be nice to know why PyDev is not setting the right environment vars though .. >>> traverse(".") Processing ./.DS_Store Traversing ./2011-10-03--Sebi_o_costi_ny_frisyr Processing ./2011-10-03--Sebi_o_costi_ny_frisyr/.DS_Store Processing ./2011-10-03--Sebi_o_costi_ny_frisyr/.picasa.ini Traversing ./2011-10-03--Sebi_o_costi_ny_frisyr/2011-10-04--Sebastian_2år Processing ./2011-10-03--Sebi_o_costi_ny_frisyr/2011-10-04--Sebastian_2år/.DS_Store Processing ./2011-10-03--Sebi_o_costi_ny_frisyr/2011-10-04--Sebastian_2år/.picasa.ini Processing ./2011-10-03--Sebi_o_costi_ny_frisyr/2011-10-04--Sebastian_2år/DSC_5467.JPG Processing ./2011-10-03--Sebi_o_costi_ny_frisyr/2011-10-04--Sebastian_2år/DSC_5468.JPG Processing ./2011-10-03--Sebi_o_costi_ny_frisyr/2011-10-04--Sebastian_2år/DSC_5472.JPG Processing ./2011-10-03--Sebi_o_costi_ny_frisyr/DSC_5440.JPG Processing ./2011-10-03--Sebi_o_costi_ny_frisyr/DSC_5441.JPG Processing ./__init__.py Processing ./DSC_5440.JPG Processing ./DSC_5453.JPG Processing ./prenamer.py -- ___ Python tracker <http://bugs.python.org/issue14986> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14986] print() fails on latin1 characters on OSX
Adrian Bastholm added the comment: Thanks a lot for the help, guys ! -- ___ Python tracker <http://bugs.python.org/issue14986> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20967] hashlib memory leak
New submission from Adrian Teng: A particular usage pattern of hashlib will cause a memory leak. This leaks: import hashlib import sys if __name__ == '__main__': data_sha1 = "hello world" data_md5 = "hello world" for i in xrange(int(1e6)): hashlib.sha1(data_sha1) hashlib.md5(data_md5) if i % 1000 == 0: print sys.getrefcount(data_sha1), ",", sys.getrefcount(data_md5) --- this doesn't leak: import hashlib import sys if __name__ == '__main__': data_sha1 = "hello world" data_md5 = "hello world" for i in xrange(int(1e6)): sha1 = hashlib.sha1() sha1.update(data_sha1) md5 = hashlib.md5() md5.update(data_md5) if i % 1000 == 0: print sys.getrefcount(data_sha1), ", ", sys.getrefcount(data_md5) See attached for leak memory profiling in linux -- components: Library (Lib) files: memoryleak_min.py messages: 213961 nosy: ateng priority: normal severity: normal status: open title: hashlib memory leak type: resource usage versions: Python 2.7 Added file: http://bugs.python.org/file34489/memoryleak_min.py ___ Python tracker <http://bugs.python.org/issue20967> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20967] hashlib memory leak
Adrian Teng added the comment: Python 2.7.3, Red Hat Enterprise Linux Server release 5.5, with kernal 2.6.18-308.el5 -- ___ Python tracker <http://bugs.python.org/issue20967> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20967] hashlib memory leak
Adrian Teng added the comment: Yup. Tested on 2.7.5 and it doesn't leak. I guess this is a duplicate of #15219. Cheers! -- resolution: -> duplicate ___ Python tracker <http://bugs.python.org/issue20967> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9234] argparse: aliases for positional arguments (subparsers)
New submission from Adrian Sampson : The argparse module supports "subparsers," which allow CLI tools to support invocation of subcommands (much like the svn or hg programs). For these subcommands, it is often useful to allow multiple names for the same command. For instance, in Mercurial, "hg blame" does the same thing as "hg annotate". You should be able to create subparsers with command aliases, like this: >>> subparsers.add_parser("annotate", aliases=('ann', 'blame')) The help message for the program should display the aliases alongisde the command names. I'm attaching an example script that adds an Action to the library to accomplish this. This isn't a patch, but if this approach seems right to other people, I'll turn it into a patch. Here's this bug on argparse's old tracker: http://code.google.com/p/argparse/issues/detail?id=23 -- components: Library (Lib) files: aliases.py messages: 110130 nosy: asampson priority: normal severity: normal status: open title: argparse: aliases for positional arguments (subparsers) type: feature request versions: Python 2.7 Added file: http://bugs.python.org/file17971/aliases.py ___ Python tracker <http://bugs.python.org/issue9234> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue28813] Remove unneeded folded consts after peephole
New submission from Adrian Wielgosik: The attached patch adds new logic to peephole compiler to remove constants that are no longer needed after the main peephole pass. For example: def f(): var = 'te' + 'xt' num = -12 num = -6 * 2 return (1, (3, 4), 6) print(f.__code__.co_consts) Without the patch: (None, 'te', 'xt', 12, 6, 2, 1, 3, 4, 'text', -12, -6, -12, (3, 4), (1, (3, 4), 6)) With patch: (None, 'text', -12, -12, (1, (3, 4), 6)) (unfortunately, I couldn't get rid of None because that would make 'text' a docstring) For convenience, I've written the patch in two parts. The first one just changes the CONST_STACK_* macros to store the co_const indices instead of the constants themselves, the second one is the actual implementation of the new logic. Aside from simply having to store less objects around, this also makes co_consts contents closer together. This may help the cache a little bit. - I did run benchmarks multiple times, but it looked like all the results were random noise. That makes sense, since I didn't directly affect the runtime. The only consistently faster benchmark is: - regex_dna: 288 ms +- 7 ms -> 275 ms +- 5 ms: 1.05x faster I tried to measure the difference in compile time, but it too was lost in the noise. - I also compared size of compiled .pyc files in the Lib/ directory. The gains are mostly very small. _compat_pickle.cpython-37.pyc | 6554 -> 5851 | -10.7% sre_compile.cpython-37.pyc| 10275 -> 10025 | -2.43% hashlib.cpython-37.pyc| 6624 -> 6514 | -1.66% pstats.cpython-37.pyc | 21755 -> 21435 | -1.47% _markupbase.cpython-37.pyc| 7979 -> 7864 | -1.44% pydoc.cpython-37.pyc | 83899 -> 82712 | -1.41% _strptime.cpython-37.pyc | 15951 -> 15751 | -1.25% __future__.cpython-37.pyc | 4155 -> 4105 | -1.2% opcode.cpython-37.pyc | 5401 -> 5341 | -1.11% colorsys.cpython-37.pyc | 3299 -> 3263 | -1.09% signal.cpython-37.pyc | 2503 -> 2478 | -0.999% _osx_support.cpython-37.pyc | 9663 -> 9568 | -0.983% gettext.cpython-37.pyc| 13990 -> 13854 | -0.972% getpass.cpython-37.pyc| 4223 -> 4183 | -0.947% compare.cpython-37.pyc| 541-> 536| -0.924% warnings.cpython-37.pyc | 13328 -> 13208 | -0.9% platform.cpython-37.pyc | 27931 -> 27681 | -0.895% imaplib.cpython-37.pyc| 42019 -> 41653 | -0.871% webbrowser.cpython-37.pyc | 15836 -> 15702 | -0.846% this.cpython-37.pyc | 1253 -> 1243 | -0.798% rlcompleter.cpython-37.pyc| 5768 -> 5723 | -0.78% zipfile.cpython-37.pyc| 48024 -> 47672 | -0.733% imghdr.cpython-37.pyc | 4138 -> 4108 | -0.725% turtle.cpython-37.pyc | 131600 -> 130653 | -0.72% timeit.cpython-37.pyc | 11676 -> 11596 | -0.685% lzma.cpython-37.pyc | 11980 -> 11900 | -0.668% bz2.cpython-37.pyc| 11270 -> 11195 | -0.665% aifc.cpython-37.pyc | 25821 -> 25651 | -0.658% gzip.cpython-37.pyc | 16215 -> 16110 | -0.648% uuid.cpython-37.pyc | 20382 -> 20260 | -0.599% plistlib.cpython-37.pyc | 27354 -> 27191 | -0.596% cProfile.cpython-37.pyc | 4199 -> 4174 | -0.595% tarfile.cpython-37.pyc| 62437 -> 62076 | -0.578% sysconfig.cpython-37.pyc | 15819 -> 15728 | -0.575% profile.cpython-37.pyc| 13889 -> 13814 | -0.54% random.cpython-37.pyc | 19177 -> 19074 | -0.537% _threading_local.cpython-37.pyc | 6609 -> 6574 | -0.53% _dummy_thread.cpython-37.pyc | 4839 -> 4814 | -0.517% datetime.cpython-37.pyc | 53722 -> 53445 | -0.516% tracemalloc.cpython-37.pyc| 17218 -> 17131 | -0.505% // remaining 129 files are < 0.5% smaller, 33 of them didn't change their size -- components: Interpreter Core messages: 281820 nosy: Adrian Wielgosik priority: normal severity: normal status: open title: Remove unneeded folded consts after peephole type: resource usage versions: Python 3.7 ___ Python tracker <http://bugs.python.org/issue28813> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue28813] Remove unneeded folded consts after peephole
Changes by Adrian Wielgosik : -- keywords: +patch Added file: http://bugs.python.org/file45661/indices_tweak.patch ___ Python tracker <http://bugs.python.org/issue28813> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue28813] Remove unneeded folded consts after peephole
Changes by Adrian Wielgosik : Added file: http://bugs.python.org/file45662/clean_co_consts.patch ___ Python tracker <http://bugs.python.org/issue28813> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue28813] Remove unneeded folded consts after peephole
Adrian Wielgosik added the comment: Attached squashed patch. > But moving constant folding from the peephole optimizer to the AST level > (...) would totally eliminate the need in your patch. I'm aware of that and I'm okay with it. I chose an unfortunate moment for implementing this :) -- Added file: http://bugs.python.org/file45664/clean_co_consts_squashed.patch ___ Python tracker <http://bugs.python.org/issue28813> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com