[issue31170] expat: utf8_toUtf8 cannot properly handle exhausting buffer

2017-08-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Corresponding Expat issue: https://github.com/libexpat/libexpat/issues/115. -- ___ Python tracker ___

[issue31170] expat: utf8_toUtf8 cannot properly handle exhausting buffer

2017-08-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I confirm the regression (see issue31303 for reproducer). Victor, do you mind to update expat to 2.2.4? This issue can be classified as a security issue, since a regression was added in security update. -- nosy: +benjamin.peterson, georg.brandl,

[issue31303] xml.etree.ElementTree fails to parse a document (regression)

2017-08-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is a duplicate of issue31170. Updating expat to 2.2.4 fixes this issue. -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> expat: utf8_toUtf8 cannot properly handle exhausting buffer

[issue31051] IDLE, configdialog, General tab: re-arrange, test user entries

2017-08-29 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- pull_requests: +3283 ___ Python tracker ___ ___

[issue31051] IDLE, configdialog, General tab: re-arrange, test user entries

2017-08-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: New changeset 390eadd6d041611511dc761bc7d4581530dbd287 by Terry Jan Reedy in branch 'master': bpo-31051: Rearrange IDLE condigdialog GenPage into Window, Editor, and Help sections. (#3239)

[issue27099] IDLE: turn built-in extensions into regular modules

2017-08-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: Configdialog does not import EditorWindow and should not need to with the change. It should also not import the separate modules. I outlined how I plan to update the current extension values in #22707, msg300973. PR3239 for #31051 prepares GenPage for the

[issue31051] IDLE, configdialog, General tab: re-arrange, test user entries

2017-08-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: 'autocomplete and parenmatch' (in that order). Code context should be last in the editor section. -- ___ Python tracker

[issue31051] IDLE, configdialog, General tab: re-arrange, test user entries

2017-08-29 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- stage: needs patch -> patch review ___ Python tracker ___

[issue31051] IDLE, configdialog, General tab: re-arrange, test user entries

2017-08-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: It does not matter for users what we call the class. MainPage reads a bit smoother than GenPage. I have also considered renaming HighPage as ColorPage and relabeling the tab 'Colors'. The above covers at least 2 issues. #31306 covers changing Vars and

[issue31051] IDLE, configdialog, General tab: re-arrange, test user entries

2017-08-29 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- pull_requests: +3282 ___ Python tracker ___ ___

[issue31306] IDLE, configdialog, General tab: validate user entries

2017-08-29 Thread Terry J. Reedy
New submission from Terry J. Reedy: This was initially part of #31051. See 2nd have of msg299262 and all of msg299263. -- assignee: terry.reedy components: IDLE messages: 301005 nosy: terry.reedy priority: normal severity: normal stage: test needed status: open title: IDLE,

RE: pip which should be installed with Python3.62 doesn't work inwindows

2017-08-29 Thread Bear Light
Thanks for help but it doesn’t work. (cmd) C:\Users\user>py -3.6 -m pip install regex C:\Program Files\Python36\python.exe: No module named pip The picture that I attached showed similar result. Though you can see the option of installing pip during python3 installing, the command about pip

[issue31305] 'pydoc -w import' report "no Python documentation found for 'import'"

2017-08-29 Thread Morris Li
Changes by Morris Li : -- versions: +Python 3.5 ___ Python tracker ___ ___

[issue31305] 'pydoc -w import' report "no Python documentation found for 'import'"

2017-08-29 Thread Morris Li
Changes by Morris Li : -- assignee: docs@python components: Documentation nosy: docs@python, limuyuan priority: normal severity: normal status: open title: 'pydoc -w import' report "no Python documentation found for 'import'" type: behavior versions: Python 2.7

[issue29302] add contextlib.AsyncExitStack

2017-08-29 Thread Alexander Mohr
Alexander Mohr added the comment: let me know if I need to do anything -- ___ Python tracker ___ ___

[issue5001] Remove assertion-based checking in multiprocessing

2017-08-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: I suppose this can be closed now. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue5001] Remove assertion-based checking in multiprocessing

2017-08-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset bd73e72b4a9f019be514954b1d40e64dc3a5e81c by Antoine Pitrou (Allen W. Smith, Ph.D) in branch 'master': bpo-5001: More-informative multiprocessing error messages (#3079)

[issue30637] Syntax error reported on compile(...), but not on compile(..., ast.PyCF_ONLY_AST)

2017-08-29 Thread Hrvoje Nikšić
Hrvoje Nikšić added the comment: > Can you suggest a couple of sentences you would have like to have > seen, and where? Thanks, I would suggest to add something like this to the documentation of ast.parse: """ ``parse`` raises ``SyntaxError`` if the compiled source is invalid, and

Re: pip which should be installed with Python3.62 doesn't work in windows

2017-08-29 Thread MRAB
On 2017-08-29 20:10, Bear Light wrote: I found many rookies like me asking similar question: why "pip" is not recognized by cmd? I install Python 3.62 64bit in Win10 and I'm sure I add PATH, the Python tutorial doesn't even mention about PATH. You can see the following picture showing the

pip which should be installed with Python3.62 doesn't work in windows

2017-08-29 Thread Bear Light
I found many rookies like me asking similar question: why "pip" is not recognized by cmd? I install Python 3.62 64bit in Win10 and I'm sure I add PATH, the Python tutorial doesn't even mention about PATH. You can see the following picture showing the tutorial doesn't work. Please give a hand to

[issue31304] Update doc for starmap_async error_back kwarg

2017-08-29 Thread tamas
New submission from tamas: The documentation suggests that multiprocessing.pool.Pool. starmap_async has a kwarg called 'error_back', but it actually has a kwarg called 'error_callback' to handle errors, just like map_async. Link:

[issue31297] Unpickleable ModuleImportError in unittest patch not backported to 2.7

2017-08-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: I'm guessing the backport may end up non-trivial. Do you want to try submitting a PR for it? -- ___ Python tracker

automatically set field values in django using function

2017-08-29 Thread Xristos Xristoou
I need t define some values of fields automatically in my model using function. my function get input image path and calculate and I need that calculation results to define my database fields in Django. but first the upload image need to get the path in server and after i can to define the

[issue31303] xml.etree.ElementTree fails to parse a document (regression)

2017-08-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Simpler reproducer: >>> import xml.etree.ElementTree >>> xml.etree.ElementTree.XML(b'') Traceback (most recent call last): File "", line 1, in File "/home/serhiy/py/cpython/Lib/xml/etree/ElementTree.py", line 1315, in XML parser.feed(text)

[issue30781] IDLE: configdialog -- switch to ttk widgets.

2017-08-29 Thread Cheryl Sabella
Changes by Cheryl Sabella : -- pull_requests: +3280 ___ Python tracker ___ ___

[issue27923] PEP 467 -- Minor API improvements for binary sequences

2017-08-29 Thread Elias Zamaria
Changes by Elias Zamaria : -- pull_requests: +3279 ___ Python tracker ___ ___

[issue31303] xml.etree.ElementTree fails to parse a document (regression)

2017-08-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka type: crash -> behavior versions: +Python 3.7 -Python 3.5 ___ Python tracker

Re: doctest random output?

2017-08-29 Thread Chris Angelico
On Wed, Aug 30, 2017 at 1:39 AM, Stefan Ram wrote: > Dennis Lee Bieber writes: >>Testing randomness itself requires statistical tests... > > A perfectly random coin /can/ yield "heads" a thousand times > in sequence (which is very unlikely, but

[issue31303] xml.etree.ElementTree fails to parse a document (regression)

2017-08-29 Thread R. David Murray
Changes by R. David Murray : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___

[issue31303] xml.etree.ElementTree fails to parse a document (regression)

2017-08-29 Thread Vyacheslav Rafalskiy
Changes by Vyacheslav Rafalskiy : Added file: http://bugs.python.org/file47109/bad_file.xml ___ Python tracker ___

[issue31303] xml.etree.ElementTree fails to parse a document (regression)

2017-08-29 Thread Vyacheslav Rafalskiy
New submission from Vyacheslav Rafalskiy: In Python 3.5.4 and 3.6.2, both on Windows and Linux, parsing a manifestly correct xml file like: xml.etree.ElementTree.parse('bad_file.xml') raises: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 1023: invalid continuation byte

Re: Latency for API call to a Python Function

2017-08-29 Thread MRAB
On 2017-08-29 17:08, shazianu...@gmail.com wrote: You mean recursive linear search? Or is there a way I can test all my code with multiple files to see which function is causing issue? You can just put some timing around the methods that might be a problem, writing to a logfile. Process a

[issue31291] zipimport.zipimporter.get_data() crashes when path.replace() returns a non-str

2017-08-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 631fdee6e61b4ba8ce800f827fecdd536bfb04f3 by Serhiy Storchaka (Oren Milman) in branch 'master': bpo-31291: Fixed an assertion failure in zipimport.zipimporter.get_data() (#3226)

Re: tkinter keypress events are a mess for numpad keys

2017-08-29 Thread Irmen de Jong
On 29/08/2017 06:32, Terry Reedy wrote: > *The* documentation (for 8.6) is the tcl.tk/man doc set: > https://www.tcl.tk/man/tcl8.6/TkCmd/contents.htm > For the level of detail you are looking at, they are essential. > > The nmt docs for 8.5 are neither complete (intentionally not) nor always >

Re: IDLE won't install on manual installation

2017-08-29 Thread Yusuf Mohammad
Hi! i want to ask my question again. I have now subscribed to the list. I'll just copy and past it here again: Hi! My name is Yusuf Mohammad. I work for a hospital in Norway and we plan to use python to program a mobile application. I have a admin account on my computer and i am trying to

[issue31243] checks whether PyArg_ParseTuple returned a negative int

2017-08-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your contribution Oren! -- resolution: -> fixed stage: backport needed -> resolved status: open -> closed ___ Python tracker

[issue31243] checks whether PyArg_ParseTuple returned a negative int

2017-08-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 20958e6d91d11a80d6c664ce6346791259b1d193 by Serhiy Storchaka (Oren Milman) in branch '2.7': [2.7] bpo-31243: Fixed PyArg_ParseTuple failure checks. (GH-3171) (#3235)

Re: Latency for API call to a Python Function

2017-08-29 Thread shazianusra
You mean recursive linear search? Or is there a way I can test all my code with multiple files to see which function is causing issue? -- https://mail.python.org/mailman/listinfo/python-list

[issue29400] Add instruction level tracing via sys.settrace

2017-08-29 Thread George King
Changes by George King : -- pull_requests: +3278 ___ Python tracker ___ ___

[issue29400] Add instruction level tracing via sys.settrace

2017-08-29 Thread George King
George King added the comment: Attached updated demo script. -- Added file: http://bugs.python.org/file47107/settracestate-demo.py ___ Python tracker ___

Re: Latency for API call to a Python Function

2017-08-29 Thread MRAB
On 2017-08-29 16:22, shazianu...@gmail.com wrote: Hi, I have an issue with one piece of code in Python that when my API using Nginx/Uwsgi/EC2 AWS calls this function it causes latency. I need help to figure out if there is I am doing something wrong with this particular function. Rest of the

[issue24900] Raising an exception that cannot be unpickled causes hang in ProcessPoolExecutor

2017-08-29 Thread George King
Changes by George King : -- pull_requests: +3277 ___ Python tracker ___ ___

Re: Latency for API call to a Python Function

2017-08-29 Thread Terry Reedy
On 8/29/2017 11:22 AM, shazianu...@gmail.com wrote: def getvideos(self, listitem): channelId = "" returnVideos,dictData = {},{} mode = 0 channelId = listitem[KEY_CHANNELID] if KEY_CHANNELMODE in listitem : mode = int(listitem[KEY_CHANNELMODE]) filteredVideos = [] ... Please make code readable

Latency for API call to a Python Function

2017-08-29 Thread shazianusra
Hi, I have an issue with one piece of code in Python that when my API using Nginx/Uwsgi/EC2 AWS calls this function it causes latency. I need help to figure out if there is I am doing something wrong with this particular function. Rest of the code calls for DB are working fine and no issues.

[issue31243] checks whether PyArg_ParseTuple returned a negative int

2017-08-29 Thread Oren Milman
Changes by Oren Milman : -- pull_requests: +3276 ___ Python tracker ___ ___

[issue31065] Documentation for Popen.poll is unclear

2017-08-29 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset 006617ff7d6df3fdedcfe53e94ee2c52cc796437 by Gregory P. Smith (Ivan Chernoff) in branch 'master': bpo-31065: Add doc about Popen.poll returning None. (#3169) https://github.com/python/cpython/commit/006617ff7d6df3fdedcfe53e94ee2c52cc796437

[issue8087] Unupdated source file in traceback

2017-08-29 Thread Aigars Mahinovs
Aigars Mahinovs added the comment: As a point of update - this is a problem that can make debugging more difficult for people running web services or other server processes that are expected to stay alive for a long time. It is often undesirable to force a server restart or reload every time

[issue31300] Traceback prints different code than the running module

2017-08-29 Thread R. David Murray
R. David Murray added the comment: This is a duplicate of issue 8087, which contains quite a bit of discussion of the subtleties of the issue. -- nosy: +r.david.murray resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Unupdated source file in

[issue31286] import in finally results in SystemError

2017-08-29 Thread Thomas Caswell
Thomas Caswell added the comment: Your welcome! Matplotlib ended up just moving the import out of the finally block once we understood the issue. Tom On Tue, Aug 29, 2017 at 8:50 AM Serhiy Storchaka wrote: > > Serhiy Storchaka added the comment: > > Thank you for

[issue31302] smtplib on linux fails to log in correctly

2017-08-29 Thread murphdasurf
murphdasurf added the comment: PS: The corresponding code is: server_ssl = smtplib.SMTP(SERVER, PORT) server_ssl.set_debuglevel(True) server_ssl.ehlo() server_ssl.starttls() server_ssl.login(USER_FOR_AUTHENTICATION, XX) -- ___ Python tracker

Re: doctest random output?

2017-08-29 Thread Pavol Lisy
On 8/28/17, Leam Hall wrote: > On 08/28/2017 11:40 AM, Dennis Lee Bieber wrote: > > ... a bunch of good stuff ... > > I'm (re-)learning python and just trying make sure my function works. > Not at the statistical or cryptographic level. :) > > Thanks! > > Leam > -- >

[issue31302] smtplib on linux fails to log in correctly

2017-08-29 Thread murphdasurf
New submission from murphdasurf: The protocol should run like this: send: 'ehlo X\r\n' reply: b'250-XX.com\r\n' reply: b'250-PIPELINING\r\n' reply: b'250-SIZE 10048\r\n' reply: b'250-VRFY\r\n' reply: b'250-ETRN\r\n' reply: b'250-STARTTLS\r\n' reply:

[issue31286] import in finally results in SystemError

2017-08-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your report Thomas! Don't forget to remove pyc-files before re-running the Matplotlib test suite. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue31286] import in finally results in SystemError

2017-08-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 265fcc5fc25d65afb33fda480c603f1e974e374e by Serhiy Storchaka in branch 'master': bpo-31286, bpo-30024: Fixed stack usage in absolute imports with (#3217) https://github.com/python/cpython/commit/265fcc5fc25d65afb33fda480c603f1e974e374e

[issue30024] Treat `import a.b.c as m` as `m = sys.modules['a.b.c']`

2017-08-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 265fcc5fc25d65afb33fda480c603f1e974e374e by Serhiy Storchaka in branch 'master': bpo-31286, bpo-30024: Fixed stack usage in absolute imports with (#3217) https://github.com/python/cpython/commit/265fcc5fc25d65afb33fda480c603f1e974e374e

[issue31243] checks whether PyArg_ParseTuple returned a negative int

2017-08-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset c7750c2a3af014a5b742d0159d8957ea95b6c221 by Serhiy Storchaka (Oren Milman) in branch '3.6': [3.6] bpo-31243: Fixed PyArg_ParseTuple failure checks. (GH-3171) (#3233)

[issue31301] Python 2.7 SIGSEGV

2017-08-29 Thread Cody Sixteen
New submission from Cody Sixteen: During one fuzzing session I found that python2.7 will crash when parsing the file (attached). Maybe you will find it useful. -- components: Build files: py27-sigsegv.zip messages: 300981 nosy: cody priority: normal severity: normal status: open

[issue31300] Traceback prints different code than the running module

2017-08-29 Thread Aigars Mahinovs
New submission from Aigars Mahinovs: If you run a longer running Python program, then change the Python module that it loaded on disk and then cause a traceback to happen in the code in that module, then the traceback may be nonsensical as it will reference line numbers from the module in

[issue31243] checks whether PyArg_ParseTuple returned a negative int

2017-08-29 Thread Oren Milman
Changes by Oren Milman : -- pull_requests: +3275 ___ Python tracker ___ ___

[issue31132] test_prlimit from test_resource fails when building python3 inside systemd-nspawn environment

2017-08-29 Thread Petr Viktorin
Petr Viktorin added the comment: The test is already skipped if the user is root. It verifies that process 1 can't be touched by non-root users. The problem is an assumption that process with PID 1 belongs to root. That assumption isn't true in containers: PID 1 is whatever the container was

[issue16217] Tracebacks are unnecessarily verbose when using 'python -m'

2017-08-29 Thread Nick Coghlan
Nick Coghlan added the comment: Regarding directories and zipfiles, runpy._run_module_as_main also handles those - the CLI effectively transforms directory and zipfile execution into a "python -m __main__" call with a suitably adjusted sys.path[0] entry (i.e. the given directory or zip

[issue31299] Add "ignore_modules" option to TracebackException.format()

2017-08-29 Thread Dmitry Kazakov
Changes by Dmitry Kazakov : -- pull_requests: +3274 ___ Python tracker ___ ___

To mock/patch or not to, was Re: doctest random output?

2017-08-29 Thread Peter Otten
Steven D'Aprano wrote: > Wait... are you saying that importing test_mymodule monkey-patches the > current library? And doesn't un-patch it afterwards? That's horrible. There's something in the library, unittest.mock that makes this relatively safe -- if not painless with

[issue31243] checks whether PyArg_ParseTuple returned a negative int

2017-08-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- stage: needs patch -> backport needed ___ Python tracker ___

[issue31243] checks whether PyArg_ParseTuple returned a negative int

2017-08-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset ba7d7365215d791025d1efd25393c91404f2cfc8 by Serhiy Storchaka (Oren Milman) in branch 'master': bpo-31243: Fixed PyArg_ParseTuple failure checks. (#3171) https://github.com/python/cpython/commit/ba7d7365215d791025d1efd25393c91404f2cfc8

[issue854511] Thai encoding alias for 'cp874'

2017-08-29 Thread era
era added the comment: Closing the entire enhancement request just because one detail is off seems insane. Anyway, until the day in the distant future when Python can support encoding names in common circulation, http://stackoverflow.com/a/1064191/874188 offers a crude workaround. import

Re: doctest random output?

2017-08-29 Thread Chris Angelico
On Tue, Aug 29, 2017 at 5:39 PM, Steven D'Aprano wrote: > On Tue, 29 Aug 2017 12:25:45 +1000, Chris Angelico wrote: > >> For a lot of functions, this completely destroys the value of >> doctesting. > > > "The" value? Doc tests have two values: documentation

[issue16217] Tracebacks are unnecessarily verbose when using 'python -m'

2017-08-29 Thread Nick Coghlan
Nick Coghlan added the comment: Aye, separating the two discussions is a good idea. I've filed https://bugs.python.org/issue31299 for the traceback RFE, and added it as a dependency here. -- dependencies: +Add "ignore_modules" option to TracebackException.format()

[issue31299] Add "ignore_modules" option to TracebackException.format()

2017-08-29 Thread Nick Coghlan
New submission from Nick Coghlan: This is a proposed traceback module enhancement deriving from the "python -m" traceback verbosity discussion in issue 16217. Specifically, I'm thinking a good way of cleaning up those tracebacks would be to use `TracebackException.format()` to get the

Re: doctest random output?

2017-08-29 Thread Steven D'Aprano
On Tue, 29 Aug 2017 12:25:45 +1000, Chris Angelico wrote: > On Tue, Aug 29, 2017 at 11:53 AM, Steve D'Aprano > wrote: >> (1) Disable doctesting for that example, and treat it as just >> documentation: >> >> def my_thing(): >> """blah blah blah >> >> >>>

Swig and distutils

2017-08-29 Thread Оlе Ѕtrеісhеr
Hi, I want to write a setup.py for a module from a swig source. The recommended way [1] does not work because it does not process the generated Python file. Searching on Stackoverflow gives an (ugly) workaround and the hint "this may be considered as a bug" [2]. However, I couldn't find a

Re: a heisenbug

2017-08-29 Thread Peter Otten
Steve D'Aprano wrote: > On Tue, 29 Aug 2017 07:09 am, Peter Otten wrote: > >> The lesson is that if you use a (sub)module you should never rely on an >> implicit import. > > ... unless the module is documented as automatically importing the > submodule. An example is os.path. os.path is the