Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > de.comp.lang.python > #5558

Re: [Python-de] Programming-Guidelines

From Hartmut Goebel <h.goebel@goebel-consult.de>
Newsgroups de.comp.lang.python
Subject Re: [Python-de] Programming-Guidelines
Date 2019-10-24 14:52 +0200
Organization Goebel Consult
Message-ID <mailman.142.1571921573.32318.python-de@python.org> (permalink)
References (2 earlier) <h1d7o7F8encU1@mid.individual.net> <8f590d9a-981e-70c1-94d8-49c6baac5faf@goebel-consult.de> <mailman.139.1571908487.32318.python-de@python.org> <h1dkabFb0soU1@mid.individual.net> <099dc4a1-5c7b-14cd-dfaa-e0f8e9fc6a90@goebel-consult.de>

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Am 24.10.19 um 14:38 schrieb Hermann Riemann:
> In https://docs.python.org/3/library/subprocess.html steht
> The run() function was added in Python 3.5;
> Die meisten meiner Python Programme wurden unter Python <= 3.4
> entwickelt. ( os.system() ist die Nachfolge von system() in C)

Dann wird es Zeit, upzudaten. 3.0-3.4 sind schon End of life, PYthon 2.x
stirbt am 1. Januar und 3.5 nächsten September.


>
>> 2) String.Konkatination ist brandgefährlich. wenn man einen externe
>> Prozess startet.
>
> Konkatination findet so oder über format statt;

Nein. Wenn Du die Argumente einzeln übergibst, werden sie auch einzeln
an die OS-Funtionen exec*() übergeben. das spart zudem den Aufwand,
deine Kommandozeile wieder zu zerlegen, und den Shell-Aufruf.

> und ist ausgeführt,
> bevor system oder subprocess aufgerufen wird.
Dann empfehle ch, Deinen Code hier zu ändern. Wie gesagt, das ist
anfällig für Shell-Escape-Angrifffe.
>
>> 3) Du möchtest "os.makedirs()" verwenden.
>
> Wenn ich Zeit habe, im Python3 Buch danach zu suchen.
> ( Python3 Ernesti Kaiser 5.Auflage 2017)

docs.python.org ist dein Freund


-- 
Schönen Gruß
Hartmut Goebel
Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer
Information Security Management, Security Governance, Secure Software
Development

Goebel Consult, Landshut
http://www.goebel-consult.de

Blog:
https://www.goe-con.de/blog/nicht-pgp-ist-gescheitert-die-entwickler-haben-versagt

Kolumne:
https://www.goe-con.de/hartmut-goebel/cissp-gefluester/2011-11-in-troja-nichts-neues


Back to de.comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

[Python-de] Programming-Guidelines Thomas Güttler <guettliml@thomas-guettler.de> - 2019-10-24 09:56 +0200
  Re: [Python-de] Programming-Guidelines Hermann Riemann <nospam.ng@hermann-riemann.de> - 2019-10-24 11:04 +0200
    Re: [Python-de] Programming-Guidelines Hartmut Goebel <h.goebel@goebel-consult.de> - 2019-10-24 11:14 +0200
      Re: [Python-de] Programming-Guidelines Hermann Riemann <nospam.ng@hermann-riemann.de> - 2019-10-24 14:38 +0200
        Re: [Python-de] Programming-Guidelines Hartmut Goebel <h.goebel@goebel-consult.de> - 2019-10-24 14:52 +0200
          Re: [Python-de] Programming-Guidelines Hermann Riemann <nospam.ng@hermann-riemann.de> - 2019-10-24 17:56 +0200
        Re: [Python-de] Programming-Guidelines Felix Schwarz <felix.schwarz@web.de> - 2019-10-25 10:46 +0200
        Re: [Python-de] Programming-Guidelines Erich Schnoor <eschnoor@multi-matrix.de> - 2019-10-25 12:34 +0200
        Re: [Python-de] Programming-Guidelines Erich Schnoor <eschnoor@multi-matrix.de> - 2019-10-25 12:27 +0200

csiph-web