[issue33292] Fix secrets.randbelow docstring

2018-04-17 Thread Vex Woo
Vex Woo added the comment: Please use () or [] -- ___ Python tracker ___ ___

RE: Python Import Impossibility

2018-04-17 Thread 森平 直樹
Steven, I would like to modify then following: (Error) ‘py -m install openpyxl’ (Correct) ‘py -m pip install openpyxl’ Sorry for my carelessness. Best Regards, - Naoki Morihira TEL: 01181-90-6460-6265 - 差出人: 森平 直樹 送信日時:

[issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests)

2018-04-17 Thread INADA Naoki
New submission from INADA Naoki : https://github.com/python/cpython/blob/5fbc511f56688654a05b9eba23d140318bb9b2d5/Lib/test/test_urllib2net.py#L180-L198 This test uses http://www.imdb.com/, but it is gone. So This test start failing. Is there any good URL for this test

[issue33296] datetime.datetime.utcfromtimestamp call decimal causes precision loss

2018-04-17 Thread Shlomo Anglister
Shlomo Anglister added the comment: The test code demonstrates that fromutctimestamp(1523510588.436252000) != fromutctimestamp(Decimal(1523510588.436252000)) This is related to issues: 22627 and 23607 but not a duplicate --

[issue33294] Support complex expressions for py-print command.

2018-04-17 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +6199 stage: -> patch review ___ Python tracker ___

[issue33296] datetime.datetime.utcfromtimestamp call decimal causes precision loss

2018-04-17 Thread Shlomo Anglister
New submission from Shlomo Anglister : Output for python2.7.11 2018-04-12-05:23:08.436252 2018-04-12-05:23:08.436252 Output for python3.4 and python3.6 2018-04-12-05:23:08.436252 2018-04-12-05:23:08.00 -- components: Library (Lib) files:

[issue15443] datetime module has no support for nanoseconds

2018-04-17 Thread Shlomo Anglister
Change by Shlomo Anglister : -- nosy: +anglister ___ Python tracker ___ ___

RE: Python Import Impossibility

2018-04-17 Thread 森平 直樹
Steven, When I installed ‘openpyxl’, there is no error message in the command prompt screen. So I think that my installation is successfully completed. I installed by typing ‘py -m install openpyxl’. In my PC, python is installed in the following folder:

[issue33205] GROWTH_RATE prevents dict shrinking

2018-04-17 Thread miss-islington
Change by miss-islington : -- pull_requests: +6198 ___ Python tracker ___

Re: Can I execute a python code written in Python 2.7 (using numpy and tensor flow executed in linux) in Winpython 3.6 on Windows?

2018-04-17 Thread Terry Reedy
On 4/17/2018 1:00 AM, Rishika Sen wrote: Here is the code that has been written in Python 2.7, numpy, tensorflow: https://drive.google.com/open?id=1JZe7wfRcdlEF6Z5C0ePBjtte_2L4Kk-7 One must 'sign in' to read this. Can you please let me know what changes I have to make to execute it on

[issue33294] Support complex expressions for py-print command.

2018-04-17 Thread Martin Liška
New submission from Martin Liška : The patch is based on a blog post: http://kouk.surukle.me/2014/09/25/debugging-python-objects-and-fields-with-gdb/. Adding him: @kouk Purpose of the pull request is to support more complex expressions for py-print command. Small

[issue33205] GROWTH_RATE prevents dict shrinking

2018-04-17 Thread INADA Naoki
INADA Naoki added the comment: New changeset 5fbc511f56688654a05b9eba23d140318bb9b2d5 by INADA Naoki in branch 'master': bpo-33205: dict: Change GROWTH_RATE to `used*3` (GH-6350) https://github.com/python/cpython/commit/5fbc511f56688654a05b9eba23d140318bb9b2d5

Re: Python Import Impossibility

2018-04-17 Thread Thomas Jollans
On 2018-04-17 08:35, 森平 直樹 wrote: > I installed by typing ‘py -m pip install openpyxl’. > > > > In my PC, python is installed in the following folder: > > C:\Users\N.Morihira\AppData\Local\Programs\Python\Python36-32 > > But old version is left in the following folder: > > C:\Python27 >

[issue32886] new Boolean ABC in numbers module

2018-04-17 Thread Sylvain Marie
Sylvain Marie added the comment: Mark I get your point. Mine is just to have a common abstraction between python's primitive bool and numpy bool (and possibly other future alternate booleans) for consistency with `numbers` and to be used in common type

[issue33283] Mention PNG as a supported image format by Tcl/Tk

2018-04-17 Thread miss-islington
miss-islington added the comment: New changeset f44ce356a6ccd6c8e80ac5c4b29adb13db5c117a by Miss Islington (bot) in branch '3.6': bpo-33283: Mention PNG as a supported format by Tcl/Tk. (GH-6479)

Problem in extracting and saving multi-dimensional time series data from netcdf file to csv file

2018-04-17 Thread shalu . ashu50
Hi All, I am using winpython spyder 3.6. I am trying to extract a variable with their time series values (daily from 1950 to 2004). The data structure is as follows: Dimensions: (bnds: 2, lat: 90, lon: 144, time: 20075) Coordinates: * lat (lat) float64 -89.0 -87.0 -85.0 -83.0

[issue32232] building extensions as builtins is broken in 3.7

2018-04-17 Thread Nick Coghlan
Nick Coghlan added the comment: Ah, oops - I commented before fully catching up on everything else, and now I see that Xavier already made exactly that point just above. I'll go review the PR now :) -- ___ Python tracker

[issue33297] Mention Pillow package on tkinter.rst to work with more image formats

2018-04-17 Thread Andrés Delfino
Change by Andrés Delfino : -- keywords: +patch pull_requests: +6201 stage: -> patch review ___ Python tracker ___

[issue33297] Mention Pillow package on tkinter.rst to work with more image formats

2018-04-17 Thread Andrés Delfino
New submission from Andrés Delfino : Given that the default list of supported formats is quite limited, IMHO we should point to Pillow, or any other package that provides support for more formats. -- assignee: docs@python components: Documentation messages: 315393

[issue33251] ConfigParser.items returns items present in vars

2018-04-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What *actually* was changed in 3.2? -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue32232] building extensions as builtins is broken in 3.7

2018-04-17 Thread Nick Coghlan
Nick Coghlan added the comment: Even when statically linked, extension modules should *NOT* be getting built with `-DPy_BUILD_CORE`. That preprocessor definition is for CPython core core only, and we moved the headers to help make that 100% crystal clear. --

How to save multi-dimentional array values into CSV/Test file

2018-04-17 Thread shalu . ashu50
Hi All, I am using winpy 6.3 I have this array: code: clt_subset = nc.variables['clt'][:,latli:latui , lonli:lonui] print(clt_subset): [[[ 96.07967377 32.581317930.86773872 ..., 99.6185 99.7711 99.7711] [ 93.75789642 86.78536987 46.51786423 ..., 99.99756622

[issue19143] Finding the Windows version getting messier (detect windows 8.1?)

2018-04-17 Thread Mahmud Al Hasan
Mahmud Al Hasan added the comment: The problem still exists on python 3.4 and I need to use this version. Any solution? -- nosy: +rauaha versions: -Python 2.7, Python 3.5, Python 3.6 ___ Python tracker

[issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests)

2018-04-17 Thread INADA Naoki
Change by INADA Naoki : -- keywords: +patch pull_requests: +6200 stage: -> patch review ___ Python tracker ___

[issue19143] Finding the Windows version getting messier (detect windows 8.1?)

2018-04-17 Thread Mark Lawrence
Change by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___

[issue33292] Fix secrets.randbelow docstring

2018-04-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I don't think that intervals [0, n-1] or (-1, n) would look better than [0, n). -- resolution: -> not a bug stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue33189] pygettext doesn't work with f-strings

2018-04-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If there are no objections I'm going to merge PR 6364 in 24 hours. -- assignee: -> serhiy.storchaka nosy: +lemburg ___ Python tracker

Re: How to save xarray data to csv

2018-04-17 Thread Rhodri James
On 17/04/18 03:25, shalu.ash...@gmail.com wrote: My question is how can i save multi-dimentional (3d: time series values, lat, long) data (xarrays) into csv. What do you want each line of the CSV file to look like? That's the key question. Once you know that you can arrange your data into

[issue33297] Mention Pillow package on tkinter.rst to work with more image formats

2018-04-17 Thread Andrés Delfino
Change by Andrés Delfino : -- type: -> enhancement ___ Python tracker ___ ___

[issue33292] Fix secrets.randbelow docstring

2018-04-17 Thread Steven D'Aprano
Steven D'Aprano added the comment: Possibly you may not be familiar with interval notation? https://www.mathsisfun.com/sets/intervals.html Since this is Python and not maths, maybe we should rethink the wording. -- ___

tkinter frame not expanding to fit window?

2018-04-17 Thread Zobeid Zuma
I've just started working through the tutorial here → http:// www.tkdocs.com/tutorial/firstexample.html and I already hit some behavior that I don't understand. The frame doesn't expand when I resize the window! The tutorial says these lines should do it: mainframe.columnconfigure(0,

[issue19143] Finding the Windows version getting messier (detect windows 8.1?)

2018-04-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Does the problem still exist on Python 3.6? Python 3.4 is now in security fixes only mode. The only solution for you may be upgrading to Python 3.6. -- ___ Python tracker

[issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests)

2018-04-17 Thread Ned Deily
Ned Deily added the comment: New changeset f7379ddf1c315fe18734cca943aff5b437baf849 by Ned Deily (Miss Islington (bot)) in branch '3.7': bpo-33295: Skip test using missing external site (GH-6504) (GH-6509)

[issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests)

2018-04-17 Thread miss-islington
Change by miss-islington : -- pull_requests: +6203 ___ Python tracker ___

[issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests)

2018-04-17 Thread Berker Peksag
Berker Peksag added the comment: I initially thought about using pythontest.net but I don't think it's possible to remove the Connection header at the nginx level: https://github.com/python/psf-salt/blob/master/salt/pythontest/config/nginx.pythontest.conf.jinja I

Most pythonic way to implement byte stuffing algorithm

2018-04-17 Thread Travis Griggs
I posted this on SO, but… yeah… I'm doing some serial protocol stuff and want to implement a basic byte stuffing algorithm in python. Though really what this really generalizes to is “what is the most pythonic way to transform one sequence of bytes where some bytes are passed through 1:1, but

[issue33298] Wrap only constants with _PyCode_ConstantKey() in the compiler.

2018-04-17 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +6205 stage: -> patch review ___ Python tracker ___

[issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests)

2018-04-17 Thread Ned Deily
Ned Deily added the comment: New changeset afc768d69879d6b95c59a0a5e92ea4c6061f3841 by Ned Deily (Miss Islington (bot)) in branch '2.7': bpo-33295: Skip test using missing external site (GH-6504) (GH-6510)

[issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests)

2018-04-17 Thread Ned Deily
Ned Deily added the comment: Thanks! I force-merged the skips of the test so that Travis CI and buildbots were not failing. I'll leave the issue open so we can decide what to do about the test long term. -- ___ Python tracker

[issue33298] Wrap only constants with _PyCode_ConstantKey() in the compiler.

2018-04-17 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +vstinner ___ Python tracker ___ ___

[issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests)

2018-04-17 Thread miss-islington
Change by miss-islington : -- pull_requests: +6202 ___ Python tracker ___

RE: Python Import Impossibility

2018-04-17 Thread 森平 直樹
Thomas, I installed by typing the following command in the MS-Windows command prompt screen. ‘py -m pip install openpyxl’. Best Regards, - Naoki Morihira TEL: 01181-90-6460-6265 - 差出人: Python-list

[issue33144] random._randbelow optimization

2018-04-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset ba3a87aca37cec5b1ee32cf68f4a254fa0bb2bec by Raymond Hettinger (Wolfgang Maier) in branch 'master': bpo-33144: random.Random and subclasses: split _randbelow implementation (GH-6291)

[issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests)

2018-04-17 Thread miss-islington
Change by miss-islington : -- pull_requests: +6204 ___ Python tracker ___

[issue33298] Wrap only constants with _PyCode_ConstantKey() in the compiler.

2018-04-17 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Currently every constant is wrapped with _PyCode_ConstantKey() in the compiler. This is necessary for distinguishing numbers 1, 1.0 and 1.0+0j, 0.0 and -0.0, and avoiding warnings from comparing string and bytes constants.

[issue33290] Python.org macOS pkg installs pip3 as pip

2018-04-17 Thread Gilbert Wilson
Gilbert Wilson added the comment: Well what do you know, it does indeed look like a pip3 upgrade issue! I'll wander over to the pip issue tracker and file a bug/upvote over there. Thanks! gilw-mbp:bin gilw$ ls -al pip* -rwxrwxr-x 1 root admin 253 Apr 17 09:21 pip3

[issue33144] random._randbelow optimization

2018-04-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: Possibly, the switch from type checks to identity checks could be considered a bugfix that could be backported. I've always had a lingering worry about that part of the code. --

[issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests)

2018-04-17 Thread Ned Deily
Ned Deily added the comment: New changeset 36d56ea826caffbeac0fc0c6d90248b80516e33c by Ned Deily (INADA Naoki) in branch 'master': bpo-33295: Skip test using missing external site (GH-6504) https://github.com/python/cpython/commit/36d56ea826caffbeac0fc0c6d90248b80516e33c

[issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests)

2018-04-17 Thread Ned Deily
Ned Deily added the comment: New changeset f1547d110ff195291e29ba5c29617912d12ecbec by Ned Deily (Miss Islington (bot)) in branch '3.6': bpo-33295: Skip test using missing external site (GH-6504) (GH-6511)

[issue33299] Return an object itself for some types in _PyCode_ConstantKey()

2018-04-17 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : _PyCode_ConstantKey() wraps a constant into a tuple that contains other items besides the wrapped object. This makes booleans different from 0 and 1, makes numbers of different type different (1, 1.0 and 1.0+0j), makes

[issue33299] Return an object itself for some types in _PyCode_ConstantKey()

2018-04-17 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +vstinner ___ Python tracker ___ ___

[issue33299] Return an object itself for some types in _PyCode_ConstantKey()

2018-04-17 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +6206 stage: -> patch review ___ Python tracker ___

[issue33298] Wrap only constants with _PyCode_ConstantKey() in the compiler.

2018-04-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See issue33299 for the first option. -- ___ Python tracker ___

Finding set difference between ranges

2018-04-17 Thread tejaswi prakash
Hello all, I have 3 continuous (steps of 1) ranges a,a1,a2. All of them sorted. I am performing the following operations on them a = a.difference (a1) a = a.difference(a2) Now, this doesn't seem to make use of the fact that 1. They are sorted 2. They increase in steps of 1 . Could someone

[issue33262] Deprecate shlex.split(None) to read from stdin.

2018-04-17 Thread Zackery Spytz
Change by Zackery Spytz : -- components: +Library (Lib) nosy: +ZackerySpytz ___ Python tracker ___

[issue33262] Deprecate shlex.split(None) to read from stdin.

2018-04-17 Thread Zackery Spytz
Change by Zackery Spytz : -- keywords: +patch pull_requests: +6207 stage: needs patch -> patch review ___ Python tracker ___

[issue33300] Bad usage example in id() DocString

2018-04-17 Thread Glen Neff
New submission from Glen Neff : The DocString for id() in 3.5.x & 3.6.x seems to have an incorrect usage example, specifically ``id(obj, /)``. This is present in 3.5.x & 3.6.x. It does not appear to be present in 2.7.x or 3.4.x.: Python 3.6.4 (v3.6.4:d48eceb, Dec 19

Re: Most pythonic way to implement byte stuffing algorithm

2018-04-17 Thread Grant Edwards
On 2018-04-17, Travis Griggs wrote: > I posted this on SO, but… yeah… > > I'm doing some serial protocol stuff and want to implement a basic > byte stuffing algorithm in python. Though really what this really > generalizes to is “what is the most pythonic way to

[issue33205] GROWTH_RATE prevents dict shrinking

2018-04-17 Thread INADA Naoki
Change by INADA Naoki : -- resolution: -> fixed ___ Python tracker ___ ___

Re: Most pythonic way to implement byte stuffing algorithm

2018-04-17 Thread MRAB
On 2018-04-17 17:02, Travis Griggs wrote: I posted this on SO, but… yeah… I'm doing some serial protocol stuff and want to implement a basic byte stuffing algorithm in python. Though really what this really generalizes to is “what is the most pythonic way to transform one sequence of bytes

[issue33205] GROWTH_RATE prevents dict shrinking

2018-04-17 Thread miss-islington
miss-islington added the comment: New changeset 902bb62d5af21526b68892a1032c63aa86ded247 by Miss Islington (bot) in branch '3.7': bpo-33205: dict: Change GROWTH_RATE to `used*3` (GH-6350)

Python Import Impossibility

2018-04-17 Thread ?? ??
Hello, Could you tell me how to import the installed modules ? I have successfully installed openpyxl, but When I executed ‘import openpyxl’, The following message is displayed: Traceback (most recent call last): File "", line 1, in import openpyxl ModuleNotFoundError: No

Re: tkinter frame not expanding to fit window?

2018-04-17 Thread Peter Otten
Zobeid Zuma wrote: > I've just started working through the tutorial here → http:// > www.tkdocs.com/tutorial/firstexample.html and I already hit some behavior > that I don't understand. The frame doesn't expand when I resize the > window! The tutorial says these lines should do it: > >

Re: Most pythonic way to implement byte stuffing algorithm

2018-04-17 Thread Travis Griggs
> On Apr 17, 2018, at 11:15 AM, MRAB wrote: > > On 2018-04-17 17:02, Travis Griggs wrote: >> I posted this on SO, but… yeah… >> I'm doing some serial protocol stuff and want to implement a basic byte >> stuffing algorithm in python. Though really what this really

[issue33205] GROWTH_RATE prevents dict shrinking

2018-04-17 Thread INADA Naoki
Change by INADA Naoki : -- stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue33297] Mention Pillow package on tkinter.rst to work with more image formats

2018-04-17 Thread Terry J. Reedy
Change by Terry J. Reedy : -- nosy: +serhiy.storchaka, terry.reedy ___ Python tracker ___

Newbie ARGPARSE question

2018-04-17 Thread TUA
I just discovered ARGPARSE 5 minutes ago and cannot figure this one out: What does the Parser.add_argument() call have to look like when I need an option 'add' that requires the mandatory parameters 'type' (string), 'size' (int), 'sid' (string) and must also handle the optional parameters

Re: Fwd: Python Import Impossibility

2018-04-17 Thread Terry Reedy
On 4/17/2018 5:06 PM, Dan Stromberg wrote: Given that the list does not allow pictures, would it make sense to have the software that strips the pictures also send an e-mail to the picture sender indicating that pictures are disallowed? I see a lot of people responding individually saying that

Re: error from Popen only when run from cron

2018-04-17 Thread daniel . chmielewski
W dniu sobota, 27 stycznia 2018 16:59:50 UTC+1 użytkownik larry@gmail.com napisał: > I have a script that does this: > > subprocess.Popen(['service', 'some_service', 'status'], > stdout=subprocess.PIPE, stderr=subprocess.STDOUT) > > When I run it from the command line it works fine. When I

[issue19143] Finding the Windows version getting messier (detect windows 8.1?)

2018-04-17 Thread Steve Dower
Steve Dower added the comment: The attached files should work on Python 3.4. Feel free to use them. -- ___ Python tracker ___

[issue33234] Improve list() pre-sizing for inputs with known lengths

2018-04-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Calling PyObject_LengthHint() adds an overhead. It is significant for short sequences. I work on a patch that reduces it. PR 6493 adds the second call of PyObject_LengthHint() and increases the overhead. As for this issue,

[issue33293] Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp.

2018-04-17 Thread Brett Cannon
Brett Cannon added the comment: Are you seeing the same issue on Python 3.6.5? -- nosy: +belopolsky, brett.cannon ___ Python tracker

[issue33300] Bad usage example in id() DocString

2018-04-17 Thread Martin Panter
Martin Panter added the comment: It is supposed to be a function signature, similar to the syntax when you define your own function, rather than a usage example of calling the function. In this case, the slash notation is described by PEP 457. It is supposed to indicate

Fwd: Python Import Impossibility

2018-04-17 Thread Dan Stromberg
Given that the list does not allow pictures, would it make sense to have the software that strips the pictures also send an e-mail to the picture sender indicating that pictures are disallowed? I see a lot of people responding individually saying that images are stripped. It's looking like a bit

[issue33293] Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp.

2018-04-17 Thread Ned Deily
Ned Deily added the comment: Tim, do you think the docs should be changed and, if so, which sections? If you dictate, I'll type! -- ___ Python tracker

[issue33090] race condition between send and recv in _ssl with non-zero timeout

2018-04-17 Thread James Lu
Change by James Lu : -- nosy: +tacocat ___ Python tracker ___ ___ Python-bugs-list

[issue32533] SSLSocket read/write thread-unsafety

2018-04-17 Thread James Lu
Change by James Lu : -- nosy: +tacocat ___ Python tracker ___ ___ Python-bugs-list

[issue33301] Add __contains__ to pathlib

2018-04-17 Thread Alok Singh
New submission from Alok Singh : I was thinking today that it would be natural for paths to support __contains__ since then you could write statements like `if file in dir` or `if subdir in dir` cleanly. The library plumbum appears to already have this, but I think it

[issue33301] Add __contains__ to pathlib

2018-04-17 Thread Barry A. Warsaw
Change by Barry A. Warsaw : -- nosy: +barry ___ Python tracker ___ ___ Python-bugs-list

[issue11594] 2to3 does not preserve line endings

2018-04-17 Thread miss-islington
Change by miss-islington : -- pull_requests: +6208 ___ Python tracker ___

[issue11594] 2to3 does not preserve line endings

2018-04-17 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset c127a86e1862df88ec6f9d15b79c627fc616766e by Łukasz Langa (Aaron Ang) in branch 'master': bpo-11594: Ensure line-endings are respected when using 2to3 (GH-6483)

[issue33302] The search for pyvenv.cfg doesn't match PEP 405

2018-04-17 Thread Matthew Woodcraft
New submission from Matthew Woodcraft : PEP 405 says that the pyvenv.cfg file is found as follows: « a pyvenv.cfg file is found either adjacent to the Python executable or one directory above it (if the executable is a symlink, it is not dereferenced), » But in

[issue32108] configparser bug: section is emptied if you assign a section to itself

2018-04-17 Thread Łukasz Langa
Łukasz Langa added the comment: I agree, the fix needs to be changed. What we probably want is to discover this kind of assignment and special-case *that*. -- versions: +Python 3.6, Python 3.7, Python 3.8 -Python 3.5 ___ Python

[issue11594] 2to3 does not preserve line endings

2018-04-17 Thread miss-islington
miss-islington added the comment: New changeset 3b3be1fe10f6c15e57360cac9d9dbc660666e655 by Miss Islington (bot) in branch '3.7': bpo-11594: Ensure line-endings are respected when using 2to3 (GH-6483)

[issue33293] Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp.

2018-04-17 Thread Ned Deily
Ned Deily added the comment: I am not sure I understand what behavior you are expecting. But datetime.now() is documented as returning "the current local date and time" (assuming no tx= argument is provided) while datetime.utcnow() returns "the current UTC date and time".

[issue33293] Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp.

2018-04-17 Thread Brett Cannon
Brett Cannon added the comment: And we do have women on the team, so please minimize the "fellas" comments. -- ___ Python tracker ___

[issue33293] Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp.

2018-04-17 Thread Tim Peters
Tim Peters added the comment: I agree this isn't a bug (and it was right to close it). I expect the OP is confused about what the `.timestamp()` method does, though. This note in the docs directly address what happens in their problematic `datetime.utcnow().timestamp()`

[issue33293] Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp.

2018-04-17 Thread Tim Peters
Tim Peters added the comment: Ned, I think this one is more the case that the OP didn't read the docs ;-) That said, there's a level of complexity here that seemingly can't be reduced: the distinctions between the `datetime` and `time` modules' views of the world, and

[issue33291] issue in the default setup.py which comes with the Python 3.6.5 installer

2018-04-17 Thread Brett Cannon
Brett Cannon added the comment: We don't having to do with the stegano project. It looks like they specified the wrong encoding in their setup.py. (This also isn't the issue tracker for pip, but I don't think they have the bug.) -- nosy: +brett.cannon resolution:

[issue33234] Improve list() pre-sizing for inputs with known lengths

2018-04-17 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Microbenchmarked with @vstinner's perf module: python -m perf timeit "list([0]*10)" -o new.json checkout master and build python -m perf timeit "list([0]*10)" -o old.json python -m perf compare_to new.json old.json Mean +- std

[issue33304] Syntax Error on leading 0 in integer tokens

2018-04-17 Thread Steven D'Aprano
Steven D'Aprano added the comment: This is not a bug, it is intentional. In Python 2, numbers with a leading zero are interpreted as octal, leading to surprising results: py> 015 13 In Python 3, we use 0o15 to get octal, and 015 becomes a syntax error.

Re: ARGPARSE Newbie question

2018-04-17 Thread TUA
Thanks for the pointers! -- https://mail.python.org/mailman/listinfo/python-list

[issue33305] Improve syntax error for numbers with leading zero

2018-04-17 Thread Steven D'Aprano
Change by Steven D'Aprano : -- type: behavior -> enhancement ___ Python tracker ___

[issue33305] Improve syntax error for numbers with leading zero

2018-04-17 Thread Steven D'Aprano
New submission from Steven D'Aprano : The Python 2.x syntax for octal integers is a syntax error in 3.x, but the error message is very uninformative: SyntaxError: invalid token Can this be improved? Perhaps to something like: invalid token, use 0o prefix for

[issue33304] Syntax Error on leading 0 in integer tokens

2018-04-17 Thread Steven D'Aprano
Steven D'Aprano added the comment: I've opened an issue to improve the error message: #33305 -- ___ Python tracker ___

Re: error from Popen only when run from cron

2018-04-17 Thread Dan Stromberg
On Tue, Apr 17, 2018 at 4:11 PM, wrote: > W dniu sobota, 27 stycznia 2018 16:59:50 UTC+1 użytkownik larry@gmail.com > napisał: >> I have a script that does this: >> >> subprocess.Popen(['service', 'some_service', 'status'], >> stdout=subprocess.PIPE,

[issue33303] ElementTree Comment text isn't escaped

2018-04-17 Thread John Burnett
New submission from John Burnett : The _serialize_xml function in ElementTree.py doesn't escape Comment.text values when writing output. This means the following code: import sys import xml.etree.ElementTree elem = xml.etree.ElementTree.Comment()

Re: ARGPARSE Newbie question

2018-04-17 Thread paulclarke345
On Tuesday, April 17, 2018 at 7:09:45 PM UTC-5, TUA wrote: > I'd like to create a script that handles a number of verbs with mandatory and > /or optional parameters like listed in the table below. > > Can ARGPARSE do this and how? > > Thanks for all help! > > > > > > Script Verb

[issue28126] Py_MEMCPY: Use memcpy on Windows?

2018-04-17 Thread Andro Nuxx
Andro Nuxx added the comment: Py_MEMCPY() has a special case for small blocks on Windows to work around an ancient performance issue in MSVC. Can we safely assume that recent MSVC properly optimize memcpy()? See #28055 /* Py_MEMCPY can be used instead of memcpy in cases

ARGPARSE Newbie question

2018-04-17 Thread TUA
I'd like to create a script that handles a number of verbs with mandatory and /or optional parameters like listed in the table below. Can ARGPARSE do this and how? Thanks for all help! Script VerbMandatory parameters Optional parameters

  1   2   >