[issue38924] pathlib paths .normalize()

2019-11-28 Thread Vedran Čačić

Vedran Čačić  added the comment:

I think the real issue here

> mypath = PurePosixPath(normpath(mypath))

is the PurePosixPath wrapper. It is nice that normpath _accepts_ pathlike 
objects, but it should then not return a generic str. It should try to return 
an object of the same type.

Of course it's harder to do, especially in presence of pathlike objects of 
unknown classes, but with some reasonable assumptions on the constructors, it 
can be done---and it's much more useful. The similar debate, with similar 
conclusions, has already happened with datetime-like objects.

--
nosy: +veky

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31456] SimpleCookie fails to parse any cookie if an entry has whitespace in the name

2019-11-28 Thread Joel Rosdahl


Change by Joel Rosdahl :


--
nosy: +Joel Rosdahl

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: tab replace to space 4

2019-11-28 Thread Pankaj Jangid
황병희  writes:
> usally i write python code in gnu emacs on ubuntu 18.04 sometimes i
> re-edit the code vim in same machine so often when i do run the code in
> shell like as ./test.py i meet consol error -- which line wrong!
>
> so i am considering how can i replace all tab to space 4 within python
> code. if there is solution in google i am very sorry.

In Emacs, use "M-x untabify". And "M-x tabify" if you want to do the
reverse.

Regards,
-- 
Pankaj Jangid
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue38924] pathlib paths .normalize()

2019-11-28 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

> Yes, exactly the same behaviour, but arguing that normpath() can take a 
> pathlib object is just saying that it saves you from doing an intermediate 
> str(), which is, well, nice, but still not pretty. Consider `mypath = 
> mypath.normalize()` vs. `mypath = PurePosixPath(normpath(mypath))`.

>From my experience in the past the intention has been to keep the API minimal 
>and below are some recent additions. Many discussions lead to the answer over 
>using a function that accepts a pathlike object already and if not add support 
>for it than add the API to pathlib itself. I will leave it to the experts on 
>this.

realink : issue30618
link_to : issue26978

--
nosy: +pitrou, serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Does module socketserver using epoll in python3?

2019-11-28 Thread lampahome
>
> The source code is here:
> https://github.com/python/cpython/blob/master/Lib/socketserver.py .  You
> should find all the technical details you are looking for in it.
>
>
# poll/select have the advantage of not requiring any extra file
> descriptor,# contrarily to epoll/kqueue (also, they require a single
> syscall).
> if hasattr(selectors, 'PollSelector'):
>  _ServerSelector = selectors.PollSelector
> else:
>  _ServerSelector = selectors.SelectSelector

 Oh..no It uses poll or select ranther than epoll. Maybe it suffer some
performance degrading.

thx lot.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Does module socketserver using epoll in python3?

2019-11-28 Thread Michael Torrie
On 11/28/19 8:46 PM, lampahome wrote:
> As title,
> 
> I want to use socketserver to replace my own server code to
> maintain ealsier.
> 
> But I don't found any info about tech. detail of socketserver, epoll is
> important.
> 
> Can anyone tell me?

The source code is here:
https://github.com/python/cpython/blob/master/Lib/socketserver.py .  You
should find all the technical details you are looking for in it.

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue38924] pathlib paths .normalize()

2019-11-28 Thread Ionuț Ciocîrlan

Ionuț Ciocîrlan  added the comment:

> Can you please add an example of how normalize() should behave?

```
>>> mypath = PurePosixPath("foo/bar/bzz")
>>> mypath /= "../../"
>>> mypath
PurePosixPath('foo/bar/bzz/../..')
>>> mypath = mypath.normalize()
>>> mypath
PurePosixPath('foo')
>>> mypath /= "../../../there"
>>> mypath
PurePosixPath('foo/../../../there')
>>> mypath = mypath.normalize()
>>> mypath
PurePosixPath('../../there')
>>> mypath /= "../../and/back/again"
>>> mypath
PurePosixPath('../../there/../../and/back/again')
>>> mypath = mypath.normalize()
>>> mypath
PurePosixPath('../../../and/back/again')
```

> I assume you want the same behaviour as os.path.normpath which already 
> accepts a pathlike object to be added to pathlib.

Yes, exactly the same behaviour, but arguing that normpath() can take a pathlib 
object is just saying that it saves you from doing an intermediate str(), which 
is, well, nice, but still not pretty. Consider `mypath = mypath.normalize()` 
vs. `mypath = PurePosixPath(normpath(mypath))`.

> Do note that Path inherits from PurePath, so providing a normalize() method 
> on the latter means it will end up on the former.

That could be "circumvented" with a bit of code shuffling, e.g. moving 
everything from `PurePath` to a `PathBase` or `_Path` or somesuch, and forking 
the inheritance from there. On the other hand, it might be useful. I personally 
can't think of a scenario, but the GNU folk certainly think so, see `realpath 
--logical`: 
https://www.gnu.org/software/coreutils/manual/html_node/realpath-invocation.html

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Does module socketserver using epoll in python3?

2019-11-28 Thread lampahome
As title,

I want to use socketserver to replace my own server code to
maintain ealsier.

But I don't found any info about tech. detail of socketserver, epoll is
important.

Can anyone tell me?
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue38938] Iterable merge performance and inclusion in itertools

2019-11-28 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

The following seems like it is a short, readable recipe for itertools.

--
Added file: https://bugs.python.org/file48748/merge_recipe.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38938] Iterable merge performance and inclusion in itertools

2019-11-28 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38938] Iterable merge performance and inclusion in itertools

2019-11-28 Thread Dennis Sweeney


New submission from Dennis Sweeney :

Although the implementation of the heapq.merge function uses an underlying heap 
structure, its behavior centers on iterators. For this reason, I believe there 
should either be an alias to this function in the itertools module or at least 
a recipe in the itertools docs describing the use of heapq.merge.

Furthermore, I have an implementation (attached) of heapq.merge that is twice 
as fast for two iterables (as used in mergesort and other common cases), and is 
faster for up to 6 or 7 iterables. I think it would be nice to special-case 
this for small numbers of iterables for this significant speedup.

--
components: Library (Lib)
files: iter_merge.py
messages: 357631
nosy: Dennis Sweeney
priority: normal
severity: normal
status: open
title: Iterable merge performance and inclusion in itertools
type: enhancement
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file48747/iter_merge.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38500] Provide a way to get/set PyInterpreterState.frame_eval without needing to access interpreter internals

2019-11-28 Thread Paulo Henrique Silva


Change by Paulo Henrique Silva :


--
nosy: +phsilva

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: os.system vs subrocess.call

2019-11-28 Thread Stephan Lukits


> On 28. Nov 2019, at 12:05, Ulrich Goebel  wrote:
> 
> Hi,
> 
> I have to call commands from inside a python skript. These commands are in 
> fact other python scripts. So I made
> 
>os.system('\.Test.py')
> 
> That works.
> 
> Now I tried to use
> 
>supprocess.call(['.\', 'test.py'])

[ins] In [1]: from os import system

[ins] In [2]: system('./test.py')
hallo world
Out[2]: 0

[ins] In [3]: from subprocess import call

[ins] In [4]: call('./test.py')
hallo world
Out[4]: 0

In the first call you call ’.Test.py’
In the second call you call ’test.py’

“supprocess” doesn’t exist

How about

subprocess.call(‘\.Test.py’)

Or

subprocess.call([‘\.Test.py’])

Whereas the later makes more sense if you want to pass arguments to Test.py

Greetings Stephan
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue35003] Provide an option to venv to put files in a bin/ directory on Windows

2019-11-28 Thread Vinay Sajip


Vinay Sajip  added the comment:

> I think Brett is thinking about eliminating the manual activate part 
> entirely, but any tool trying to automate that needs to do a lot of 
> platform-specific checks.

If you have more than one venv then it seems like some manual step is required 
to switch between them. What about a tool like Pew (Python Env Wrapper), which 
from the README "is completely shell-agnostic and thus works on bash, zsh, 
fish, powershell, etc."

https://github.com/berdario/pew

I haven't used in under Windows, but it works a treat on POSIX for me, YMMV of 
course.

Of course, scripts installed in venvs never need activation to run - they pick 
up the correct interpreter from their venv automatically.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38937] NameError in list comprehension within .pth file

2019-11-28 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
pull_requests: +16895
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/17414

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38937] NameError in list comprehension within .pth file

2019-11-28 Thread Chris Billington


Chris Billington  added the comment:

I see. site.py calls exec() from within a function, and therefore the code is 
executed in the context of that function's locals and the site module globals. 
This means the code in .pth files can access (but not add new) local names from 
the site.addpackage() function:

$ echo 'import sys; f.close()' | sudo tee 
/usr/lib/python3.8/site-packages/test.pth
import sys; f.close()
$ python
Fatal Python error: init_import_size: Failed to import the site module
Python runtime state: initialized
Traceback (most recent call last):
  File "/usr/lib/python3.8/site.py", line 580, in 
main()
  File "/usr/lib/python3.8/site.py", line 567, in main
known_paths = addsitepackages(known_paths)
  File "/usr/lib/python3.8/site.py", line 350, in addsitepackages
addsitedir(sitedir, known_paths)
  File "/usr/lib/python3.8/site.py", line 208, in addsitedir
addpackage(sitedir, name, known_paths)
  File "/usr/lib/python3.8/site.py", line 164, in addpackage
for n, line in enumerate(f):
ValueError: I/O operation on closed file.

The example with the sys module worked because sys is in the globals the site 
module already.

Probably site.addpackage() should exec() code it its own environment:

if line.startswith(("import ", "import\t")):
exec(line, {})
continue

(added empty dict for exec() call)

or for backward compatibility for .pth files that are using globals from the 
site module without importing them (such as sys or os):

if line.startswith(("import ", "import\t")):
exec(line, globals().copy())
continue

This resolves the original issue

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38933] unusual behaviour on list of dependable lambdas

2019-11-28 Thread Tim Peters


Tim Peters  added the comment:

This behavior is intended and expected, so I'm closing this.

As has been explained, in any kind of function (whether 'lambda' or 'def'), a 
non-local variable name resolves to its value at the time the function is 
evaluated, not the value it _had_ at the time the function was defined.

If you need to use bindings in effect at the time the function is defined, then 
you need to do something to force that to happen.  A common way is to abuse 
Python's default-argument mechanism to initialize a local argument to the value 
of a non-local variable at function definition time.  In practice, e.g., this 
means changing the

lambda a:

in your first example to

lambda a, i=i:

Then, when the lambda is defined ('lambda' and 'def' are executable statements 
in Python! not just declarations), the then-current binding of non-local 
variable 'i' is captured and saved away as the default value of the local 
argument name 'i'.

--
nosy: +tim.peters
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38937] NameError in list comprehension within .pth file

2019-11-28 Thread Chris Billington


New submission from Chris Billington :

The following one-liner works fine in a regular Python interpreter:

$ python -c 'import sys; x = 5; [print(x + i) for i in range(5)]'
5
6
7
8
9

But in a .pth file, it raises a NameError:

$ echo 'import sys; x = 5; [print(x + i) for i in range(5)]' | sudo tee 
/usr/lib/python3.8/site-packages/test.pth
$ python
Error processing line 1 of /usr/lib/python3.8/site-packages/test.pth:

  Traceback (most recent call last):
File "/usr/lib/python3.8/site.py", line 169, in addpackage
  exec(line)
File "", line 1, in 
File "", line 1, in 
  NameError: name 'x' is not defined

Remainder of file ignored
Python 3.8.0 (default, Oct 23 2019, 18:51:26) 
[GCC 9.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

Since site.py uses exec() to exec each line of a .pth file, I thought I'd 
compare with that. It also works fine:

$ python -c 'exec("import sys; x = 5; [print(x + i) for i in range(5)]")'
5
6
7
8
9

This slight modification (the variable being used in the next statement still, 
but not within the loop of the comprehension) does not raise a NameError:

$ echo 'import sys; x = 5; [print(i) for i in range(x)]' | sudo tee 
/usr/lib/python3.8/site-packages/test.pth
import sys; x = 5; [print(i) for i in range(x)]
$ python
0
1
2
3
4
Python 3.8.0 (default, Oct 23 2019, 18:51:26) 
[GCC 9.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

I know .pth file processing is very early in interpreter startup such that many 
things aren't working yet, but I wouldn't expect using a name defined outside a 
list comprehension within the loop body of said list comprehension not to work.

The following is fine also, showing that using names from outside the list 
comprehension doesn't always break:

$ echo 'import sys; [print(sys) for i in range(5)]' | sudo tee 
/usr/lib/python3.8/site-packages/test.pth
import sys; [print(sys) for i in range(5)]
$ python





Python 3.8.0 (default, Oct 23 2019, 18:51:26) 
[GCC 9.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 

This is fine too:

$ echo 'import sys; [print(str(sys) * i) for i in range(5)]' | sudo tee 
/usr/lib/python3.8/site-packages/test.pth
import sys; [print(str(sys) * i) for i in range(5)]
$ python





Python 3.8.0 (default, Oct 23 2019, 18:51:26) 
[GCC 9.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 


My use case is looping over subdirs of a directory and adding them all to 
sys.path to provide similar functionality to python setup.py develop, with all 
python vcs repositories within a specific directory being prepended to 
sys.path, rather than having to add them one-by-one. I probably won't end up 
doing what I'm doing this way, but in any case the above seems like it's a bug, 
unless I'm grossly misunderstanding something.

--
components: Interpreter Core
messages: 357627
nosy: Chris Billington
priority: normal
severity: normal
status: open
title: NameError in list comprehension within .pth file
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35003] Provide an option to venv to put files in a bin/ directory on Windows

2019-11-28 Thread Tzu-ping Chung

Tzu-ping Chung  added the comment:

> Surely "on native Windows you run venv-path\Scripts\activate[.ps1], on POSIX 
> you use source venv-path/bin/activate" isn't *that* hard for new users to 
> grok [...]?

The if-Windows-X-else-Y part isn’t that hard; it’s the activate part that is :p

I think Brett is thinking about eliminating the manual activate part entirely, 
but any tool trying to automate that needs to do a lot of platform-specific 
checks.

---

> I've personally never come across Scripts in any other situation than virtual 
> environments [...].

Windows use a Scripts directory to store… scripts (Setuptools terminology, i.e. 
console and gui script entry points). So e.g. the global pip.exe would be at 
"{sys.prefix}\Scripts\pip.exe" (or is it sys.exec_prefix?) `pip install --user` 
would also install scripts into `%APPDATA%\Programs\Python\PythonXY\Scripts`. 
So venv’s setup is consistent with the rest of Python.

This directory structure can be expanded from sysconfig. So the proposal in my 
previous comment is to record the scheme in pyvenv.cfg, so you can have 
something like

def read_venv_scheme(env_dir):
with open(os.path.join(env_dir, 'pyvenv.cfg')) as f:
for line in f:
key, value = (p.strip() for p in line.split('='))
if key == 'scheme':
return value

def get_venv_environ_patch(env_dir):
scheme = read_venv_scheme(env_dir)
bin_dir = sysconfig.get_path('scripts', scheme=scheme, 
expand=False).format(base=env_dir)
return {'VIRTUAL_ENV': env_dir, 'PATH': bin_dir}

and this would give you the appropriate value on any platform.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35003] Provide an option to venv to put files in a bin/ directory on Windows

2019-11-28 Thread Vinay Sajip


Vinay Sajip  added the comment:

> Basically activation is the biggest stumbling block I find with new users

Surely "on native Windows you run venv-path\Scripts\activate[.ps1], on POSIX 
you use source venv-path/bin/activate" isn't *that* hard for new users to grok, 
and would cover the vast majority of users? (i.e. not including the other, 
less-common POSIX shells.)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35003] Provide an option to venv to put files in a bin/ directory on Windows

2019-11-28 Thread Brett Cannon


Brett Cannon  added the comment:

I've personally never come across Scripts in any other situation than virtual 
environments, but that isn't saying much about my Windows exposure either. :)

Basically activation is the biggest stumbling block I find with new users when 
it comes to trying to teach them about using virtual environments and this 
platform difference doesn't help. I would like to come up with _some_ solution 
to make it easier, even if it's something I have to put into the Python 
Launcher (although trying to get people to even agree on a name for virtual 
environments created beside the code turns out to be a hot topic). I would 
consider trying to come up with code so we have a `pipenv shell`/`conda shell` 
equivalent, but I've been told it is not pleasant to try and make work.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38916] Remove array.fromstring

2019-11-28 Thread Brett Cannon


Brett Cannon  added the comment:

> How about note it in the documentation and logging rather than removing them?

Yep, docs and raising DeprecationWarning should be good.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: How to convert the following IDL program lines to equivalent Python program lines?

2019-11-28 Thread MRAB

On 2019-11-28 15:35, Dennis Lee Bieber wrote:

On Thu, 28 Nov 2019 12:45:27 +, Ben Bacarisse 
declaimed the following:


Madhavan Bomidi  writes:


print,'Column ',J,' of product matrix A*AINV:',format='(1X,A7,I3,A27)'





I don't know what the 1X format does.  The A7 and A27 formats just seem
to involve the programmer counting the strings.  Very odd.



Channeling ancient FORTRAN, I'd interpret it as

1X  Skip one space
A7  Seven character alpha
I3  Three digit integer
A27 27 character alpha

and it is rather painful when the arguments are literals of those sizes.
Makes more sense if the arguments are strings of various widths yet column
alignment is required.

Since I still favor string interpolation for formatting, I'd probably
just end up with

print(" Column %3d of product matrix A*AINV:")

{Odd that the original uses a 1X format, when the literals have white space
at the adjoining ends... Why not " Column " with A8 format?}

In Fortran, if the first character printed is a space, then the 
remainder is printed on a new line, else the remainder is printed as a 
continuation of the previous line. Thus, the initial 1X is making it 
start on a new line.






This is very odd.  What does it mean when a label is duplicated in IDL?
If the second one were not there, this:

 JMP:  IF WK(L-1,K-1) EQ 0 THEN BEGIN
 L=L+1
 GOTO, JMP
   ENDIF

would just be a while loop:

   while WK[L-1,K-1] == 0:
 L=L+1




Did you notice that "JMP:" occurs twice? Very strange!


By the way, all those -1s suggest that the IDL was itself a translation
from a language with 1-based array indexing.  All that might be able to
be tidied up.


Heck -- the IDL could be tidied up... All those loop indices could be
configured to run 0..n-1, rather than 1..n

Looks a lot like a garbaged form of FORTRAN that has removed the . from
relational operators, and tried to use blocked syntax.

EQ  =>   .eq.
NE  =>   .ne.

FOR i = s, e DO BEGIN

=>
DO lbl i=s, e
stuff
lbl CONTINUE



--
https://mail.python.org/mailman/listinfo/python-list


[issue38936] fatal error during installation 0x80070643 during python installation

2019-11-28 Thread kiranmai velishala


New submission from kiranmai velishala :

Installing Python 3.8, Windows 10 64bit, exits installer and dumps the 
following error code to log.

[3D8C:422C][2019-11-28T22:23:28]e000: Error 0x80070643: Failed to run 
maintanance mode for MSI package.
[3D8C:422C][2019-11-28T22:23:28]e000: Error 0x80070643: Failed to configure 
per-user MSI package.
[3D8C:422C][2019-11-28T22:23:28]i319: Applied execute package: tcltk_JustForMe, 
result: 0x80070643, restart: None
[3D8C:422C][2019-11-28T22:23:28]e000: Error 0x80070643: Failed to execute MSI 
package.
[3D8C:422C][2019-11-28T22:23:28]i301: Applying rollback package: 
tcltk_JustForMe, action: Modify, path: C:\Users\kivelish\AppData\Local\Package 
Cache\{978278A0-0090-4A9C-8610-001061A495AF}v3.8.150.0\tcltk.msi, arguments: ' 
ARPSYSTEMCOMPONENT="1" MSIFASTINSTALL="7" 
TARGETDIR="C:\Users\kivelish\AppData\Local\Programs\Python\Python38-32" 
OPTIONALFEATURESREGISTRYKEY="Software\Python\PythonCore\3.8-32\InstalledFeatures"
 REMOVE="AssociateFiles"'
[3D8C:422C][2019-11-28T22:23:30]e000: Error 0x80070643: Failed to run 
maintanance mode for MSI package.
[3D8C:422C][2019-11-28T22:23:30]e000: Error 0x80070643: Failed to configure 
per-user MSI package.

0x80070643 - Fatal Error during installation

--
components: Windows
files: FATAL_ISSUE.zip
messages: 357622
nosy: kiranmai velishala, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: fatal error during installation 0x80070643 during python installation
type: crash
versions: Python 3.8
Added file: https://bugs.python.org/file48746/FATAL_ISSUE.zip

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: How to convert the following IDL program lines to equivalent Python program lines?

2019-11-28 Thread Bev In TX


> On Nov 28, 2019, at 9:35 AM, Dennis Lee Bieber  wrote:
> 
> Channeling ancient FORTRAN, I'd interpret it as
> 
> 1XSkip one space
> A7Seven character alpha
> I3Three digit integer
> A2727 character alpha
> 
> and it is rather painful when the arguments are literals of those sizes.
> Makes more sense if the arguments are strings of various widths yet column
> alignment is required.
> 
>Since I still favor string interpolation for formatting, I'd probably
> just end up with
> 
> print(" Column %3d of product matrix A*AINV:")
> 
> {Odd that the original uses a 1X format, when the literals have white space
> at the adjoining ends... Why not " Column " with A8 format?}

Still channeling Fortran, 1X ensured a blank in column 1, which was used 
strictly for carriage control on a line printer.  A8 may, or may not leave a 
blank in column 1, which could have caused erroneous carriage controls.

Bev in TX
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue38920] Audit events for unhandled exceptions

2019-11-28 Thread Steve Dower


Change by Steve Dower :


--
stage: patch review -> commit review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38920] Audit events for unhandled exceptions

2019-11-28 Thread Steve Dower


Steve Dower  added the comment:


New changeset bea33f5e1db6e4a554919a82894f44568576e979 by Steve Dower in branch 
'master':
bpo-38920: Add audit hooks for when sys.excepthook and sys.unraisable hooks are 
invoked (GH-17392)
https://github.com/python/cpython/commit/bea33f5e1db6e4a554919a82894f44568576e979


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38920] Audit events for unhandled exceptions

2019-11-28 Thread Steve Dower


Steve Dower  added the comment:


New changeset b74a6f14b94d36fb72b1344663e81776bf450847 by Steve Dower in branch 
'3.8':
bpo-38920: Add audit hooks for when sys.excepthook and sys.unraisablehook are 
invoked (GH-17392)
https://github.com/python/cpython/commit/b74a6f14b94d36fb72b1344663e81776bf450847


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38928] EnvBuilder.upgrade_dependencies() does not exist on 3.8

2019-11-28 Thread Vinay Sajip


Change by Vinay Sajip :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38931] pathlib.Path on Windows - parser issue

2019-11-28 Thread Zachary Ware


Zachary Ware  added the comment:

You're welcome :)

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



install software

2019-11-28 Thread alberto
Hi, 
I'm trying to install a python source

https://github.com/peteboyd/lammps_interface

when I run the example test I receive this error


AttributeError: 'NoneType' object has no attribute 'copy'

How could I fix it?

regards


lammps-interface 
/home/alberto/Scaricati/lammps_interface-master/test_struct/IRMOF-1.cif
fatal: Not a git repository (or any of the parent directories): .git
No bonds reported in cif file - computing bonding..
Molecules found in the framework, separating.
Traceback (most recent call last):
  File "/usr/local/bin/lammps-interface", line 4, in 
__import__('pkg_resources').run_script('lammps-interface==0.1.1', 
'lammps-interface')
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 719, in 
run_script
self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1504, 
in run_script
exec(code, namespace, namespace)
  File 
"/usr/local/lib/python3.5/dist-packages/lammps_interface-0.1.1-py3.5.egg/EGG-INFO/scripts/lammps-interface",
 line 13, in 
sim.split_graph()
  File 
"/usr/local/lib/python3.5/dist-packages/lammps_interface-0.1.1-py3.5.egg/lammps_interface/lammps_main.py",
 line 398, in split_graph
sg = self.cut_molecule(molecule)
  File 
"/usr/local/lib/python3.5/dist-packages/lammps_interface-0.1.1-py3.5.egg/lammps_interface/lammps_main.py",
 line 1535, in cut_molecule
mgraph.distance_matrix = self.graph.distance_matrix.copy()
AttributeError: 'NoneType' object has no attribute 'copy'


the installetion seems completed correctly

sudo python3 setup.py install 
/usr/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution 
option: 'long_description_content_type'
  warnings.warn(msg)
running install
Checking .pth file support in /usr/local/lib/python3.5/dist-packages/
/usr/bin/python3 -E -c pass
TEST PASSED: /usr/local/lib/python3.5/dist-packages/ appears to support .pth 
files
running bdist_egg
running egg_info
creating lammps_interface.egg-info
writing requirements to lammps_interface.egg-info/requires.txt
writing dependency_links to lammps_interface.egg-info/dependency_links.txt
writing lammps_interface.egg-info/PKG-INFO
writing top-level names to lammps_interface.egg-info/top_level.txt
writing manifest file 'lammps_interface.egg-info/SOURCES.txt'
reading manifest file 'lammps_interface.egg-info/SOURCES.txt'
writing manifest file 'lammps_interface.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib
creating build/lib/lammps_interface
copying lammps_interface/mof_sbus.py -> build/lib/lammps_interface
copying lammps_interface/Dubbeldam.py -> build/lib/lammps_interface
copying lammps_interface/gas_models.py -> build/lib/lammps_interface
copying lammps_interface/lammps_main.py -> build/lib/lammps_interface
copying lammps_interface/structure_data.py -> build/lib/lammps_interface
copying lammps_interface/Molecules.py -> build/lib/lammps_interface
copying lammps_interface/water_models.py -> build/lib/lammps_interface
copying lammps_interface/lammps_potentials.py -> build/lib/lammps_interface
copying lammps_interface/BTW.py -> build/lib/lammps_interface
copying lammps_interface/dreiding.py -> build/lib/lammps_interface
copying lammps_interface/CIFIO.py -> build/lib/lammps_interface
copying lammps_interface/__init__.py -> build/lib/lammps_interface
copying lammps_interface/generic_raspa.py -> build/lib/lammps_interface
copying lammps_interface/atomic.py -> build/lib/lammps_interface
copying lammps_interface/ccdc.py -> build/lib/lammps_interface
copying lammps_interface/uff_nonbonded.py -> build/lib/lammps_interface
copying lammps_interface/MOFFF.py -> build/lib/lammps_interface
copying lammps_interface/uff.py -> build/lib/lammps_interface
copying lammps_interface/InputHandler.py -> build/lib/lammps_interface
copying lammps_interface/uff4mof.py -> build/lib/lammps_interface
copying lammps_interface/ForceFields.py -> build/lib/lammps_interface
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/lammps_interface
copying build/lib/lammps_interface/mof_sbus.py -> 
build/bdist.linux-x86_64/egg/lammps_interface
copying build/lib/lammps_interface/Dubbeldam.py -> 
build/bdist.linux-x86_64/egg/lammps_interface
copying build/lib/lammps_interface/gas_models.py -> 
build/bdist.linux-x86_64/egg/lammps_interface
copying build/lib/lammps_interface/lammps_main.py -> 
build/bdist.linux-x86_64/egg/lammps_interface
copying build/lib/lammps_interface/structure_data.py -> 
build/bdist.linux-x86_64/egg/lammps_interface
copying build/lib/lammps_interface/Molecules.py -> 
build/bdist.linux-x86_64/egg/lammps_interface
copying build/lib/lammps_interface/water_models.py -> 
build/bdist.linux-x86_64/egg/lammps_interface
copying build/lib/lammps_interface/lammps_potentials.py -> 
build/bdist.linux-x86_64/egg/lammps_interface
copying 

[issue38928] EnvBuilder.upgrade_dependencies() does not exist on 3.8

2019-11-28 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 18d8edbbb6626ac9cdf1152a720811beb2230b33 by Vinay Sajip (Tzu-ping 
Chung) in branch '3.8':
bpo-38928: Remove upgrade_dependencies() from venv doc (GH-17410)
https://github.com/python/cpython/commit/18d8edbbb6626ac9cdf1152a720811beb2230b33


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37347] Reference-counting problem in sqlite

2019-11-28 Thread Sergey Fedoseev


Change by Sergey Fedoseev :


--
pull_requests: +16894
pull_request: https://github.com/python/cpython/pull/17413

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35003] Provide an option to venv to put files in a bin/ directory on Windows

2019-11-28 Thread Tzu-ping Chung

Tzu-ping Chung  added the comment:

There are more differences than Scripts/bin, like Windows use Lib but POSIX 
uses lib/pythonX.Y. IMO it’s probably better to stick with platform 
conventions, especially since those can be discovered with 
sysconfig.get_paths(expand=False).

I wonder whether it’d be a good idea to record what scheme was used to create 
the venv (in pyvenv.cfg). Any Python runtime can use that value in 
get_paths(scheme=..., expand=False) to know about the venv’s structure, even if 
the venv was created on another platform. This would be particularly useful to 
e.g. inspect a Windows-native venv in a WSL Python.

--
nosy: +uranusjr

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38931] pathlib.Path on Windows - parser issue

2019-11-28 Thread tempest


tempest  added the comment:

But for course! (Slaps forehead!)

Yes, giving the Windows path as a raw string works. For all the times I've done 
'\t'.join(str(f) for f in some_array) to get a tab-delimited text string, I 
should have had a clue. Sorry for the noise, and thanks for setting me straight.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: How to convert the following IDL program lines to equivalent Python program lines?

2019-11-28 Thread Ben Bacarisse
Madhavan Bomidi  writes:

> I have the following IDL program lines. I want to write equivalent
> Python program lines. Can anyone suggest me equivalent Pythons program
> lines?
>
> # --- 1 --- #
> How to handle the format in IDL to Python?
>
> IDL program line:
>
> print,'Column ',J,' of product matrix A*AINV:',format='(1X,A7,I3,A27)'
>
>
> Python program line written by me:
>
> print('Column '+str(j)+' of product matrix A*AINV:')

You could just use

  print('Column', j, 'of product matrix A*AINV:')

but if you need to copy the I3 format:

  print('Column {0:3} of product matrix A*AINV:'.format(j))

I don't know what the 1X format does.  The A7 and A27 formats just seem
to involve the programmer counting the strings.  Very odd.

> #---2  #
> How the JMP can be transformed in Python?
>
> IDL program lines:
>
>   FOR K=1,M DO BEGIN
> FOR I=1,M DO BEGIN
>   IF I NE K THEN BEGIN
> IF WK(K-1,K-1) EQ 0 THEN BEGIN
>   L=1
> JMP:  IF WK(L-1,K-1) EQ 0 THEN BEGIN
> L=L+1
> GOTO, JMP
>   ENDIF
>   FOR J=K,2*M DO BEGIN
> WK(K-1,J-1)=WK(K-1,J-1)+WK(L-1,J-1)
>   ENDFOR
> ENDIF
> U=-WK(I-1,K-1)/WK(K-1,K-1)
> FOR J=K+1,2*M DO BEGIN
>   WK(I-1,J-1)=WK(I-1,J-1)+U*WK(K-1,J-1)
> ENDFOR
>   ENDIF
> ENDFOR
>   ENDFOR
>
> JMP: RETURN

This is very odd.  What does it mean when a label is duplicated in IDL?
If the second one were not there, this:

  JMP:  IF WK(L-1,K-1) EQ 0 THEN BEGIN
  L=L+1
  GOTO, JMP
ENDIF

would just be a while loop:

while WK[L-1,K-1] == 0:
  L=L+1



By the way, all those -1s suggest that the IDL was itself a translation
from a language with 1-based array indexing.  All that might be able to
be tidied up.

-- 
Ben.
-- 
https://mail.python.org/mailman/listinfo/python-list


[Release] Pyo 1.0.1 (Python dsp library)

2019-11-28 Thread Olivier Bélanger
Hello all,

I'm very happy to announce the release of pyo 1.0.1, available for python 2.7,
3.5, 3.6, 3.7 and 3.8.

Pyo is a Python module written in C to help real-time digital signal processing
script creation. It provides a complete set of classes to build audio softwares,
compose algorithmic musics or simply explore audio processing.It is
available for
Windows, macOS and linux. It is released under the LGPL 3 license.

Official web site: http://ajaxsoundstudio.com/software/pyo/

pyo's documentation: http://ajaxsoundstudio.com/pyodoc/

Latest sources and bug tracker: https://github.com/belangeo/pyo

The package is now uploaded to pypi.org and can be installed (for
32-bit or 64-bit)
under MacOS, Windows and linux  with pip. Just run the command:

python -m pip install pyo

For all the details and how to uninstall version prior to 1.0.0, see this page
in the documentation:

http://ajaxsoundstudio.com/pyodoc/download.html


Bug Fixes:

- Audio server falls back to playback-only mode if jack server has no
input ports.
- Fixed setting value of ControlSlider from national keyboard layout.
- Fixed segfault when CallAfter's callback results in deleting itself.
- Fixed tkinter font size on MacOS (issue #163).

New features:

- Added a clear() method to Mixer object to delete all inputs at once.
- Added new object: Binaural, 3D stereo spatialization.
- Added a DC blocker inside the feedback loop of Harmonizer object.
- Added setChannelNames(names) method to Spectrum and Scope objects.
- Added beatToDur(beat, bpm) function.

Events framework (new framework to sequence events):

Set of tools to generate sequence of events. The purpose of the Event
framework is
to allow the user to generate a sequence of events with as few as
possible parameters
to specify. The Events object is the heart of the framework. An Events
object computes
parameters, generally designed with event generator objects, builds
the events and plays
the sequence.

See the Events framework examples in the documentation for different use cases.

- EventScale: Constructs a list of pitches according to its arguments.
- EventGenerator: Base class for all event generators.
- EventKey: An EventGenerator that allow to retrieve the value of
another parameter.
- EventSeq: Plays through an entire list of values many times.
- EventSlide: Plays overlapping segments from a list of values.
- EventIndex: Plays values from a list based on a position index.
- EventMarkov: Applies a Markov algorithm to a list of values.
- EventChoice: Plays values randomly chosen from a list.
- EventDrunk: Performs a random walk over a list of values.
- EventNoise: White, pink or brown noise generator.
- EventCall: Calls a function, with any number of arguments, and uses
its return value.
- EventConditional: Executes one generator or the other depending on
the result of a condition.
- Events: Sequencing user-defined events to form musical phrases.

Expr API:

- let statment can now store a complex number.
- Expr now can handle multiple input sources.
- Expr now can generate multiple output signals.
- constants (pi, twopi, e, sr) can be used without braces.

New example categories:

- How to use OSC with pyo
- Utilities
- Events framework
- Evaluating prefix expression


Olivier Belanger
belan...@gmail.com
http://olivier.ajaxsoundstudio.com/



http://ajaxsoundstudio.com/software/pyo/;>Pyo 1.0.1 - short
Python DSP library. (27-Nov-19)
--
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/

Support the Python Software Foundation:
http://www.python.org/psf/donations/


How to convert the following IDL program lines to equivalent Python program lines?

2019-11-28 Thread Madhavan Bomidi
Hi,

I have the following IDL program lines. I want to write equivalent Python 
program lines. Can anyone suggest me equivalent Pythons program lines?

# --- 1 --- #
How to handle the format in IDL to Python?

IDL program line:

print,'Column ',J,' of product matrix A*AINV:',format='(1X,A7,I3,A27)'


Python program line written by me:

print('Column '+str(j)+' of product matrix A*AINV:')


#---2  #
How the JMP can be transformed in Python?

IDL program lines:

  FOR K=1,M DO BEGIN
FOR I=1,M DO BEGIN
  IF I NE K THEN BEGIN
IF WK(K-1,K-1) EQ 0 THEN BEGIN
  L=1
JMP:  IF WK(L-1,K-1) EQ 0 THEN BEGIN
L=L+1
GOTO, JMP
  ENDIF
  FOR J=K,2*M DO BEGIN
WK(K-1,J-1)=WK(K-1,J-1)+WK(L-1,J-1)
  ENDFOR
ENDIF
U=-WK(I-1,K-1)/WK(K-1,K-1)
FOR J=K+1,2*M DO BEGIN
  WK(I-1,J-1)=WK(I-1,J-1)+U*WK(K-1,J-1)
ENDFOR
  ENDIF
ENDFOR
  ENDFOR

JMP: RETURN

Python program lines:

for k in np.arange(1,M+1,dtype=int):
for i in np.arange(1,M+1,dtype=int):
if (i != k):
if (WK[k-1,k-1] == 0):
L = 1
if (WK[k-1,L-1] == 0):# JMP
L = L+1
for j in np.arange(k,2*M+1,dtype=int):
WK[j-1,k-1] = WK[j-1,k-1] + WK[j-1,L-1]
U = -WK[k-1,i-1]/WK[k-1,k-1]
for j in np.arange(k+1,2*M+1,dtype=int):
WK[j-1,i-1] = WK[j-1,i-1]+U*WK[j-1,k-1]



Can someone provide their feedback on whether I have done the correct 
transformation of the above IDL program lines to python program lines?

Look forward to the suggestions.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: os.system vs subrocess.call

2019-11-28 Thread Pieter van Oostrum
Ulrich Goebel  writes:

> Hi,
>
> I have to call commands from inside a python skript. These commands are
> in fact other python scripts. So I made
>
> os.system('\.Test.py')
>
> That works.

In a string \. is the same as . So this should execute the command '.Test.py'. 
Is that really what you did? Or did you mean os.system('./Test.py') which is 
much more probable.
NOTE: Never retype the commands that you used, but copy and paste them.

>
> Now I tried to use
>
> supprocess.call(['.\', 'test.py'])
>
That can't have given the error below, as it would have to be subprocess.call,
not supprocess.call.
And then also '.\' would have given a syntax error.
NOTE: Never retype the commands that you used, but copy and paste them.

> That doesn't work but ends in an error:
>
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "/usr/lib/python3.5/subprocess.py", line 557, in call
> with Popen(*popenargs, **kwargs) as p:
>   File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
> restore_signals, start_new_session)
>   File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
> raise child_exception_type(errno_num, err_msg)
> PermissionError: [Errno 13] Permission denied
>
> Using
>
> subprocess.call(['./', 'Test.py'], shell=True)
>
> I get
>
> Test.py: 1: Test.py: ./: Permission denied
>
Why would you do that, splitting './Test.py' in two parts? That doesn't work.
> Is there a simple way to use subprocess in this usecase?
>

subprocess.call(['./Test.py'])

-- 
Pieter van Oostrum
www: http://pieter.vanoostrum.org/
PGP key: [8DAE142BE17999C4]
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue38817] Immutable types inplace operations work incorrect in async

2019-11-28 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Raymond correctly spotted the problem.

I think we should just close the issue.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: os.system vs subrocess.call

2019-11-28 Thread Ulrich Goebel

Sorry for the wrong spelling. In fact

subprocess.call('./Test.py')

works.

The raising error was my error too, using ['./', 'Test.py'] instead of 
'./Test.py'


Sorry...

Am 28.11.19 um 11:05 schrieb Ulrich Goebel:

Hi,

I have to call commands from inside a python skript. These commands are 
in fact other python scripts. So I made


     os.system('\.Test.py')

That works.

Now I tried to use

     supprocess.call(['.\', 'test.py'])

That doesn't work but ends in an error:

Traceback (most recent call last):
   File "", line 1, in 
   File "/usr/lib/python3.5/subprocess.py", line 557, in call
     with Popen(*popenargs, **kwargs) as p:
   File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
     restore_signals, start_new_session)
   File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
     raise child_exception_type(errno_num, err_msg)
PermissionError: [Errno 13] Permission denied

Using

     subprocess.call(['./', 'Test.py'], shell=True)

I get

Test.py: 1: Test.py: ./: Permission denied

Is there a simple way to use subprocess in this usecase?

Best regards
Ulrich



--
Ulrich Goebel
Am Büchel 57, 53173 Bonn
--
https://mail.python.org/mailman/listinfo/python-list


Re: os.system vs subrocess.call

2019-11-28 Thread Peter Otten
Ulrich Goebel wrote:

> Hi,
> 
> I have to call commands from inside a python skript. These commands are
> in fact other python scripts. So I made
> 
>  os.system('\.Test.py')
> 
> That works.
> 
> Now I tried to use
> 
>  supprocess.call(['.\', 'test.py'])

Remember to use cut and paste for code and traceback.
The above triggers a syntax error because the backslash escapes the ending ' 
of the first argument. Also: is it Test.py or test.py?

> 
> That doesn't work but ends in an error:
> 
> Traceback (most recent call last):
>File "", line 1, in 
>File "/usr/lib/python3.5/subprocess.py", line 557, in call
>  with Popen(*popenargs, **kwargs) as p:
>File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
>  restore_signals, start_new_session)
>File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
>  raise child_exception_type(errno_num, err_msg)
> PermissionError: [Errno 13] Permission denied
> 
> Using
> 
>  subprocess.call(['./', 'Test.py'], shell=True)
> 
> I get
> 
> Test.py: 1: Test.py: ./: Permission denied
> 
> Is there a simple way to use subprocess in this usecase?

You must not split the path into directory and name.
If you are on Linux or similar, your script is executable, and your file 
system is case sensitive:

$ echo -e '#!/usr/bin/python3\nprint("hello")' > test.py
$ chmod u+x test.py
$ cat test.py
#!/usr/bin/python3
print("hello")
$ python3
Python 3.4.3 (default, Nov 12 2018, 22:25:49) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess
>>> subprocess.call(["./test.py"])
hello
0


-- 
https://mail.python.org/mailman/listinfo/python-list


os.system vs subrocess.call

2019-11-28 Thread Ulrich Goebel

Hi,

I have to call commands from inside a python skript. These commands are 
in fact other python scripts. So I made


os.system('\.Test.py')

That works.

Now I tried to use

supprocess.call(['.\', 'test.py'])

That doesn't work but ends in an error:

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.5/subprocess.py", line 557, in call
with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
restore_signals, start_new_session)
  File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg)
PermissionError: [Errno 13] Permission denied

Using

subprocess.call(['./', 'Test.py'], shell=True)

I get

Test.py: 1: Test.py: ./: Permission denied

Is there a simple way to use subprocess in this usecase?

Best regards
Ulrich

--
Ulrich Goebel
Am Büchel 57, 53173 Bonn
--
https://mail.python.org/mailman/listinfo/python-list


[issue38021] Modify AIX platform_tag so it provides PEP425 needs

2019-11-28 Thread Michael Felt


Michael Felt  added the comment:

Updated this PR, and PRs in pypa/pip and pypa/packaging to all be "in sync".

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38021] Modify AIX platform_tag so it provides PEP425 needs

2019-11-28 Thread Michael Felt


Change by Michael Felt :


--
title: pep425 tag for AIX is inadequate -> Modify AIX platform_tag so it 
provides PEP425 needs

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26730] SpooledTemporaryFile rollover corrupts data silently when Unicode characters are written

2019-11-28 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

> Note that the _file attribute may be TextIOWrapper after rollover() anyway 
> and the rollover() may be called implicitly.
The code depending on the specific type of the _file is fragile at first.

Okay, thanks for the detail.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38933] unusual behaviour on list of dependable lambdas

2019-11-28 Thread Vedran Čačić

Vedran Čačić  added the comment:

Yes, I never really understood what problem people have with it. If I manually 
say

i = 0
f = lambda a: a[i]
i = 1
g = lambda a: a[i]

why does anyone expect functions f and g to be different? They have the same 
argument, and do the same thing with it. The bytecode is completely the same. 
How can they do different things?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com