[issue32070] Clarify the behavior of the staticmethod builtin

2018-12-23 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue35105] Document that CPython accepts "invalid" identifiers

2018-12-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: I don't think we can mark this as an implementation detail for setattr(). The details are downstream and determined by the target object, not by setattr() itself. Suggested wording: ''' Note, setattr() attempts to update the object with the given

[issue30561] sync-up gammavariate and expovariate code

2018-12-23 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue35568] Expose the C raise() function in the signal module, for use on Windows

2018-12-23 Thread Vladimir Matveev
Change by Vladimir Matveev : -- nosy: +v2m ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35575] Improved range syntax

2018-12-23 Thread Steven D'Aprano
Steven D'Aprano added the comment: These proposals probably should be discussed on Python-Ideas first. You should also familiarize yourself with previous proposals to enhance range, such as https://mail.python.org/pipermail/python-ideas/2018-November/054510.html and the bug report #35200

[issue35574] Coconut support

2018-12-23 Thread Steven D'Aprano
Steven D'Aprano added the comment: One more thing: if you intend to proceed with this, either as individual enhancements or a PEP, you should discuss them on the Python-Ideas mailing list first, to see how much or little community support the proposals have. Until then, I'm closing this as

[issue35573] is_HDN is returns false positive and false negative value for two test cases respectively

2018-12-23 Thread Divya Rani
Divya Rani added the comment: The function link is here: https://github.com/python/cpython/blob/e42b705188271da108de42b55d9344642170aa2b/Lib/http/cookiejar.py#L521 The function returned true for "foo!bar.com" which is false positive and the test case is taken from the list of invalid domain

[issue35574] Coconut support

2018-12-23 Thread Steven D'Aprano
Steven D'Aprano added the comment: Do you have agreement from the maintainer(s) of Coconut that they are willing to put Coconut into the Python language and/or std library? Given that Coconut is effectively a radically different language from Python (a superset of Python) this is not a

[issue35576] function splitextTest does not return expected value

2018-12-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: As Karthikeyan said, (1) is a duplicate of issue35538. This is expected behavior. (2) is a duplicate of issue35183 which is still discussed. I do not know what relations do tests for third-party Java library have with the Python stdlib. Note that that

[issue35573] is_HDN is returns false positive and false negative value for two test cases respectively

2018-12-23 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: > What is the module "cookiejar" you are importing? Is that a third-party > module? It doesn't seem to be in the standard library. There is a module > `http.cookiejar` but it doesn't seem to have an `is_HDN` function. is_HDN does exist in

RE: random choice from dictionary

2018-12-23 Thread Avi Gross
I did say some would use enumerate but I was rushing to go to my nephews wedding and my enum became emum which is meaningless  If the goal is to make a relatively efficient algorithm and the index made by enumerate is not needed, then I judged that the overhead of enumerate(data) returning

[issue35576] function splitextTest does not return expected value

2018-12-23 Thread Steven D'Aprano
Steven D'Aprano added the comment: Please provide a proper reproducible bug report. Don't make us GUESS what function you are referring to. I don't know any "splitextTest" function that you describe in the bug report title. Do you mean os.path.splitext? Then you should say so. If not, then

[issue35576] function splitextTest does not return expected value

2018-12-23 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Thanks for the report > 1. For input ".blah." output is "." Please see issue35538 > 2. For input "..." output is "..." Please find the tests at https://github.com/python/cpython/blob/master/Lib/test/test_posixpath.py#L111 For completeness

[issue35573] is_HDN is returns false positive and false negative value for two test cases respectively

2018-12-23 Thread Steven D'Aprano
Steven D'Aprano added the comment: What is the module "cookiejar" you are importing? Is that a third-party module? It doesn't seem to be in the standard library. There is a module `http.cookiejar` but it doesn't seem to have an `is_HDN` function. If this is a third-party library, please

[issue33661] urllib may leak sensitive HTTP headers to a third-party web site

2018-12-23 Thread Emmanuel Arias
Emmanuel Arias added the comment: Hi!, Like say Katsuhiko YOSHIDA (https://github.com/python/cpython/pull/11292#issuecomment-449667371) this should be filter other sensitive header. I think that is reasonable if we think on a complete solution to this issue. Maybe this issue could be

[issue34764] Improve documentation example for using iter() with sentinel value

2018-12-23 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

Re: random choice from dictionary

2018-12-23 Thread sarah123ed
Maybe something like this: import random k = list(data.keys()) random.shuffle(k) result = data[k[0]] -- https://mail.python.org/mailman/listinfo/python-list

[issue35566] DOC: Add links to annotation glossary term

2018-12-23 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

Re: random choice from dictionary

2018-12-23 Thread sarah123ed
Maybe something like this? import random k = list(data.keys()) random.shuffle(k) selected = f[k[0]] -- https://mail.python.org/mailman/listinfo/python-list

[issue35576] function splitextTest does not return expected value

2018-12-23 Thread Divya Rani
New submission from Divya Rani : 1. For input ".blah." output is "." 2. For input "..." output is "..." results produced by the function are wrong according to the test suite provided by guava. 1.

[issue35573] is_HDN is returns false positive and false negative value for two test cases respectively

2018-12-23 Thread Divya Rani
Divya Rani added the comment: import cookiejar cookiejar.is_HDN("foo!bar.com") Output: True cookiejar.is_HDN("woo.com.") Output: False Test cases taken from: 1.

[issue33678] selector_events.BaseSelectorEventLoop.sock_connect should preserve socket type

2018-12-23 Thread twisteroid ambassador
twisteroid ambassador added the comment: Looks like this bug is also cause by using _ensure_resolved() more than once for a given host+port, so it can probably be fixed together with https://bugs.python.org/issue35545 . Masking sock.type should not be necessary anymore since

[issue35573] is_HDN is returns false positive and false negative value for two test cases respectively

2018-12-23 Thread Karthikeyan Singaravelan
New submission from Karthikeyan Singaravelan : Can you please add a reproducible test case and a description to the issue explaining expected behavior and actual behavior? Thanks -- nosy: +xtreak ___ Python tracker

[issue35575] Improved range syntax

2018-12-23 Thread Solomon Ucko
New submission from Solomon Ucko : 3 independent but related proposals. (#4 requires #3.) The main issue for #2 and #4 is the readability of a mix of square and round brackets, especially within nested brackets. This would be less of an issue with [Coconut

[issue35574] Coconut support

2018-12-23 Thread Solomon Ucko
New submission from Solomon Ucko : Any chance we could integrate [Coconut](http://coconut-lang.org/) into Python? Any sain Python code should work with Coconut and Coconut allows making code *so* much more readable. IMO, the reason not many people use Coconut is that they haven't heard of it

[issue35573] is_HDN is returns false positive and false negative value for two test cases respectively

2018-12-23 Thread Divya Rani
Change by Divya Rani : -- components: Library (Lib) nosy: Divya Rani priority: normal severity: normal status: open title: is_HDN is returns false positive and false negative value for two test cases respectively type: behavior versions: Python 3.6

[issue35121] Cookie domain check returns incorrect results

2018-12-23 Thread Ned Deily
Change by Ned Deily : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35121] Cookie domain check returns incorrect results

2018-12-23 Thread Ned Deily
Change by Ned Deily : -- keywords: +security_issue priority: normal -> high ___ Python tracker ___ ___ Python-bugs-list mailing

[issue35572] Logging module cleanup

2018-12-23 Thread Ned Deily
Change by Ned Deily : -- nosy: +vinay.sajip versions: -Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7 ___ Python tracker ___

Re: random choice from dictionary

2018-12-23 Thread Ben Bacarisse
"Avi Gross" writes: > The following is a function that iterates over the dictionary one key at a > time and when it reaches a random one, it returns the key without further > evaluation. On the average, it takes N/2 iterations for N keys. Asking to > make a list(data) may be efficient in terms

[issue35572] Logging module cleanup

2018-12-23 Thread Solomon Ucko
New submission from Solomon Ucko : The logging module should be changed to use snake_case (as opposed to camelCase). Also, logger.basicConfig should list keyword arguments and defaults in the argument list, as opposed to using `**kwargs` and `dict.pop` (for readability and improved

[issue30802] datetime.datetime.strptime('200722', '%Y%U')

2018-12-23 Thread Sergey Bon.
Sergey Bon. added the comment: Not following msg332388 would lead to this: # Sunday of the week 53 >>> datetime.strptime ('2017 Sun 53', '%Y %a %U') datetime.datetime(2017, 12, 31, 0, 0) # First day of the week 53 # oops! assumed Monday is the first day of the week but 2017 ends on Sunday

[issue30802] datetime.datetime.strptime('200722', '%Y%U')

2018-12-23 Thread Sergey Bon.
Sergey Bon. added the comment: Documentation says: %U - Week number of the year (Sunday as the first day of the week) %W - Week number of the year (Monday as the first day of the week) It wouldn't be intuitive if %U assumed Sunday when weekday provided and Monday otherwise. There are two

Re: Why am I getting Error 405 while uploading my package to https://test.pypi.org/legacy?

2018-12-23 Thread ant
sntshkm...@gmail.com wrote: >> did you check your dists via twine? >> >> $ twine check --verbose dist/* > > I checked with `twine check dist/*` (there's no --verbose option though). > I only get warning about markdown right, i see later in my history i used the twine check without the

Re: Why am I getting Error 405 while uploading my package to https://test.pypi.org/legacy?

2018-12-23 Thread sntshkmr60
> did you check your dists via twine? > > $ twine check --verbose dist/* I checked with `twine check dist/*` (there's no --verbose option though). I only get warning about markdown > also make sure you are using up to date versions of > setuptools, wheel and twine > > > $ pip install

ANN: NumExpr 2.6.9

2018-12-23 Thread Robert McLeod
Hi everyone, This is a version-bump release to provide wheels for Python 3.7.1 on Windows platforms. Also Mike Toews made the handling of our environment variables more robust. Project documentation is available at: http://numexpr.readthedocs.io/ Changes from 2.6.8 to 2.6.9

[issue35208] IDLE: Squeezed line count ignores wrapping before newline

2018-12-23 Thread Terry J. Reedy
Terry J. Reedy added the comment: The specific bug being fixed here is that wrapped lines before newline are ignored because after if s[pos] == '\n': linecount += 1 current_column = 0 this block if current_column > 0: lines, column =

Re: Why am I getting Error 405 while uploading my package to https://test.pypi.org/legacy?

2018-12-23 Thread ant
sntshkm...@gmail.com wrote: >> .pypirc >>= >> [distutils] >> index-servers= >> testpypi >> >> [testpypi] >> repository: https://test.pypi.org/legacy/ >> username: UserName >> password: Password > > >> twine upload --repository testpypi dist/* > > Tried your suggestion for .pypirc file.

[issue35555] IDLE: Gray out Code Context on non-editor windows

2018-12-23 Thread Terry J. Reedy
Terry J. Reedy added the comment: Thank you. The backport is PR 11300. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue24814] Idle: Disable menu items when not applicable

2018-12-23 Thread Cheryl Sabella
Cheryl Sabella added the comment: #3 - Show/Hide Code Context -- dependencies: +IDLE: Gray out Code Context on non-editor windows nosy: +cheryl.sabella versions: +Python 3.7, Python 3.8 -Python 2.7, Python 3.5, Python 3.6 ___ Python tracker

[issue35555] IDLE: Gray out Code Context on non-editor windows

2018-12-23 Thread Terry J. Reedy
Change by Terry J. Reedy : -- versions: +Python 3.7 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

Re: random choice from dictionary

2018-12-23 Thread MRAB
On 2018-12-23 19:52, Avi Gross wrote: There are quite a few places the new pythonic way of doing things requires extra steps to get an iterator to expand into a list so Abdul-Rahmann probably is right that there is no easy way to get a random key from a standard dictionary. Other than the

Re: Why am I getting Error 405 while uploading my package to https://test.pypi.org/legacy?

2018-12-23 Thread sntshkmr60
> .pypirc >= > [distutils] > index-servers= > testpypi > > [testpypi] > repository: https://test.pypi.org/legacy/ > username: UserName > password: Password > twine upload --repository testpypi dist/* Tried your suggestion for .pypirc file. Still the same error. Has something changed

Re: Why am I getting Error 405 while uploading my package to https://test.pypi.org/legacy?

2018-12-23 Thread ant
ant wrote: ... > .pypirc >= > [distutils] > index-servers= > testpypi > > [testpypi] > repository: https://test.pypi.org/legacy/ > username: UserName > password: Password >= > > > and my upload command is: > > >= > #!/bin/sh > # > # upload ngfp to test pypi > >

[issue35570] 2to3 creates code using deprecated imp module

2018-12-23 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Seems this came up when the original version of fixer was added as noted in https://bugs.python.org/issue11797#msg206884 . Looking further this seems to be similar to https://bugs.python.org/issue21446 where it was fixed in 3.7 and master to use

Re: Why am I getting Error 405 while uploading my package to https://test.pypi.org/legacy?

2018-12-23 Thread ant
sntshkm...@gmail.com wrote: > I'm trying to upload my package to PyPi, but before that I wanted to upload > my package to TestPyPi. > > I'm following https://packaging.python.org/guides/using-testpypi/ > > I'm issuing this command: `twine upload --repository-url > https://test.pypi.org/legacy/

RE: random choice from dictionary

2018-12-23 Thread Avi Gross
There are quite a few places the new pythonic way of doing things requires extra steps to get an iterator to expand into a list so Abdul-Rahmann probably is right that there is no easy way to get a random key from a standard dictionary. Other than the expected answers to make a customized

Why am I getting Error 405 while uploading my package to https://test.pypi.org/legacy?

2018-12-23 Thread sntshkmr60
I'm trying to upload my package to PyPi, but before that I wanted to upload my package to TestPyPi. I'm following https://packaging.python.org/guides/using-testpypi/ I'm issuing this command: `twine upload --repository-url https://test.pypi.org/legacy/ dist/*` Here is the output: ``` Enter

[issue28108] Python configure fails to detect tzname on platforms that have it.

2018-12-23 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: The resolution of this [1] glibc bug report effectively says that the use of global variables tzname, timezone and daylight is not supported by glibc unless a POSIX-style TZ setting is used (which is probably never in real world). [1]

[issue35537] use os.posix_spawn in subprocess

2018-12-23 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: > * cwd posix_spawn_file_actions_addchdir_np() is scheduled for glibc 2.29 [1] and exists in Solaris [2] (though its suffix indicates that it's "non-portable" -- not in POSIX). POSIX also has a bug for this [7]. > * start_new_session

[issue35571] Parallel Timeout Class

2018-12-23 Thread Stefan Volz
New submission from Stefan Volz : Hello, I'm currently writing my finals project using Python and needed a feature that threading.Timer could nearly but not quite fulfill: Execute a function after given time *with arguments provided and have the timer resettable*. So I did it myself and

[SOLVED] Re: ah, progress...

2018-12-23 Thread ant
dieter wrote: ... thank you for your help. :) i finally worked through the changes needed at last. my current package in testing PyPI is at: https://test.pypi.org/project/ngfp/ which uses my code from: https://salsa.debian.org/ant-guest/gfpoken-in-python i ended up needing

[issue35567] Convert membership test from dict-of-constants to a set

2018-12-23 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue35569] OSX: Enable IPV6_RECVPKTINFO

2018-12-23 Thread Ronald Oussoren
Ronald Oussoren added the comment: #include in the macOS 10.14 SDK says: /* * RFC 3542 define the following socket options in a manner incompatible * with RFC 2292: * IPV6_PKTINFO * IPV6_HOPLIMIT * IPV6_NEXTHOP * IPV6_HOPOPTS * IPV6_DSTOPTS * IPV6_RTHDR * * To use the

[issue35567] Convert membership test from dict-of-constants to a set

2018-12-23 Thread Cheryl Sabella
Change by Cheryl Sabella : -- keywords: +patch pull_requests: +10526 stage: -> patch review ___ Python tracker ___ ___

Re: Mask two images with python

2018-12-23 Thread Umar Yusuf
On Wednesday, 19 December 2018 06:36:01 UTC+1, Umar Yusuf wrote: > Hello there, > How do I supper impose an image design on a transparent png image? > > I have tried to use OpenCV's "cv2.bitwise_and" function to no success. I > posted the detail question here: >

[issue35570] 2to3 creates code using deprecated imp module

2018-12-23 Thread Hanno Boeck
New submission from Hanno Boeck : 2to3 (in python 3.6.6) will rewrite the reload function to use the imp module. However according to [1] "Deprecated since version 3.4: The imp package is pending deprecation in favor of importlib." Also running the code with warnings enabled will show a

[issue35569] OSX: Enable IPV6_RECVPKTINFO

2018-12-23 Thread chrysn
New submission from chrysn : Python builds on MacOS do not expose the IPV6_RECVPKTINFO flag specified in [RFC3842], which is required for UDP protocols that need control over their servers' sending ports like [CoAP]. While I don't own Apple hardware and thus can't test it, the [nginx] code

[issue35564] [DOC] Sphinx 2.0 will require master_doc variable set in conf.py

2018-12-23 Thread jfbu
jfbu added the comment: sorry for previous message whose text mentioned the GitHub pull request number but this links to bpo issue of that number, of course completely unrelated -- pull_requests: +10525 ___ Python tracker

[issue35564] [DOC] Sphinx 2.0 will require master_doc variable set in conf.py

2018-12-23 Thread jfbu
Change by jfbu : -- pull_requests: -10524 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35564] [DOC] Sphinx 2.0 will require master_doc variable set in conf.py

2018-12-23 Thread jfbu
jfbu added the comment: GitHub PR #11290 has been merged into master -- keywords: +patch pull_requests: +10524 stage: -> patch review ___ Python tracker ___

[issue35208] IDLE: Squeezed lines count ignores window width

2018-12-23 Thread Tal Einat
Tal Einat added the comment: > Part of my thinking with the simple auto-squeeze formula, besides just > simplifying the code, it this. Raymond claimed that squeezing slows down > printing. If measurably true, one way to avoid a slow down would be to use a > simple heuristic formula to

[issue35564] [DOC] Sphinx 2.0 will require master_doc variable set in conf.py

2018-12-23 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +mdk ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32067] Deprecate accepting unrecognized braces in regular expressions

2018-12-23 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> rejected stage: patch review -> resolved status: open -> closed ___ Python tracker ___

Re: random choice from dictionary

2018-12-23 Thread Abdur-Rahmaan Janhangeer
random.choice(list(data)) is great. fine with arbitrary selection. else, given data.keys(), how do i get the first key? yours -- Abdur-Rahmaan Janhangeer http://www.pythonmembers.club | https://github.com/Abdur-rahmaanJ Mauritius

Re: random choice from dictionary

2018-12-23 Thread Chris Angelico
On Sun, Dec 23, 2018 at 7:34 PM Abdur-Rahmaan Janhangeer wrote: > > greetings, > > just a check, is this: > > random.choice(list(data.keys())) > > the only way to get a random key from a dictionary? if not any plan to a > more convenient naming? Does it have to be truly random, or are you okay

random choice from dictionary

2018-12-23 Thread Abdur-Rahmaan Janhangeer
greetings, just a check, is this: random.choice(list(data.keys())) the only way to get a random key from a dictionary? if not any plan to a more convenient naming? yours, -- Abdur-Rahmaan Janhangeer http://www.pythonmembers.club | https://github.com/Abdur-rahmaanJ Mauritius