[issue37337] Add _PyObject_VectorcallMethod() function

2019-08-13 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 43d564c18c97421f73025ac3132a194975c76bd6 by Inada Naoki (Zackery 
Spytz) in branch 'master':
bpo-37337: Fix a GCC 9 warning in Objects/descrobject.c (GH-14814)
https://github.com/python/cpython/commit/43d564c18c97421f73025ac3132a194975c76bd6


--

___
Python tracker 

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



[issue28747] Expose SSL_CTX_set_cert_verify_callback

2019-08-13 Thread Chih-Hsuan Yen


Change by Chih-Hsuan Yen :


--
nosy:  -yan12125

___
Python tracker 

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



[issue37846] declare that Text I/O use buffer inside

2019-08-13 Thread Inada Naoki


Inada Naoki  added the comment:

It's just an implementation detail.  Python implementation and C implementation 
behave slightly different.  But user program shouldn't rely on the detail.

Why do you think implementation details should be declared?
Who needs the information?

--
nosy: +inada.naoki

___
Python tracker 

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



[issue37848] More fully implement Unicode's case mappings

2019-08-13 Thread Greg Price

New submission from Greg Price :

Splitting this out from #32771 for more specific discussion. Benjamin writes 
there that it would be good to:

> implement the locale-specific case mappings of 
> https://www.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt and §3.13 of 
> the Unicode 12 standard in str.lower/upper/casefold.

and adds that an implementation would require having available in the core the 
data on canonical combining classes, which is currently only in the unicodedata 
module.

---

First, I'd like to better understand what functionality we have now and what 
else the standard describes.  Reading 
https://www.unicode.org/Public/12.0.0/ucd/SpecialCasing.txt , I see
* a bunch of rules that aren't language-specific
* some other rules that are.

I also see in makeunicodedata.py that we don't even parse the language-specific 
rules.

Here's, IIUC, a demo of us correctly implementing the language-independent 
rules.  One line in the data file reads:

FB00; FB00; 0046 0066; 0046 0046; # LATIN SMALL LIGATURE FF

And in fact the `lower`, `title`, and `upper` of `\uFB00` are those strings 
respectively:

$ unicode --brief "$(./python -c \
   's="\ufb00"; print(" ".join((s.lower(), s.title(), s.upper(')"
ff U+FB00 LATIN SMALL LIGATURE FF
  U+0020 SPACE
F U+0046 LATIN CAPITAL LETTER F
f U+0066 LATIN SMALL LETTER F
  U+0020 SPACE
F U+0046 LATIN CAPITAL LETTER F
F U+0046 LATIN CAPITAL LETTER F

OK, great.

---


Then here's something we don't implement. Another line in the file reads:

00CD; 0069 0307 0301; 00CD; 00CD; lt; # LATIN CAPITAL LETTER I WITH ACUTE

IOW `'\u00CD'` should lowercase to `'\u0069\u0307\u0301'`, i.e.:

i U+0069 LATIN SMALL LETTER I
 ̇ U+0307 COMBINING DOT ABOVE
 ́ U+0301 COMBINING ACUTE ACCENT

... but only in a Lithuanian (`lt`) locale.

One question is: what would the right API for this be? I'm not sure I'd want 
`str.lower`'s results to depend on the process's current Unix locale... and I 
definitely wouldn't want to get that without some way of instead telling it 
what locale to use. (Either to use a single constant locale, or to use a 
per-user locale in e.g. a web application.)  Perhaps `str.lower` and friends 
would take a keyword argument `locale`?


Oh, one more link for reference: the said section of the standard is in this 
PDF: https://www.unicode.org/versions/Unicode12.0.0/ch03.pdf , near the end.


And a related previous issue: #12736.

--
components: Unicode
messages: 349646
nosy: Greg Price, benjamin.peterson, ezio.melotti, lemburg, vstinner
priority: normal
severity: normal
status: open
title: More fully implement Unicode's case mappings
versions: Python 3.9

___
Python tracker 

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



[issue28747] Expose SSL_CTX_set_cert_verify_callback

2019-08-13 Thread Marcelo Salhab Brogliato


Marcelo Salhab Brogliato  added the comment:

Exposing SSL_CTX_set_cert_verify_callback is useful when we want to use a 
Public Key Authentication, like it is done in the SSH Protocol.

Do you know any other way to use Public Key Authentication besides using 
SSL_CTX_set_cert_verify_callback?

--
nosy: +Marcelo Salhab Brogliato

___
Python tracker 

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



[issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS

2019-08-13 Thread Zackery Spytz


Change by Zackery Spytz :


--
pull_requests: +14986
pull_request: https://github.com/python/cpython/pull/14814

___
Python tracker 

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



[issue37845] SLCertVerificationError: Unable to handle SAN names (from Certifications) published with white spaces at start

2019-08-13 Thread Christian Heimes


Christian Heimes  added the comment:

This is not a bug in Python but a misconfiguration on your side. A workaround 
for a misconfiguration doesn't belong into upstream code. The certificate 
validation code is security-sensitive and I don't feel comfortable to add 
unnecessary string transformation to it. The code refuses bad wildcards because 
we have had more than one CVE related to wildcard matching.

Besides the ssl.match_hostname() function is deprecated and no longer used. 
Starting with Python 3.7 the ssl module uses OpenSSL to verify host names.

I suggest that you either ship this fix locally with your app. Or talk to IT 
again and have them replace the wrong certificate with a correct one that does 
not violate the standards.

--
resolution:  -> rejected
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



[issue37760] Refactor makeunicodedata.py: dedupe parsing, use dataclass

2019-08-13 Thread Greg Price


Change by Greg Price :


--
pull_requests: +14985
pull_request: https://github.com/python/cpython/pull/15265

___
Python tracker 

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



[issue17305] IDNA2008 encoding is missing

2019-08-13 Thread Christian Heimes


Christian Heimes  added the comment:

You have to ask the Chrome team.

--
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



[issue17305] IDNA2008 encoding is missing

2019-08-13 Thread Ashwin Ramaswami

Ashwin Ramaswami  added the comment:

Why would chrome still be using IDNA 2003 to link http://straße.de to 
http://strasse.de?

--

___
Python tracker 

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



[issue37760] Refactor makeunicodedata.py: dedupe parsing, use dataclass

2019-08-13 Thread Greg Price


Greg Price  added the comment:

> From my perspective, the main problem with using type annotations is that 
> there's nothing checking them in CI.

Yeah, fair concern. In fact I think I'm on video (from PyCon 2018) warning 
everyone not to do that in their codebases, because what you really don't want 
is a bunch of annotations that have gradually accumulated falsehoods as the 
code has changed around them.

Still, I think from "some annotations + no checking" the good equilibrium to 
land in "some annotations + checking", not "no annotations + no checking". (I 
do mean "some" -- I don't predict we'll ever go sweep all over adding them.) 
And I think the highest-probability way to get there is to let them continue to 
accumulate where people occasionally add them in new/revised code... because 
that holds a door open for someone to step up to start checking them, and then 
to do the work to make that part of CI. (That someone might even be me! But I 
can think of plenty of other likely folks to do it.)

If we accumulated quite a lot of them and nobody had yet stepped up to make 
checking happen, I'd worry.  But with the smattering we currently have, I think 
that point is far off.

--

___
Python tracker 

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



[issue17305] IDNA2008 encoding is missing

2019-08-13 Thread Ashwin Ramaswami


Change by Ashwin Ramaswami :


--
nosy: +epicfaace
versions: +Python 3.9 -Python 3.8

___
Python tracker 

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



fopen() and open() in cpython

2019-08-13 Thread Windson Yang
After my investigation, I found Since Python maintains its own buffer when
read/write files, the build-in python open() function will call the open()
system call instead of calling standard io fopen() for caching.  So when we
read/write a file in Python, it would not call fopen(), fopen() only use
for Python itself but not for python user. Am I correct?
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2019-08-13 Thread Ashwin Ramaswami


Ashwin Ramaswami  added the comment:

Martin, are you okay with doing this? It seems like this issue has been the 
topic of a few CVEs 
(https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-20060, 
https://cve.mitre.org/cgi-bin/cvename.cgi?name=2018-18074, 
https://curl.haxx.se/docs/CVE-2018-107.html) as well.

--
nosy: +epicfaace

___
Python tracker 

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



[issue35214] Get the test suite passing with clang Memory Sanitizer enabled

2019-08-13 Thread Ashwin Ramaswami


Ashwin Ramaswami  added the comment:

Can this be closed now?

--
nosy: +epicfaace

___
Python tracker 

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



[issue37847] The IDLE does not show previous code suggestions if I tap on the up arrow

2019-08-13 Thread Edwin Pratt


New submission from Edwin Pratt :

If I am typing some Python code in the IDLE, for example a function:

def sayHi(name):
print('Hello ', name)

and I execute the function:

sayHi('Ed')

I can not edit the function or execute a previous line of code again if I tap 
the up arrow on my keyboard. It seemed to work in the previous versions of 
Python. In order to execute a previous line of code I have to either copy it, 
or type it in again.

--
assignee: terry.reedy
components: IDLE
messages: 349638
nosy: Edwin Pratt, terry.reedy
priority: normal
severity: normal
status: open
title: The IDLE does not show previous code suggestions if I tap on the up arrow
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue32423] The Windows SDK version 10.0.15063.0 was not found

2019-08-13 Thread Isuru Fernando


Isuru Fernando  added the comment:

Fixed in https://github.com/python/cpython/pull/12445

--
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



[issue29535] datetime hash is deterministic in some cases

2019-08-13 Thread Ashwin Ramaswami


Ashwin Ramaswami  added the comment:

I've added a PR which should fix this. Do you think the documentation should 
also be updated to change "By default, the :meth:`__hash__` values of str, 
bytes and datetime objects are "salted" with an unpredictable random value." to 
"By default, the :meth:`__hash__` values of str, bytes, datetime.date, 
datetime.time and datetime.datetime objects are "salted" with an unpredictable 
random value."?

Technically, there are other objects in datetime such as datetime.relativedelta 
whose hash values are _not_ non-deterministic.

--

___
Python tracker 

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



[issue37811] [FreeBSD, OSX] Socket module: incorrect usage of poll(2)

2019-08-13 Thread Artem Khramov


Change by Artem Khramov :


--
components: +FreeBSD, IO, Library (Lib), macOS
nosy: +ned.deily, ronaldoussoren

___
Python tracker 

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



[issue37821] IDLE shell uses wrong namespace for completions

2019-08-13 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The current behavior is the quick and easy/dirty solution that we have, not 
what we especially want.  #27609 has multiple issues and ideas for completion 
improvements.  I made testing and improving the code priorities before worrying 
about most of the proposed changes.

Here is where we got confused a bit.  The title refers to shell completions.  
The opening post starts with shell completions and then moves to intended 
behavior for editor completions and its dependence on the presence of a shell.  
I disagreed with the latter and responded, not thinking much about shell 
completions.  Lets stick to shell completions, at least initially (and change 
the title if we include editor completions).

Tal: "Perhaps we should differentiate between completions in the shell vs. when 
editing a file."  I agree that we can consider adjusting the list according to 
the setting.  It is easy enough.  Open_completions, executed in the idle 
process, can detect whether the associated text is the shell or an editor and 
pass a (new) flag to fetch_completions, which will pass it to the 
fetch_completions executed in the run process.
 
Tal: "In the shell, having completions for things not actually available is 
weird".  That I can see and agree to. While the editor allows after-completion 
revisions anywhere in the file before running, the user cannot revise Shell 
history and insert an executed import before executing the current statement.  
A doc statement like "Name and attribute completion in the shell is restricted 
to names and objects available after previous shell statements." seems clear 
enough to anyone who reads it.

As near as I can tell, both before and after the #21261 patch, name (tab) 
completion *is* restricted to valid names.  But attribute completion will 
complete for modules such as socket import by run.py even when not in the main 
namespace.  Python in masOS Terminal (bash, I believe) does attribute 
completion (.), but only for user visible names, not, for instance, for 
reprlib.  The proposal is to restrict IDLE's Shell's attribute completion 
similarly.

Tal: "I really dislike the arbitrary availability of only certain modules for 
completion."  It is not completely arbitrary.  We could complete stdlib names 
from a pre-generated list.  But that would add perhaps 400 names to the name 
completion list.  But we can only complete attributes (which I, at least, use 
much more) for modules in sys.modules. A possible improvement mentioned more 
than once is on-demand import, at least of stdlib modules.  If any are shown to 
be a problem, we could make a blacklist.

--

___
Python tracker 

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



[issue37846] declare that Text I/O use buffer inside

2019-08-13 Thread Windson Yang


New submission from Windson Yang :

At the beginning of https://docs.python.org/3.7/library/io.html#io.RawIOBase, 
we declared that 

> Binary I/O (also called buffered I/O)
and 
> Raw I/O (also called unbuffered I/O)

But we didn't mention if Text I/O use buffer or not which led to confusion. 
Even though we talked about it later in 
https://docs.python.org/3.7/library/io.html#class-hierarchy

> The TextIOBase ABC, another subclass of IOBase, deals with streams whose 
> bytes represent text, and handles encoding and decoding to and from strings. 
> TextIOWrapper, which extends it, is a buffered text interface to a buffered 
> raw stream (BufferedIOBase). Finally, StringIO is an in-memory stream for 
> text.

IMO, it will be better to declare 'Reads and writes are internally buffered in 
order to speed things up' at the very beginning in 

> Text I/O
> Text I/O expects and produces str objects...

or maybe

> class io.TextIOBase
> Base class for text streams. This class provides a character and line based 
> interface to stream I/O. It inherits IOBase. There is no public constructor.

--
assignee: docs@python
components: Documentation
messages: 349633
nosy: Windson Yang, docs@python
priority: normal
severity: normal
status: open
title: declare that Text I/O use buffer inside
type: enhancement
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



[issue37757] TargetScopeError not raised for comprehension scope conflict

2019-08-13 Thread Nick Coghlan


Nick Coghlan  added the comment:

The outcome of the python-dev discussion was that we agreed to switch to 
raising a plain SyntaxError, as that's what we do everywhere else that this 
kind of problem comes up (e.g. conflicts between global and nonlocal 
declarations, or between those and parameter declarations, as well as the 
various other cases of "that statement/expression is fine in isolation, but you 
can't use it *here*").

Both PRs have been updated accordingly, and the PEP PR has been merged.

--

___
Python tracker 

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



[issue37760] Refactor makeunicodedata.py: dedupe parsing, use dataclass

2019-08-13 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset c03e698c344dfc557555b6b07a3ee2702e45f6ee by Benjamin Peterson 
(Greg Price) in branch 'master':
bpo-37760: Factor out standard range-expanding logic in makeunicodedata. 
(GH-15248)
https://github.com/python/cpython/commit/c03e698c344dfc557555b6b07a3ee2702e45f6ee


--

___
Python tracker 

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



[issue37760] Refactor makeunicodedata.py: dedupe parsing, use dataclass

2019-08-13 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

>From my perspective, the main problem with using type annotations is that 
>there's nothing checking them in CI.

--

___
Python tracker 

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



[issue32771] merge the underlying data stores of unicodedata and the str type

2019-08-13 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

The goal is to implement the locale-specific case mappings of 
https://www.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt and §3.13 of 
the Unicode 12 standard in str.lower/upper/casefold. To do this, you need 
access to certain character properties available in unicodedata but not the 
builtin database.

--

___
Python tracker 

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



Re: MySQLdb for 3.6 on RHEL7

2019-08-13 Thread Inada Naoki
On Wed, Aug 14, 2019 at 4:10 AM Larry Martell  wrote:
>
> > > And I was not able to get that from pip either,
> > > as the install failed. I had to download the source, edit the site.cfg
> > > file and build it. But I just found python36-mysql.x86_64 as a package
> > > so I uninstalled mysqlclient and installed that from the repo.
>
> The reason that would not install from pip was because the path to
> mysql_config was not correct in site.cfg - once I changed that I was
> able to build it, but then it gave the other error.
>

It's wrong.  The path to mysql_config is not defined in site.cfg by default.
There is example configuration but it's commented out.
By default mysqlclient searches mysql_config from PATH.

You had not reported enough information from start.  You should explain which
C mysql client library you are using and how you build mysqlclient.

Since you said you need to specify the path of mysql_config, I suppose
you're not using MySQL or C mysql client library provided by your distro.
But you have not show enough information about it yet.

This is linking error.  The error is happened from C library.  You need to
report about it, at least:

* How did you installed C mysql client library.
* The output of the `mysql_config`
* The output of the `ldd
/usr/local/lib64/python3.6/site-packages/mysqlclient-1.4.4-py3.6-linux-x86_64.egg/MySQLdb/_mysql.cpython-36m-x86_64-linux-gnu.so`

Regards,
-- 
Inada Naoki  
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue37831] bool(~True) == True

2019-08-13 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Essentially we've got two competing desires:

* Given that & | and ^ are closed under bools,
  it would be nice for ~ to be closed as well.
  NOT isn't a reasonable alternative because
  of its operator precedence.

* Given that bool is a subclass of int,
  its operations should give results equivalent
  to what you would get for ints.

When reopening this, my thought was that the
first desire should win based on practicality-
beats-purity.  In the context of bools, the
current ~ operator violates user expectations
and there isn't a reasonable alternative that
has the correct precedence.

But in the face of opposition to the idea,
am willing to just let it die.  In the scheme
of things, it isn't important.

--

___
Python tracker 

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



[issue37256] urllib.request.Request documentation erroneously refers to the "final two"

2019-08-13 Thread Senthil Kumaran


Senthil Kumaran  added the comment:


New changeset 38c7199beb30ae9a5005c0f0d9df9fae0da3680a by Senthil Kumaran 
(Ngalim Siregar) in branch 'master':
bpo-37256: Wording in Request class docs (#14792)
https://github.com/python/cpython/commit/38c7199beb30ae9a5005c0f0d9df9fae0da3680a


--

___
Python tracker 

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



[issue29535] datetime hash is deterministic in some cases

2019-08-13 Thread Ashwin Ramaswami


Change by Ashwin Ramaswami :


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

___
Python tracker 

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



Re: Opening Python 3.8 in Visual Studio 2019

2019-08-13 Thread MRAB

On 2019-08-13 20:31, Moe Vyas wrote:

Greetings.
Can anyone please, tell me how to open Python 3.8 Interpreter in the Visual
Studio 2019. I have downloaded both of these on my Windows laptop and now
am struggling to make them work together!!?


Have a read here:

https://docs.microsoft.com/en-us/visualstudio/python/tutorial-working-with-python-in-visual-studio-step-01-create-project?view=vs-2019
--
https://mail.python.org/mailman/listinfo/python-list


[issue37834] readlink on Windows cannot read app exec links

2019-08-13 Thread Steve Dower


Steve Dower  added the comment:

> I'm wary of trying to return it without the prefix.

Me too, but suddenly adding "\\?\" to the paths breaks a lot of assumptions.

> We would need a function that's shared with the proposed implementation of 
> realpath() to determine whether the given path (not the final path) is safe 
> to return as a normal DOS or UNC path.

My idea was to GetFinalPathName(path[4:])[4:] and if that fails, don't strip 
the prefix. Which is obviously not be perfect, but since we're not going to add 
a check for the LongPathsEnabled flag (let alone any of the other edge cases), 
we can't easily figure out whether it's safe to return manually.

I really want a fix for this in 3.8, or else os.stat(sys.executable) may fail, 
but I don't think changing the result of readlink() is okay at this stage. 
Maybe I'll leave that out for now and just take the st_reparse_tag and stat() 
changes?

--

___
Python tracker 

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



Re: Create multiple sqlite tables, many-to-many design

2019-08-13 Thread Rich Shepard

On Wed, 14 Aug 2019, MRAB wrote:


The actual code is different. htbl, ttbl, jtbl, etc. Too short?


Definitely! :-)

Another thing you might want to avoid is naming something with what it is, 
e.g. "Trails_Table" (why not just "Trails").


Another reason to read Celko's 'SQL Programming Style.'

In the 1970s I was writing FORTRAN ecosystem models punched on 80-column
Hollerith cards using an IBM 029 keypunch. Everything was as short as
possible, especially variable names. There were two valuable lessons I
learned (in addition to marking a Sharpie pen line diagonally across the
card deck to make it easier to put back in sequence when the box was
dropped):

1. Make variable names fully descriptive.

2. Write many comments to explain what things are and why you're doing
things the way you are.

The reason is that within 6 months (or less) you will look at your schema
and code and have no idea what's going on or why you wrote it like that.

Table names are commonly written with initial uppercase letters; variables
in all lowercase. Leave CamelCase in the desert. Use underscores between
words, e.g., hike_id, trail_nbr, not hyphens.

And, you might not be the only person looking at the schema and code needing
to understand what's going on.

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


Re: Create multiple sqlite tables, many-to-many design

2019-08-13 Thread MRAB

On 2019-08-13 22:11, Dave via Python-list wrote:

On 8/13/19 4:45 PM, MRAB wrote:

On 2019-08-13 19:59, Chris Angelico wrote:

On Wed, Aug 14, 2019 at 4:50 AM Dave via Python-list
 wrote:

Some of the tables are related.  For example:

Hiking_Table Trails_Table    Joining_Table
-        -
hike_id PK   trail_id  PK    hike_id   FK
hike_date  TEXT  trail_name  TEXT    trail_id   FK
hike_destination TEXT    trail_rating REAL
hike_rating  REAL    trail_comments TEXT
hike_comments  TEXT


[snip]
Might I also suggest dropping unnecessary prefixes from the field names. 
For example, "hike_comments" in "Hiking_Table" can be called just 
"comments" because it's clear from the context that a field called 
"comments" in the hiking table will contain comments about hiking, if 
you see what I mean.


I do indeed.  I did that so it was easy for everyone to follow.  Having
started with assm. and C, I have to remind myself to be more explanatory
in naming.  Guess I over-did it.  The actual code is different. htbl,
ttbl, jtbl, etc.  Too short?


Definitely! :-)

Another thing you might want to avoid is naming something with what it 
is, e.g. "Trails_Table" (why not just "Trails").

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


Re: Web framework for static pages

2019-08-13 Thread Morten W. Petersen
Hi "DL Neil".

I find your argumentation combative and provoking.

I have an ex that has made my life difficult for the last 6 years, blocking
me from seeing my kids, she acts in a similar way.

I don't have the time, energy or the will to bring more of that stuff into
my life, so I won't reply to this type of email.

-Morten

Blogging at http://blogologue.com
Tweeting at https://twitter.com/blogologue
On Instagram https://instagram.com/morphexx

ons. 14. aug. 2019, 01.27 skrev DL Neil :

> On 13/08/19 10:54 PM, Morten W. Petersen wrote:
> > I was hoping to avoid testing a lot of different systems, spending time
> > there.
>
> Sooner or later you have to make a decision - and be responsible for it
> to your clients.
>
>
> > So that's why I'm asking here.
>
> People here are helpful. The more time you put-in, the more inclined
> folk are to help further.
>
>
> > I don't need a guide to create a website, maybe a refresher on some
> topics.
>
> Respectfully, and knowing only the little posted here, this seems an
> under-statement, eg you don't appear know how HTML5 succeeds and exceeds
> XHTML (and has done so for many years). Do you under-estimate how much
> things have developed during the last decade?
>
>
> > Ideally I'd want a static site generator that makes it easy and quick to
> > create a website which is pretty, accessible, works across browsers and
> > standards compliant and doesn't freeze the browser on a low-end phone.
>
> In, XHTML???
>
> This stuff is not straight-forward. Neither is it Python/a topic for
> this list.
>
> Whilst I place myself in the 'master' category for HTML5 development and
> cheerfully regard manually knocking-out the likes of an "About Us"
> static page using nothing more than a basic editor as "quick and easy",
> there is no room for such 'purity' and idealism when phones and
> 'responsive' elements enter the picture. "Here be dragons"!
>
> I'm wary of claiming such a skill-level in Python - particularly given
> its incredibly wide range of application. That side of the process can
> be simple or complex - you choose.
>
> [this further to comment after next para]
> "Flask" has been mentioned, and over many years Mig has contributed
> numbers of tutorials, videos, articles, and books; which IMHO make it
> easy to understand that package - and most others (in this category). As
> such, I recommend it as a great starting-point, even if that learning
> better-equips you to change to something else later!
> (see also mention in other contributions to this thread)
>
>
> > And where it is easy to override using for example plain or template
> > HTML, or extend programmatic features using some plugins or just
> > subclassing.
>
> Using Python as an 'engine' to generate a web-site, either as a static
> file-set or as part of a web server is relatively trivial. Some of your
> more detailed specs will likely lead you down one or another path. What
> inspiration did you get from reading-up about Flask? Pelican? Other
> suggestions made 'here'? In what way did they not meet the mark?
>
>
> > Do you know of a XML DTD for HTML5 by the way?
>
> See above.
> (How is a web page declared to be HTML5, cf any other format? How does
> one ensure that a web page is 'HTML5-compliant'? How does/can one do
> "pretty" in (X)HTML?)
> --
> Regards =dn
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: MySQLdb for 3.6 on RHEL7

2019-08-13 Thread Chris Angelico
On Wed, Aug 14, 2019 at 9:27 AM DL Neil  wrote:
>
> On 14/08/19 6:14 AM, Chris Angelico wrote:
> > That seems very odd. The mysqlclient binary might be just under a
> > different name? I'm not familiar with RHEL, but on my Debian, there
> > are packages like "mysql-server-5.7" and corresponding
> > "mysql-client-5.7". Or do you mean the Python client?
>
> Just in case: please be aware that the MySQL-client which enables a
> cmdLN interface to the server, is quite different from the
> Python-Connector which will be called from Python code.

Hmm. Where would the C libraries be? I would have thought
"mysql-client" included the necessary binary library for the Python
MySQL .so to link against.

It's been ages since I dug into any of the details of MySQL setup. I
moved completely to PostgreSQL years ago and haven't looked back.

> As Chris has said, there are combinations of clients and servers, many
> of which are incompatible. Like him, I've stuck with MySQL v5 by reason
> of exactly this sort of inter-dependence (MySQL-Workbench? - admittedly
> a decision made, I estimate, over one year ago) - whereas MySQL
> Community will 'favor' v8.n!

Actually I've "stuck" with version 5 simply because it's currently
installed here and I haven't seen fit to uninstall it. Which probably
means that Debian's repositories are still shipping a 5.x. But on
analysis, this is turning out to be actually MariaDB... no idea
whether that's significant or not.

> Recommend:
> - clear-out 'everything' MySQL-related
> - install the MySQL (Community) site's repo (v5 or v8, as you see fit)
> - using rpm/yum/dnf, assemble your tool-set directly from them
> (single-source!)
> - test using the MySQL cmdLN client
> - only thereafter move to testing the Python/Django connection.

That sounds like a good plan.

> I have no problems with/complaints about MySQL's Python-Connector (and
> usually stick to the simpler interface/API).
>
> Various alternative interfaces (to MySQL's) seem quite similar, and
> often require identical code/function calls from within Python...
>
> I can't speak to the Django-MySQL interface.
>
> When the time comes, your client can shell-out for MySQL support, and
> build (essentially) the same environment for the 'live env', from those
> repos!

Another thing to consider is additional middleware like SQLAlchemy,
which may make things easier, but may just add more complications.

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


Re: MySQLdb for 3.6 on RHEL7

2019-08-13 Thread DL Neil

On 14/08/19 6:14 AM, Chris Angelico wrote:

On Wed, Aug 14, 2019 at 1:48 AM Larry Martell  wrote:


On Tue, Aug 13, 2019 at 9:59 AM Chris Angelico  wrote:


On Tue, Aug 13, 2019 at 11:33 PM Larry Martell  wrote:


I am trying to install MySQLdb (https://pypi.org/project/mysqlclient/)
for python3.6 on RHEL7.
When I import it, it fails:

...


Has anyone seen and resolved this?


Not specifically, but that looks like a versioning conflict. Most
likely, your mysqlclient is too old for MySQLdb to connect to.


+1



Did you get one of them from your system package manager and the other
from pip? If so, try to get both from the same place.


So I have MySQL from the system package manager, but mysqlclient is
not available there.


By which you mean RedHat's repository?



That seems very odd. The mysqlclient binary might be just under a
different name? I'm not familiar with RHEL, but on my Debian, there
are packages like "mysql-server-5.7" and corresponding
"mysql-client-5.7". Or do you mean the Python client?


Just in case: please be aware that the MySQL-client which enables a 
cmdLN interface to the server, is quite different from the 
Python-Connector which will be called from Python code.




And I was not able to get that from pip either,
as the install failed. I had to download the source, edit the site.cfg
file and build it. But I just found python36-mysql.x86_64 as a package
so I uninstalled mysqlclient and installed that from the repo.


Based on this, I'm thinking possibly you meant the Python client. It
may still be that you need to install the C client for the Python one
to connect to. Although if you got python36-mysql from your system
repo, that ought to drag in the appropriate mysqlclient. So now I'm
very confused.


+1



That did not get the above error, but now I get this:
 raise ImproperlyConfigured('mysqlclient 1.3.13 or newer is
required; you have %s.' % Database.__version__)
django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or
newer is required; you have 1.3.12.


This claims to be a Django error, though, so maybe the issue here
isn't with MySQLdb but with Django?? Maybe everything up above is
actually correctly matched, but too old?


I often develop on CentOS/Fedora* whereas the client has paid-for RedHat 
support. To keep the two environments in-sync, I always use the MySQL 
(Community) repo(s).
* which is yet another 'battle' because "MariaDB" may be installed 
by-default, in preference to MySQL)


As Chris has said, there are combinations of clients and servers, many 
of which are incompatible. Like him, I've stuck with MySQL v5 by reason 
of exactly this sort of inter-dependence (MySQL-Workbench? - admittedly 
a decision made, I estimate, over one year ago) - whereas MySQL 
Community will 'favor' v8.n!


Recommend:
- clear-out 'everything' MySQL-related
- install the MySQL (Community) site's repo (v5 or v8, as you see fit)
- using rpm/yum/dnf, assemble your tool-set directly from them 
(single-source!)

- test using the MySQL cmdLN client
- only thereafter move to testing the Python/Django connection.

I have no problems with/complaints about MySQL's Python-Connector (and 
usually stick to the simpler interface/API).


Various alternative interfaces (to MySQL's) seem quite similar, and 
often require identical code/function calls from within Python...


I can't speak to the Django-MySQL interface.

When the time comes, your client can shell-out for MySQL support, and 
build (essentially) the same environment for the 'live env', from those 
repos!


--
Regards =dn
--
https://mail.python.org/mailman/listinfo/python-list


Re: Web framework for static pages

2019-08-13 Thread DL Neil

On 13/08/19 10:54 PM, Morten W. Petersen wrote:
I was hoping to avoid testing a lot of different systems, spending time 
there.


Sooner or later you have to make a decision - and be responsible for it 
to your clients.




So that's why I'm asking here.


People here are helpful. The more time you put-in, the more inclined 
folk are to help further.




I don't need a guide to create a website, maybe a refresher on some topics.


Respectfully, and knowing only the little posted here, this seems an 
under-statement, eg you don't appear know how HTML5 succeeds and exceeds 
XHTML (and has done so for many years). Do you under-estimate how much 
things have developed during the last decade?



Ideally I'd want a static site generator that makes it easy and quick to 
create a website which is pretty, accessible, works across browsers and 
standards compliant and doesn't freeze the browser on a low-end phone.


In, XHTML???

This stuff is not straight-forward. Neither is it Python/a topic for 
this list.


Whilst I place myself in the 'master' category for HTML5 development and 
cheerfully regard manually knocking-out the likes of an "About Us" 
static page using nothing more than a basic editor as "quick and easy", 
there is no room for such 'purity' and idealism when phones and 
'responsive' elements enter the picture. "Here be dragons"!


I'm wary of claiming such a skill-level in Python - particularly given 
its incredibly wide range of application. That side of the process can 
be simple or complex - you choose.


[this further to comment after next para]
"Flask" has been mentioned, and over many years Mig has contributed 
numbers of tutorials, videos, articles, and books; which IMHO make it 
easy to understand that package - and most others (in this category). As 
such, I recommend it as a great starting-point, even if that learning 
better-equips you to change to something else later!

(see also mention in other contributions to this thread)


And where it is easy to override using for example plain or template 
HTML, or extend programmatic features using some plugins or just 
subclassing.


Using Python as an 'engine' to generate a web-site, either as a static 
file-set or as part of a web server is relatively trivial. Some of your 
more detailed specs will likely lead you down one or another path. What 
inspiration did you get from reading-up about Flask? Pelican? Other 
suggestions made 'here'? In what way did they not meet the mark?




Do you know of a XML DTD for HTML5 by the way?


See above.
(How is a web page declared to be HTML5, cf any other format? How does 
one ensure that a web page is 'HTML5-compliant'? How does/can one do 
"pretty" in (X)HTML?)

--
Regards =dn
--
https://mail.python.org/mailman/listinfo/python-list


Re: Fwd: Startup problems

2019-08-13 Thread Cameron Simpson

On 13Aug2019 19:05, Vinayak Gopakumar  wrote:

dear developer,
 I'm having problems while starting IDLE 3.7.4. With
this problem, I cannot finish my studies properly. The screenshot of the
problem is attached to this mail.


This list discards all attachments.

A cut/paste of error messages inline in the message text is required to 
show us any errors. (This has the advantage that we can ourselve copy 
that text, which is useful in replies.)



   I hope that you would provide assistance for me for recovering the
above-said problem


Please describe your operating system and where you obtained your ptyhon 
install, and what you did to start IDLE. Otherwise we do not have enough 
context to assist.


Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-08-13 Thread Bennet Fauber


Bennet Fauber  added the comment:

Perhaps I should add, that we are able to reproduce this behavior on this 
hardware

Dell R640 Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz
Dell R740 Intel(R) Xeon(R) Gold 6130 CPU @ 2.10GHz
Dell R440 Intel(R) Xeon(R) Silver 4116 CPU @ 2.10GHz
Dell C6420 Intel(R) Xeon(R) Silver 4116 CPU @ 2.10GHz

but not on other chips, such as a recent i5, Haswell family, and older.  That 
may also make a difference if someone tries to reproduce this.

--

___
Python tracker 

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



Re: How to plot a data including date and time?

2019-08-13 Thread Chris Angelico
On Wed, Aug 14, 2019 at 8:17 AM Rich Shepard  wrote:
>
> On Tue, 13 Aug 2019, amirrezaheidary...@gmail.com wrote:
>
> > I have a .csv file, in first column I have date and hour, and in the
> > second column I have energy use data. How can I make a bar chart with Date
> > and time as the x axis and the energy use as the Y axis?
>
> First, find yourself a plotting program (R and PSTricks are two I use;
> matplotlib also does a fine job).

Given that we're on python-list here, matplotlib would be the obvious
choice here :)

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


Re: How to plot a data including date and time?

2019-08-13 Thread Rich Shepard

On Tue, 13 Aug 2019, amirrezaheidary...@gmail.com wrote:


I have a .csv file, in first column I have date and hour, and in the
second column I have energy use data. How can I make a bar chart with Date
and time as the x axis and the energy use as the Y axis?


First, find yourself a plotting program (R and PSTricks are two I use;
matplotlib also does a fine job). Second, learn what data format and
manipulation that application uses on provided data. Third, learn that
application/language and plot your data after importing it to the
application.

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


[issue25172] Unix-only crypt should not be present on Windows.

2019-08-13 Thread Srinivas Nyayapati


Srinivas Nyayapati  added the comment:

Thank you Steve for accepting my pull requests. 

I was surprised to see the methods in the class and its decorators getting 
evaluated and causing the failures initially, but I then realized that the code 
is parsed before execution and that's when I was seeing the failure.

--

___
Python tracker 

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



Re: Create multiple sqlite tables, many-to-many design

2019-08-13 Thread Dave via Python-list

On 8/13/19 5:46 PM, Rich Shepard wrote:

On Tue, 13 Aug 2019, Rich Shepard wrote:


Read Joe Celko's books, starting with his SQL Programming Guide, then SQL


That should be SQL Programming Style

Rich


Rich,

On my next trip to BN I'll see if they have them.  That is long term 
though.  Right now I just need to know how to populate the join table 
and anything else that has escaped me.


SQL is cool.  SQL + Python (or C or C++ or Java) is more cool.  Lot 
easier to understand than pointer math in C.


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


[issue25172] Unix-only crypt should not be present on Windows.

2019-08-13 Thread miss-islington


miss-islington  added the comment:


New changeset e7ec9e04c82be72aef621fdfba03f41cbd8599aa by Miss Islington (bot) 
in branch '3.8':
bpo-25172: Add test for crypt ImportError on Windows (GH-15252)
https://github.com/python/cpython/commit/e7ec9e04c82be72aef621fdfba03f41cbd8599aa


--

___
Python tracker 

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



How to plot a data including date and time?

2019-08-13 Thread amirrezaheidarysbu
I have a .csv file, in first column I have date and hour, and in the second 
column I have energy use data. How can I make a bar chart with Date and time as 
the x axis and the energy use as the Y axis?

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


Re: Create multiple sqlite tables, many-to-many design

2019-08-13 Thread Rich Shepard

On Tue, 13 Aug 2019, Rich Shepard wrote:


Read Joe Celko's books, starting with his SQL Programming Guide, then SQL


That should be SQL Programming Style

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


Re: Create multiple sqlite tables, many-to-many design

2019-08-13 Thread Chris Angelico
On Wed, Aug 14, 2019 at 7:26 AM Dave via Python-list
 wrote:
> Thanks for the note.  I get the theory of MTM and the join table.  It is
> the implementation I don't get.  Let me see if I can demonstrate my
> confusion using pseudo code.
>
> def dbDataInsert():
>
>  sql_HikeInsert = """ INSERT INTO hike (
>   hike_date,
>   hike_destination,
>   hike_rating,
>   hike_comments )
>   VALUES (
>   hdate,
>   hdestination,
>   hrating,
>   hcomments ) """
>
>  sql_TrailInsert = """ NSERT INTO trail (
>   trail_name,
>   trail_rating,
>   trail_comment )
>VALUES (
>   tname1,
>   trating1,
>   tcomments1 ) """
>
>  sql_TrailInsert = """ NSERT INTO trail (
>   trail_name,
>   trail_rating,
>   trail_comment )
>VALUES (
>   tname2,
>   trating2,
>   tcomments2 ) """
>
>  """ ---> Now what?  I need to populate the join (hike_trail) table.
>   Do I query the tables to get the id's?  Is there another
>   way?  This is the part I really don't get.  """
>

Gotcha!

Some database engines (including PostgreSQL) allow you to add a
RETURNING clause to your INSERT statement, which will then turn it
into a combined "insert, then select from the newly-inserted rows".
SQLite3 does not have this, but there is a special attribute on the
cursor (which you haven't shown in the cut-down example here, but I
presume you know what I'm talking about) to retrieve the ID of the
newly-inserted row:

https://docs.python.org/3/library/sqlite3.html#sqlite3.Cursor.lastrowid

So after inserting into the hike table, you can grab the ID of that
row off the cursor, and then same after the trail. Then you just
insert into the join table using those IDs.

A proper RETURNING clause is far more flexible (it can handle multiple
rows, it can be chained into other queries, etc), but this should be
sufficient for what you're doing here.

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


[issue37834] readlink on Windows cannot read app exec links

2019-08-13 Thread Eryk Sun


Eryk Sun  added the comment:

> Until then, I think it makes sense for os.readlink() to handle the 
> prefix and _getfinalpathname() call, but leave nt.readlink() as
> returning the raw value.

os.readlink() shouldn't resolve the final path or realpath(). It should simply 
return the link substitute path, which starts with "?\\". I'm wary of 
trying to return it without the prefix. We would need a function that's shared 
with the proposed implementation of realpath() to determine whether the given 
path (not the final path) is safe to return as a normal DOS or UNC path.

---

BTW, I looked into how CreateFileW is supporting "\\??\\". It turns out at some 
point they changed RtlpDosPathNameToRelativeNtPathName to look for both 
"?\\" and "\\??\\" when determining whether to skip normalizing the path. I 
think that's a bad idea since the Windows API doesn't consistently support the 
NT prefix.

ReactOS is supposed to target NT 5.2 (Server 2003), and it doesn't allow the NT 
prefix here. Refer to its implementation of 
RtlpDosPathNameToRelativeNtPathName_Ustr [1]. It only looks for 
RtlpWin32NtRootSlash ("?\\"), not RtlpDosDevicesPrefix ("\\??\\"). So I 
suppose Windows changed this some time between Vista and Windows 10.

[1] 
https://github.com/reactos/reactos/blob/d93e516747e3220ba182f77824e8b1a8b548edae/sdk/lib/rtl/path.c#L1034

--

___
Python tracker 

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



Re: Create multiple sqlite tables, many-to-many design

2019-08-13 Thread Rich Shepard

On Tue, 13 Aug 2019, Dave via Python-list wrote:


I do indeed. I did that so it was easy for everyone to follow. Having
started with assm. and C, I have to remind myself to be more explanatory
in naming. Guess I over-did it. The actual code is different. htbl, ttbl,
jtbl, etc. Too short?


Dave,

I encourage you to step back and approach your project from a different
side. Databases, especially relational ones using SQL, are a very different
world from Assembly, C, Python, and other procedural/functional/whatever
languages.

Read Joe Celko's books, starting with his SQL Programming Guide, then SQL
for Smarties. A book on relational database design (other than these) would
help. One I've used is Van der Laans' 'Introductory SQL'.

SQL is a set language and thinking in sets is different from thinking in
step-wise procedures. With SQL to tell the engine what you want, not how to
do it. The engine decides the optimal way of getting the results you want
from the tables.

There are three components of SQL; most of us use only two of them: DDL
(Data Definition Language) to define tables and relationships and DML (Data
Manipulation Language) which we use to write queries.

When you get your head around all this consider using Python and SQLAlchemy
with SQLite3, postgresql, or whatever you want for the database back end.

Good luck!

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


[issue25172] Unix-only crypt should not be present on Windows.

2019-08-13 Thread Steve Dower


Steve Dower  added the comment:

Thanks for the patches, Srinivas!

--
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



[issue25172] Unix-only crypt should not be present on Windows.

2019-08-13 Thread miss-islington


miss-islington  added the comment:


New changeset 7f7f74734acd729d1f82b7cf672e064c9525fced by Miss Islington (bot) 
in branch '3.8':
bpo-25172: Raise appropriate ImportError msg when crypt module used on Windows 
(GH-15149)
https://github.com/python/cpython/commit/7f7f74734acd729d1f82b7cf672e064c9525fced


--
nosy: +miss-islington

___
Python tracker 

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



[issue25172] Unix-only crypt should not be present on Windows.

2019-08-13 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14982
pull_request: https://github.com/python/cpython/pull/15263

___
Python tracker 

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



Re: Create multiple sqlite tables, many-to-many design

2019-08-13 Thread Dave via Python-list

On 8/13/19 2:59 PM, Chris Angelico wrote:

On Wed, Aug 14, 2019 at 4:50 AM Dave via Python-list
 wrote:

Some of the tables are related.  For example:

Hiking_Table Trails_TableJoining_Table
--
hike_id PK   trail_id  PKhike_id   FK
hike_date  TEXT  trail_name  TEXTtrail_id   FK
hike_destination TEXTtrail_rating REAL
hike_rating  REALtrail_comments TEXT
hike_comments  TEXT

So far, so good.  I know how to create the tables.  What I am struggling
with is how do I insert data into the joining table or don"t I?  If so,
do I need to query the other two tables to get the auto-number ID's?
Some things I have read suggest that the joining table just contains
references, so there is no actual insert.  A pointer to information how
to do this would be appreciated.  As for queries, I think I use joins,
but a pointer on how to do this would also be appreciated.


The joining table is a real thing, and will have real inserts. It
might be easier to think of this as two separate one-to-many
relationships; for the sake of demonstration, I'm going to add another
column to your joining table.

hike_sections ==> hike_id references hikes, trail_id references
trails, companion_name

You've decided to have someone with you for some sections of your
hike. As such, what we have is a number of "mini-hikes" that make up a
single hike (that's a one-to-many relationship between hikes and
sections), and also a single trail can be a section of any number of
hikes (so, another one-to-many relationship between trails and
sections). For any given section, there is exactly one companion.

Does this make the many-to-many relationship a bit easier to
understand? It'll work exactly the same way even if you have no
ancillary information in that joining table.

ChrisA


Chris,

Thanks for the note.  I get the theory of MTM and the join table.  It is 
the implementation I don't get.  Let me see if I can demonstrate my 
confusion using pseudo code.


def dbTables_create (dbpath):

sql_HikeTable = """ CREATE TABLE IF NOT EXISTS hike (
hike_id INTEGER AUTO_INCREMENT PRIMARY KEY,
hike_date TEXT,
hike_destination TEXT,
hike_rating REAL,
hike_comments TEXT ) """

sql_TrailTable = """ CREATE TABLE IF NOT EXISTS trail (
trail_id INTEGER AUTO_INCREMENT PRIMARY KEY,
trail_name TEXT,
trail_rating REAL,
trail_comment TEXT ) """

sql_JoiningTable = """ CREATE TABLE IF NOT EXISTS hike_trail (
hike_id INTEGER
trail_id INTEGER ) """

# Some more code to open connection, create cursor, execute SQL.

def getUserInput ():
# Code to get the user input.
# The user input is:
hdate = "2019-05-28"
hdestination = "Top of White Face Mountain, NY."
hrating = 5.0   # Rating scale 1.0 (bad) to 5.0 (perfect).
hcomments "Got to do again.  Better shoes needed."
tname1 = "Brookside"
trating1 = 4.5
tcomments1 = "Easy"
tname2 = "Wilmington Trail"
trating2 = 4.9
tcomments2 = "Awesome!!"

def dbDataInsert():

sql_HikeInsert = """ INSERT INTO hike (
 hike_date,
 hike_destination,
 hike_rating,
 hike_comments )
 VALUES (
 hdate,
 hdestination,
 hrating,
 hcomments ) """

sql_TrailInsert = """ NSERT INTO trail (
 trail_name,
 trail_rating,
 trail_comment )
  VALUES (
 tname1,
 trating1,
 tcomments1 ) """

sql_TrailInsert = """ NSERT INTO trail (
 trail_name,
 trail_rating,
 trail_comment )
  VALUES (
 tname2,
 trating2,
 tcomments2 ) """

""" ---> Now what?  I need to populate the join (hike_trail) table.
 Do I query the tables to get the id's?  Is there another
 way?  This is the part I really don't get.  """

Dave,


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


[issue25172] Unix-only crypt should not be present on Windows.

2019-08-13 Thread Steve Dower


Steve Dower  added the comment:


New changeset 243a73deee4ac61fe06602b7ed56b6df01e19f27 by Steve Dower 
(shireenrao) in branch 'master':
bpo-25172: Add test for crypt ImportError on Windows (GH-15252)
https://github.com/python/cpython/commit/243a73deee4ac61fe06602b7ed56b6df01e19f27


--

___
Python tracker 

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



Re: Create multiple sqlite tables, many-to-many design

2019-08-13 Thread Dave via Python-list

On 8/13/19 4:45 PM, MRAB wrote:

On 2019-08-13 19:59, Chris Angelico wrote:

On Wed, Aug 14, 2019 at 4:50 AM Dave via Python-list
 wrote:

Some of the tables are related.  For example:

Hiking_Table Trails_Table    Joining_Table
-        -
hike_id PK   trail_id  PK    hike_id   FK
hike_date  TEXT  trail_name  TEXT    trail_id   FK
hike_destination TEXT    trail_rating REAL
hike_rating  REAL    trail_comments TEXT
hike_comments  TEXT

So far, so good.  I know how to create the tables.  What I am struggling
with is how do I insert data into the joining table or don"t I?  If so,
do I need to query the other two tables to get the auto-number ID's?
Some things I have read suggest that the joining table just contains
references, so there is no actual insert.  A pointer to information how
to do this would be appreciated.  As for queries, I think I use joins,
but a pointer on how to do this would also be appreciated.


The joining table is a real thing, and will have real inserts. It
might be easier to think of this as two separate one-to-many
relationships; for the sake of demonstration, I'm going to add another
column to your joining table.

hike_sections ==> hike_id references hikes, trail_id references
trails, companion_name

You've decided to have someone with you for some sections of your
hike. As such, what we have is a number of "mini-hikes" that make up a
single hike (that's a one-to-many relationship between hikes and
sections), and also a single trail can be a section of any number of
hikes (so, another one-to-many relationship between trails and
sections). For any given section, there is exactly one companion.

Does this make the many-to-many relationship a bit easier to
understand? It'll work exactly the same way even if you have no
ancillary information in that joining table.

Might I also suggest dropping unnecessary prefixes from the field names. 
For example, "hike_comments" in "Hiking_Table" can be called just 
"comments" because it's clear from the context that a field called 
"comments" in the hiking table will contain comments about hiking, if 
you see what I mean.


I do indeed.  I did that so it was easy for everyone to follow.  Having 
started with assm. and C, I have to remind myself to be more explanatory 
in naming.  Guess I over-did it.  The actual code is different. htbl, 
ttbl, jtbl, etc.  Too short?


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


[issue37834] readlink on Windows cannot read app exec links

2019-08-13 Thread Steve Dower


Steve Dower  added the comment:

I think we'll want issue9949 merged as well, so that ntpath.realpath() does its 
job. Certainly the tests would benefit from it.

Until then, I think it makes sense for os.readlink() to handle the prefix and 
_getfinalpathname() call, but leave nt.readlink() as returning the raw value.

--

___
Python tracker 

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



Re: Create multiple sqlite tables, many-to-many design

2019-08-13 Thread MRAB

On 2019-08-13 19:59, Chris Angelico wrote:

On Wed, Aug 14, 2019 at 4:50 AM Dave via Python-list
 wrote:

Some of the tables are related.  For example:

Hiking_Table Trails_TableJoining_Table
--
hike_id PK   trail_id  PKhike_id   FK
hike_date  TEXT  trail_name  TEXTtrail_id   FK
hike_destination TEXTtrail_rating REAL
hike_rating  REALtrail_comments TEXT
hike_comments  TEXT

So far, so good.  I know how to create the tables.  What I am struggling
with is how do I insert data into the joining table or don"t I?  If so,
do I need to query the other two tables to get the auto-number ID's?
Some things I have read suggest that the joining table just contains
references, so there is no actual insert.  A pointer to information how
to do this would be appreciated.  As for queries, I think I use joins,
but a pointer on how to do this would also be appreciated.


The joining table is a real thing, and will have real inserts. It
might be easier to think of this as two separate one-to-many
relationships; for the sake of demonstration, I'm going to add another
column to your joining table.

hike_sections ==> hike_id references hikes, trail_id references
trails, companion_name

You've decided to have someone with you for some sections of your
hike. As such, what we have is a number of "mini-hikes" that make up a
single hike (that's a one-to-many relationship between hikes and
sections), and also a single trail can be a section of any number of
hikes (so, another one-to-many relationship between trails and
sections). For any given section, there is exactly one companion.

Does this make the many-to-many relationship a bit easier to
understand? It'll work exactly the same way even if you have no
ancillary information in that joining table.

Might I also suggest dropping unnecessary prefixes from the field names. 
For example, "hike_comments" in "Hiking_Table" can be called just 
"comments" because it's clear from the context that a field called 
"comments" in the hiking table will contain comments about hiking, if 
you see what I mean.

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


[issue29535] datetime hash is deterministic in some cases

2019-08-13 Thread Armin Rigo


Change by Armin Rigo :


--
nosy:  -arigo

___
Python tracker 

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



Opening Python 3.8 in Visual Studio 2019

2019-08-13 Thread Moe Vyas
Greetings.
Can anyone please, tell me how to open Python 3.8 Interpreter in the Visual
Studio 2019. I have downloaded both of these on my Windows laptop and now
am struggling to make them work together!!?

Thanks in advance.

*Regards*
*Moe Vyas*
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Web framework for static pages

2019-08-13 Thread Joel Goldstick
On Tue, Aug 13, 2019 at 4:12 PM Morten W. Petersen  wrote:
>
> Hi Joel.
>
> I don't disagree with what you're saying, but is there a documented way of 
> making Django produce a neat set of static pages?
>
> It would be nice to use a web application framework to create pages, because 
> it would after that be easy to add a little bit of logic if a customer wants 
> it. A contact form, an order form, etc.

Django has a feature called static pages.. I'm not up to the latest,
but check that you.  Perhaps it will work for you

>
> Zope/Plone has its own set of features and applications I know well, if a 
> customer wants a dynamic website with a lot of logic (dynamic pages).
>
> -Morten
>
> Blogging at http://blogologue.com
> Tweeting at https://twitter.com/blogologue
> On Instagram https://instagram.com/morphexx
>
> tir. 13. aug. 2019, 21.08 skrev Joel Goldstick :
>>
>> On Tue, Aug 13, 2019 at 2:46 PM DL Neil  
>> wrote:
>> >
>> > On 14/08/19 2:26 AM, Grant Edwards wrote:
>> > > On 2019-08-13, Jon Ribbens via Python-list  
>> > > wrote:
>> > >
>> > >> If it's really that small then it sounds like what you are looking for
>> > >> is known as a "text editor".
>> > >
>> > > Bah.  Kids these days.
>> > >
>> > >$ cat > index.hmtl
>> >
>> > [roaring with laughter]
>> >
>> >
>> >
>> > Oh come now. Surely a person with your depth of experience realises that
>> > all cats have moved to Facebook and YouTube, leaving their HTML in
>> > yesterday's litter box?
>> >
>> > --
>> > Regards =dn
>> > --
>> > https://mail.python.org/mailman/listinfo/python-list
>>
>> pardon my drive by comment, but this is close to trolling.  Whatever
>> is offered is shot down.  XHTML seems to have been a road that went
>> nowhere because the browser makers didn't like it.  HTML5 seemed to be
>> a big step forward.  I used a program called Citydesk a long time ago
>> that I think could do what the op might like.  But its long gone.  I
>> think django could be used to make static pages quite easily. Its not
>> hard to learn, and in the event your client wants more, django can do
>> that too
>>
>> --
>> Joel Goldstick
>> http://joelgoldstick.com/blog
>> http://cc-baseballstats.info/stats/birthdays
>> --
>> https://mail.python.org/mailman/listinfo/python-list



-- 
Joel Goldstick
http://joelgoldstick.com/blog
http://cc-baseballstats.info/stats/birthdays
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue37834] readlink on Windows cannot read app exec links

2019-08-13 Thread Eryk Sun


Eryk Sun  added the comment:

> Replacing "\??\" with "\\?\" in place is trivial though, as we start 
> with a mutable buffer. I'm just not clear that it's as simple as that, 
> though.

If the path starts with "\\??\\" we can just change the first question mark to 
a backslash. For a symlink, fail at this step if Flags includes 
SYMLINK_FLAG_RELATIVE, which would be inconsistent data. 

"\\??\\" is the NT prefix for the caller's local (logon session) device 
directory. This implicitly shadows the global device directory, "\\Global??". 
We don't use NT's real "\\Device" directory in Windows, but it's available as 
"//?/GlobalRoot/Device" or "//?/Global/GlobalRoot/Device". 

"\\??\\" shouldn't be used directly in Windows programming, since 
GetFullPathNameW (often implicitly called) doesn't recognize it, but some API 
functions will pass it along, even though they should really fail the call. It 
will work until it doesn't, and by then we could have a right mess.

If a path starts with exactly "?\\" (backslash only), Windows simply copies 
it verbatim, except for changing the prefix to "\\??\\". Other Windows device 
prefixes where the domain is "." or "?" can use any mix of forward slash and 
backslash because they get normalized first (e.g. "//?\\" -> "?\\"). Only 
an initial "?\\" bypasses the normalization step.

--

___
Python tracker 

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



[issue32771] merge the underlying data stores of unicodedata and the str type

2019-08-13 Thread Greg Price


Greg Price  added the comment:

Speaking of improving functionality:

> Having unicodedata readily accessible to the str type would also permit 
> higher a fidelity unicode implementation. For example, implementing 
> language-tailored str.lower() requires having canonical combining class of a 
> character available. This data lives only in unicodedata currently.

Benjamin, can you say more about the behavior you have in mind here? I don't 
entirely follow. (Is or should there be an issue for it?)

--
versions: +Python 3.9 -Python 3.8

___
Python tracker 

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



[issue25172] Unix-only crypt should not be present on Windows.

2019-08-13 Thread Srinivas Nyayapati


Srinivas Nyayapati  added the comment:

Thank you @paul.moore

--

___
Python tracker 

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



[issue32771] merge the underlying data stores of unicodedata and the str type

2019-08-13 Thread Greg Price

Greg Price  added the comment:

> Loading it dynamically reduces the memory footprint.

Ah, this is a good question to ask!

First, FWIW on my Debian buster desktop I get a smaller figure for `import 
unicodedata`: only 64 kiB.

$ python
Python 3.7.3 (default, Apr  3 2019, 05:39:12) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.system(f"grep ^VmRSS /proc/{os.getpid()}/status")
VmRSS:  9888 kB

>>> import unicodedata
>>> os.system(f"grep ^VmRSS /proc/{os.getpid()}/status")
VmRSS:  9952 kB

But whether 64 kiB or 160 kiB, it's much smaller than the 1.1 MiB of the whole 
module.  Which makes sense -- there's no need to bring the whole thing in 
memory when we only import it, or generally to bring into memory the parts we 
aren't using.  I wouldn't expect that to change materially if the tables and 
algorithms were built in.

Here's another experiment: suppose we load everything that ast.c needs in order 
to handle non-ASCII identifiers.

$ python
Python 3.7.3 (default, Apr  3 2019, 05:39:12) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.system(f"grep ^VmRSS /proc/{os.getpid()}/status")
VmRSS:  9800 kB

>>> là = 3
>>> os.system(f"grep ^VmRSS /proc/{os.getpid()}/status")
VmRSS:  9864 kB

So that also comes to 64 kiB.

We wouldn't want to add 64 kiB to our memory use for no reason; but I think 64 
or 160 kiB is well within the range that's an acceptable cost if it gets us a 
significant simplification or improvement to core functionality, like Unicode.

--

___
Python tracker 

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



Re: Web framework for static pages

2019-08-13 Thread Morten W. Petersen
Hi Joel.

I don't disagree with what you're saying, but is there a documented way of
making Django produce a neat set of static pages?

It would be nice to use a web application framework to create pages,
because it would after that be easy to add a little bit of logic if a
customer wants it. A contact form, an order form, etc.

Zope/Plone has its own set of features and applications I know well, if a
customer wants a dynamic website with a lot of logic (dynamic pages).

-Morten

Blogging at http://blogologue.com
Tweeting at https://twitter.com/blogologue
On Instagram https://instagram.com/morphexx

tir. 13. aug. 2019, 21.08 skrev Joel Goldstick :

> On Tue, Aug 13, 2019 at 2:46 PM DL Neil 
> wrote:
> >
> > On 14/08/19 2:26 AM, Grant Edwards wrote:
> > > On 2019-08-13, Jon Ribbens via Python-list 
> wrote:
> > >
> > >> If it's really that small then it sounds like what you are looking for
> > >> is known as a "text editor".
> > >
> > > Bah.  Kids these days.
> > >
> > >$ cat > index.hmtl
> >
> > [roaring with laughter]
> >
> >
> >
> > Oh come now. Surely a person with your depth of experience realises that
> > all cats have moved to Facebook and YouTube, leaving their HTML in
> > yesterday's litter box?
> >
> > --
> > Regards =dn
> > --
> > https://mail.python.org/mailman/listinfo/python-list
>
> pardon my drive by comment, but this is close to trolling.  Whatever
> is offered is shot down.  XHTML seems to have been a road that went
> nowhere because the browser makers didn't like it.  HTML5 seemed to be
> a big step forward.  I used a program called Citydesk a long time ago
> that I think could do what the op might like.  But its long gone.  I
> think django could be used to make static pages quite easily. Its not
> hard to learn, and in the event your client wants more, django can do
> that too
>
> --
> Joel Goldstick
> http://joelgoldstick.com/blog
> http://cc-baseballstats.info/stats/birthdays
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue37760] Refactor makeunicodedata.py: dedupe parsing, use dataclass

2019-08-13 Thread Greg Price


Greg Price  added the comment:

> This is good. But the title mentioned dataclasses, and they are 3.7+.

Ahh, sorry, I think now I understand you. :-)

Indeed, when I switch to the branch with that change 
(https://github.com/gnprice/cpython/commit/2b4aec4dd -- it comes after the 
patch that's GH-15248, so I haven't yet sent it as a PR), then `python3.6 
Tools/unicode/makeunicodedata.py` no longer works.

I think this is fine. Most of all that's because this always works:

./python Tools/unicode/makeunicodedata.py

Anyone who's going to be running that script will want to build a `./python` 
right afterward, in order to at least run the tests. So it doesn't seem like 
much trouble to do the build first and then run the script (and then a quick 
rebuild for the handful of changed files), if indeed the person doesn't already 
have a `./python` lying around.

In fact `./python` is exactly what I used most of the time to run this script 
when I was developing these changes, simply because it seemed like the natural 
thing to do.

--

___
Python tracker 

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



[issue37689] Add Path.is_relative_to()

2019-08-13 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
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



[issue37689] Add Path.is_relative_to()

2019-08-13 Thread Antoine Pitrou


Antoine Pitrou  added the comment:


New changeset 82642a052dc46b2180679518bc8d87e1a28a88b5 by Antoine Pitrou (Hai 
Shi) in branch 'master':
bpo-37689: add Path.is_relative_to() method (GH-14982)
https://github.com/python/cpython/commit/82642a052dc46b2180679518bc8d87e1a28a88b5


--

___
Python tracker 

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



[issue37834] readlink on Windows cannot read app exec links

2019-08-13 Thread Eryk Sun


Eryk Sun  added the comment:

> I feel like that's more work than is worth us doing for something that 
> will be relatively rarely used, will live in the stdlib, and is 
> obviously something that will become outdated as Microsoft adds new 
> reparse points.

Junctions (NT 5) and symlinks (NT 6) are stable. So if os.read_reparse_point 
only returns the unparsed bytes, maybe add os.read_junction as well. I know 
other projects overload this on POSIX readlink. They're both name-surrogate 
reparse points, but they have different constraints and behavior.

The I/O manager tries to make a junction behave something like a hard link to a 
directory, with the addition of being able to link across local volumes. This 
is in turn relates to how it evaluates relative symbolic links. For example, if 
"C:/Junction" and "C:/Symlink" both target r"\\?\C:\Temp1\Temp2", and there's a 
relative symlink "C:/Temp1/Temp2/foo_link" that targets r"..\foo", then 
"C:/Junction/foo_link" references "C:/foo" but "C:/Symlink/foo_link" references 
"C:/Temp1/foo".
 
Another difference is with remote filesystems. SMB special cases symlinks to 
have the server send the reparse request over the wire to be evaluated on the 
client side. (Refer to [MS-SMB2] 2.2.2.1 Symbolic Link Error Response, and the 
subsequent section about client-side handling of this error.) So an absolute 
symlink on the server that targets r"\\?\C:\Windows" actually references the 
client's "C:/Windows" directory, whereas the same junction target would 
reference the server's "C:/Windows" directory. The symlink evaluation will 
succeed only if the client's R2L (remote to local) policy allows it. Symlinks 
can also target remote devices, depending on the L2R and R2R policy settings. 
Junctions are restricted to local devices.

> In theory, we can't follow any reparse point that isn't documented as 
> being followable and provides the target name is a stable, documented
> manner. 

To follow a reparse point, we're just calling CreateFileW the normal way, 
without FILE_FLAG_OPEN_REPARSE_POINT. The Windows API also does this (usually 
via NtOpenFile, but this has a similar  FILE_OPEN_REPARSE_POINT option) for 
tags it doesn't handle. That's why MoveFileExW (os.rename and os.replace) fails 
on one of these app-exec links. In some cases, it adds a third open attempt if 
the reparse point isn't handled. This is important for DeleteFileW (os.remove) 
and RemoveDirectoryW (os.rmdir) because we should be able to delete a bad 
reparse point.

> The appexec links don't do this (I just looked at the returned 
> buffer), so we really should just not follow them. They exist solely 
> so that CreateProcess internally returns a unique error code that can 
> be handled without impacting regular process start, which means we 
> *don't* want to follow them.

I know, so a regular stat() will fail. I think for an honest result, stat() 
should fail for a reparse point that can't be handled. Scripts can use 
stat(path, follow_nonlinks=False) or stat(path, follow_reparse_points=False), 
or however this eventually gets parameterized to force opening all reparse 
points.

> Now, directory junctions are far more interesting. My gut feel is that 
> we should treat them the same as symlinks (with respect to stat vs. 
> lstat) for consistency

Junctions are their own thing. They're mount points that behave like Unix 
volume mounts (in Windows, target the root directory of a volume device named 
by its "Volume{...}" name) or Unix bind mounts (in Windows, target arbitrary 
directories on any local volume; in Linux it's a mount created with --bind or 
FUSE bindfs). Bind-like junctions are also similar to DOS subst drives (e.g. 
"W:" -> "C:/Windows") and UNC shares. These are all mount points of one sort or 
another. 

OTOH, the base device names such as "//?/C:" and "//?/Volume{...}", without a 
specified root directory, are aliases (object symlinks) for an NT device such 
as r"\Device\HarddiskVolume2". These paths open the volume itself, not the 
mounted filesystem, so they're not like Unix mount points. They're like Unix 
'/dev/sda1' device paths, except in Unix, devices don't have their own 
namespaces, so it would be nonsense to open "/dev/sda1/".

RemoveDirectoryW for a volume mount is special cased to call 
DeleteVolumeMountPointW, which notifies the mount-point manager. It won't do 
this for a junction that targets the same volume root directory via the DOS 
drive-letter name -- or any other device alias for that matter (e.g. Windows 10 
creates "\\?\BootPartition" as an alternative named for the system "C:" drive). 
So bind-like mounts are different from volume mounts, but both are different 
from symlinks.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 

[issue37814] typing module: empty tuple syntax is undocumented

2019-08-13 Thread miss-islington


miss-islington  added the comment:


New changeset 37fd9f73e2fa439554977cfba427bf94c1fedb6b by Miss Islington (bot) 
(Josh Holland) in branch '3.7':
[3.7] bpo-37814: Document the empty tuple type annotation syntax (GH-15208) 
(GH-15262)
https://github.com/python/cpython/commit/37fd9f73e2fa439554977cfba427bf94c1fedb6b


--

___
Python tracker 

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



[issue29535] datetime hash is deterministic in some cases

2019-08-13 Thread Ashwin Ramaswami


Change by Ashwin Ramaswami :


--
nosy: +epicfaace
versions: +Python 3.8, Python 3.9

___
Python tracker 

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



[issue37814] typing module: empty tuple syntax is undocumented

2019-08-13 Thread Josh Holland


Change by Josh Holland :


--
pull_requests: +14981
pull_request: https://github.com/python/cpython/pull/15262

___
Python tracker 

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



[issue37814] typing module: empty tuple syntax is undocumented

2019-08-13 Thread Guido van Rossum


Guido van Rossum  added the comment:

Thanks Josh! The automated backport to 3.7 didn't work, that's okay, so I'll 
close this now. (Though if you want to experiment with the cherry-picker tool 
go ahead.)

--
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



[issue35669] tar symlink

2019-08-13 Thread Ashwin Ramaswami


Ashwin Ramaswami  added the comment:

I believe the SafeTarFile class proposed in issue21109 fixes this.

--
nosy: +epicfaace

___
Python tracker 

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



[issue37814] typing module: empty tuple syntax is undocumented

2019-08-13 Thread miss-islington


miss-islington  added the comment:


New changeset 6ad902a08814909b4d52c4000d5a10ce58516dac by Miss Islington (bot) 
in branch '3.8':
bpo-37814: Document the empty tuple type annotation syntax (GH-15208)
https://github.com/python/cpython/commit/6ad902a08814909b4d52c4000d5a10ce58516dac


--

___
Python tracker 

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



Re: MySQLdb for 3.6 on RHEL7

2019-08-13 Thread Larry Martell
On Tue, Aug 13, 2019 at 2:16 PM Chris Angelico  wrote:
>
> On Wed, Aug 14, 2019 at 1:48 AM Larry Martell  wrote:
> >
> > On Tue, Aug 13, 2019 at 9:59 AM Chris Angelico  wrote:
> > >
> > > On Tue, Aug 13, 2019 at 11:33 PM Larry Martell  
> > > wrote:
> > > >
> > > > I am trying to install MySQLdb (https://pypi.org/project/mysqlclient/)
> > > > for python3.6 on RHEL7.
> > > >
> > > > When I import it, it fails:
> > > >
> > > > # python3.6
> > > > Python 3.6.8 (default, Jun 11 2019, 15:15:01)
> > > > [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
> > > > Type "help", "copyright", "credits" or "license" for more information.
> > > > >>> import MySQLdb
> > > > Traceback (most recent call last):
> > > >   File "", line 1, in 
> > > >   File 
> > > > "/usr/local/lib64/python3.6/site-packages/mysqlclient-1.4.4-py3.6-linux-x86_64.egg/MySQLdb/__init__.py",
> > > > line 18, in 
> > > > from . import _mysql
> > > > ImportError: 
> > > > /usr/local/lib64/python3.6/site-packages/mysqlclient-1.4.4-py3.6-linux-x86_64.egg/MySQLdb/_mysql.cpython-36m-x86_64-linux-gnu.so:
> > > > undefined symbol: mysql_kill
> > > >
> > > > Has anyone seen and resolved this?
> > >
> > > Not specifically, but that looks like a versioning conflict. Most
> > > likely, your mysqlclient is too old for MySQLdb to connect to.
> > >
> > > Did you get one of them from your system package manager and the other
> > > from pip? If so, try to get both from the same place.
> >
> > So I have MySQL from the system package manager, but mysqlclient is
> > not available there.
>
> That seems very odd. The mysqlclient binary might be just under a
> different name? I'm not familiar with RHEL, but on my Debian, there
> are packages like "mysql-server-5.7" and corresponding
> "mysql-client-5.7". Or do you mean the Python client?

Yes, the python client, which is called mysqlclient but imported as
MySQLdb (https://pypi.org/project/mysqlclient/).

> > And I was not able to get that from pip either,
> > as the install failed. I had to download the source, edit the site.cfg
> > file and build it. But I just found python36-mysql.x86_64 as a package
> > so I uninstalled mysqlclient and installed that from the repo.

The reason that would not install from pip was because the path to
mysql_config was not correct in site.cfg - once I changed that I was
able to build it, but then it gave the other error.

> Based on this, I'm thinking possibly you meant the Python client. It
> may still be that you need to install the C client for the Python one
> to connect to. Although if you got python36-mysql from your system
> repo, that ought to drag in the appropriate mysqlclient. So now I'm
> very confused.
>
> > That did not get the above error, but now I get this:
> >
> > raise ImproperlyConfigured('mysqlclient 1.3.13 or newer is
> > required; you have %s.' % Database.__version__)
> > django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or
> > newer is required; you have 1.3.12.
>
> This claims to be a Django error, though, so maybe the issue here
> isn't with MySQLdb but with Django?? Maybe everything up above is
> actually correctly matched, but too old?

I got around that by changing the code in django to not require that version.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue37814] typing module: empty tuple syntax is undocumented

2019-08-13 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14980
pull_request: https://github.com/python/cpython/pull/15261

___
Python tracker 

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



Re: Web framework for static pages

2019-08-13 Thread Joel Goldstick
On Tue, Aug 13, 2019 at 2:46 PM DL Neil  wrote:
>
> On 14/08/19 2:26 AM, Grant Edwards wrote:
> > On 2019-08-13, Jon Ribbens via Python-list  wrote:
> >
> >> If it's really that small then it sounds like what you are looking for
> >> is known as a "text editor".
> >
> > Bah.  Kids these days.
> >
> >$ cat > index.hmtl
>
> [roaring with laughter]
>
>
>
> Oh come now. Surely a person with your depth of experience realises that
> all cats have moved to Facebook and YouTube, leaving their HTML in
> yesterday's litter box?
>
> --
> Regards =dn
> --
> https://mail.python.org/mailman/listinfo/python-list

pardon my drive by comment, but this is close to trolling.  Whatever
is offered is shot down.  XHTML seems to have been a road that went
nowhere because the browser makers didn't like it.  HTML5 seemed to be
a big step forward.  I used a program called Citydesk a long time ago
that I think could do what the op might like.  But its long gone.  I
think django could be used to make static pages quite easily. Its not
hard to learn, and in the event your client wants more, django can do
that too

-- 
Joel Goldstick
http://joelgoldstick.com/blog
http://cc-baseballstats.info/stats/birthdays
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue37814] typing module: empty tuple syntax is undocumented

2019-08-13 Thread miss-islington


miss-islington  added the comment:


New changeset 8a784af750fa82c8355903309e5089eb2b60c16b by Miss Islington (bot) 
(Josh Holland) in branch 'master':
bpo-37814: Document the empty tuple type annotation syntax (GH-15208)
https://github.com/python/cpython/commit/8a784af750fa82c8355903309e5089eb2b60c16b


--
nosy: +miss-islington

___
Python tracker 

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



[issue37830] continue and break in finally with return in try results with segfault

2019-08-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

There may be a solution that does not require a significant change to the code 
generator, but small changes in many places with keeping the general structure. 
But it is a difficult task, so it takes some time. Don't worry, I'm working on 
it.

--

___
Python tracker 

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



Re: Create multiple sqlite tables, many-to-many design

2019-08-13 Thread Chris Angelico
On Wed, Aug 14, 2019 at 4:50 AM Dave via Python-list
 wrote:
> Some of the tables are related.  For example:
>
> Hiking_Table Trails_TableJoining_Table
> --
> hike_id PK   trail_id  PKhike_id   FK
> hike_date  TEXT  trail_name  TEXTtrail_id   FK
> hike_destination TEXTtrail_rating REAL
> hike_rating  REALtrail_comments TEXT
> hike_comments  TEXT
>
> So far, so good.  I know how to create the tables.  What I am struggling
> with is how do I insert data into the joining table or don"t I?  If so,
> do I need to query the other two tables to get the auto-number ID's?
> Some things I have read suggest that the joining table just contains
> references, so there is no actual insert.  A pointer to information how
> to do this would be appreciated.  As for queries, I think I use joins,
> but a pointer on how to do this would also be appreciated.

The joining table is a real thing, and will have real inserts. It
might be easier to think of this as two separate one-to-many
relationships; for the sake of demonstration, I'm going to add another
column to your joining table.

hike_sections ==> hike_id references hikes, trail_id references
trails, companion_name

You've decided to have someone with you for some sections of your
hike. As such, what we have is a number of "mini-hikes" that make up a
single hike (that's a one-to-many relationship between hikes and
sections), and also a single trail can be a section of any number of
hikes (so, another one-to-many relationship between trails and
sections). For any given section, there is exactly one companion.

Does this make the many-to-many relationship a bit easier to
understand? It'll work exactly the same way even if you have no
ancillary information in that joining table.

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


[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-08-13 Thread Bennet Fauber


Bennet Fauber  added the comment:

One additional note on this.  Thanks to a colleague at USC who pointed out that 
this bug does not seem to get exercised if one does not include 
`--enable-shared` at configuration.

I confirmed this using the distributed Python-3.7.4.tgz file and `configure 
--prefix=/path/to/install`.  The `make test` then runs to completion with no 
errors.  Running `make distclean`, then rerunning with `configure 
--prefix=/path/to/install --enable-shared` will then exercise the bug, and the 
faulthandler test fails with a segfault.

Applying the patch file attached to this report and rebuilding leads to `make 
test` passing all tests, also.

If someone was trying to reproduce and did not configure shared libraries, then 
that would have failed to reproduce.

--
nosy: +justbennet

___
Python tracker 

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



[issue37845] SLCertVerificationError: Unable to handle SAN names (from Certifications) published with white spaces at start

2019-08-13 Thread David K.


Change by David K. :


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

___
Python tracker 

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



[issue37760] Refactor makeunicodedata.py: dedupe parsing, use dataclass

2019-08-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

> I just checked and `python3.6 Tools/unicode/makeunicodedata.py` works fine, 
> both at master and with GH-15248.

This is good. But the title mentioned dataclasses, and they are 3.7+.

--

___
Python tracker 

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



[issue37760] Refactor makeunicodedata.py: dedupe parsing, use dataclass

2019-08-13 Thread Greg Price


Greg Price  added the comment:

> What is the minimal Python version for developing CPython? The system Python 
> 3 on current Ubuntu LTS (18.04) is 3.6, so I think it should not be larger.

Ah, I think my previous message had an ambiguous parse: the earliest that 
*uses* of the typing module appeared in the stdlib was 3.7. The typing module 
has been around longer than that.

I just checked and `python3.6 Tools/unicode/makeunicodedata.py` works fine, 
both at master and with GH-15248.

I think it would be OK for doing development on CPython to require the latest 
minor version (i.e. 3.7) -- after all, if you're doing development, you're 
already building it, so you can always get a newer version than your system 
provides if needed.  But happily the question is moot here, so I guess the 
place to discuss that further would be a new thread.

--

___
Python tracker 

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



Create multiple sqlite tables, many-to-many design

2019-08-13 Thread Dave via Python-list

Oops!  Just posted this to the wrong newsgroup.  Sorry!!!


I'm doing a Python app that uses SQLite, and am stumbling on a few 
questions.  I've read a lot of books and documentation, but two 
questions still allude me.  Hope someone that been there done this can 
help.  Below is a note I sent to the SQLite mailing list yesterday.  So 
far, nothing.  Need to get going, so many thanks!


I'm doing an app. that uses sqlite, and has a many-to-many relationship. 
 The areas I need some guidance are:

* Best way to create multiple tables the first time the app. is started.
* How to create a MTM relationship and add/modify data.

I can create tables (Python) by putting the code in discrete functions 
for each table and passing just the path to the database.  I can also 
create a calling function that gets a connection and passes that.  What 
is the pro-con of each since each seems to work?  Better ideas?


Some of the tables are related.  For example:

Hiking_Table Trails_TableJoining_Table
--
hike_id PK   trail_id  PKhike_id   FK
hike_date  TEXT  trail_name  TEXTtrail_id   FK
hike_destination TEXTtrail_rating REAL
hike_rating  REALtrail_comments TEXT
hike_comments  TEXT

So far, so good.  I know how to create the tables.  What I am struggling 
with is how do I insert data into the joining table or don"t I?  If so, 
do I need to query the other two tables to get the auto-number ID's? 
Some things I have read suggest that the joining table just contains 
references, so there is no actual insert.  A pointer to information how 
to do this would be appreciated.  As for queries, I think I use joins, 
but a pointer on how to do this would also be appreciated.


Thanks,
Dave
--
https://mail.python.org/mailman/listinfo/python-list


Re: Web framework for static pages

2019-08-13 Thread DL Neil

On 14/08/19 2:26 AM, Grant Edwards wrote:

On 2019-08-13, Jon Ribbens via Python-list  wrote:


If it's really that small then it sounds like what you are looking for
is known as a "text editor".


Bah.  Kids these days.

   $ cat > index.hmtl


[roaring with laughter]



Oh come now. Surely a person with your depth of experience realises that 
all cats have moved to Facebook and YouTube, leaving their HTML in 
yesterday's litter box?


--
Regards =dn
--
https://mail.python.org/mailman/listinfo/python-list


[issue37834] readlink on Windows cannot read app exec links

2019-08-13 Thread Steve Dower


Steve Dower  added the comment:

Latest PR update uses GetFinalPathName to resolve SubstituteName, returning it 
unmodified on failure (e.g. symlink where the target file no longer exists).

Replacing "\??\" with "\\?\" in place is trivial though, as we start with a 
mutable buffer. I'm just not clear that it's as simple as that, though.

--

___
Python tracker 

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



[issue37845] SLCertVerificationError: Unable to handle SAN names (from Certifications) published with white spaces at start

2019-08-13 Thread David K.


New submission from David K. :

Unable to establish SSL connections using company's private certificates where 
their SANs (Subject Alternative Names) contain at least one DNS Name that 
starts with white spaces.

Attempting to establish SSL connection would result in Exception:
SSLCertVerificationError("partial wildcards in leftmost label are not 
supported: '   *.x.y.com'.")

This situation made us co-depended on SecOps in a big company where ultimately 
all other none-python apps weren't effected by that change they made and thus 
couldn't or wouldn't fix the problem on their side for us. (We were at their 
mercy!)


I originally encountered this bug @ Python 3.7 and fixed it manually on my own 
local Python environment.

As the bug seems to be still unfixed to date, I publish this issue.

A small and simple fix will follow shortly on github.

--
assignee: christian.heimes
components: SSL
messages: 349600
nosy: DK26, christian.heimes
priority: normal
severity: normal
status: open
title: SLCertVerificationError: Unable to handle SAN names (from 
Certifications) published with white spaces at start
type: security
versions: Python 3.9

___
Python tracker 

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



[issue37760] Refactor makeunicodedata.py: dedupe parsing, use dataclass

2019-08-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

What is the minimal Python version for developing CPython? The system Python 3 
on current Ubuntu LTS (18.04) is 3.6, so I think it should not be larger.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue37844] PyRun_SimpleFile should provide a version that does not need a FILE*

2019-08-13 Thread Christian Biesinger


New submission from Christian Biesinger :

Because FILE* requires that the runtime library matches between Python and a 
program using it, it is very hard to use this correctly on Windows. It would be 
nice if Python provided either:

- A function to open a FILE* given a filename, suitable for passing to the 
various PyRun_* functions, or
- Versions of the functions that take a filename and internally open the file

(ref: https://docs.python.org/3.9/c-api/veryhigh.html, which talks about this 
but provides no useful guidance:
"One particular issue which needs to be handled carefully is that the FILE 
structure for different C libraries can be different and incompatible. Under 
Windows (at least), it is possible for dynamically linked extensions to 
actually use different libraries, so care should be taken that FILE* parameters 
are only passed to these functions if it is certain that they were created by 
the same library that the Python runtime is using."
)

--
components: Windows
messages: 349598
nosy: cbiesinger, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: PyRun_SimpleFile should provide a version that does not need a FILE*
type: crash
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



Re: MySQLdb for 3.6 on RHEL7

2019-08-13 Thread Chris Angelico
On Wed, Aug 14, 2019 at 1:48 AM Larry Martell  wrote:
>
> On Tue, Aug 13, 2019 at 9:59 AM Chris Angelico  wrote:
> >
> > On Tue, Aug 13, 2019 at 11:33 PM Larry Martell  
> > wrote:
> > >
> > > I am trying to install MySQLdb (https://pypi.org/project/mysqlclient/)
> > > for python3.6 on RHEL7.
> > >
> > > When I import it, it fails:
> > >
> > > # python3.6
> > > Python 3.6.8 (default, Jun 11 2019, 15:15:01)
> > > [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
> > > Type "help", "copyright", "credits" or "license" for more information.
> > > >>> import MySQLdb
> > > Traceback (most recent call last):
> > >   File "", line 1, in 
> > >   File 
> > > "/usr/local/lib64/python3.6/site-packages/mysqlclient-1.4.4-py3.6-linux-x86_64.egg/MySQLdb/__init__.py",
> > > line 18, in 
> > > from . import _mysql
> > > ImportError: 
> > > /usr/local/lib64/python3.6/site-packages/mysqlclient-1.4.4-py3.6-linux-x86_64.egg/MySQLdb/_mysql.cpython-36m-x86_64-linux-gnu.so:
> > > undefined symbol: mysql_kill
> > >
> > > Has anyone seen and resolved this?
> >
> > Not specifically, but that looks like a versioning conflict. Most
> > likely, your mysqlclient is too old for MySQLdb to connect to.
> >
> > Did you get one of them from your system package manager and the other
> > from pip? If so, try to get both from the same place.
>
> So I have MySQL from the system package manager, but mysqlclient is
> not available there.

That seems very odd. The mysqlclient binary might be just under a
different name? I'm not familiar with RHEL, but on my Debian, there
are packages like "mysql-server-5.7" and corresponding
"mysql-client-5.7". Or do you mean the Python client?

> And I was not able to get that from pip either,
> as the install failed. I had to download the source, edit the site.cfg
> file and build it. But I just found python36-mysql.x86_64 as a package
> so I uninstalled mysqlclient and installed that from the repo.

Based on this, I'm thinking possibly you meant the Python client. It
may still be that you need to install the C client for the Python one
to connect to. Although if you got python36-mysql from your system
repo, that ought to drag in the appropriate mysqlclient. So now I'm
very confused.

> That did not get the above error, but now I get this:
>
> raise ImproperlyConfigured('mysqlclient 1.3.13 or newer is
> required; you have %s.' % Database.__version__)
> django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or
> newer is required; you have 1.3.12.

This claims to be a Django error, though, so maybe the issue here
isn't with MySQLdb but with Django?? Maybe everything up above is
actually correctly matched, but too old?

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


[issue37834] readlink on Windows cannot read app exec links

2019-08-13 Thread Steve Dower


Steve Dower  added the comment:

> If we support reading junctions, this should be using the substitute name 
> (with \??\ replaced by \\?\) instead of the print name.

GetFinalPathName() does this conversion for us, any reason not to use that? 
(GetFullPathName() doesn't seem to recognize the \??\ prefix and will prepend 
the current drive)

--

___
Python tracker 

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



[issue37583] Got a 113 error when running the test_socket

2019-08-13 Thread miss-islington


miss-islington  added the comment:


New changeset ee989512528d178d6f088916aba3e67ea9487ceb by Miss Islington (bot) 
in branch '3.8':
bpo-37583: Add err 113 to support.get_socket_conn_refused_errs() (GH-14729)
https://github.com/python/cpython/commit/ee989512528d178d6f088916aba3e67ea9487ceb


--
nosy: +miss-islington

___
Python tracker 

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



[issue37813] PEP 7 line-breaking with binary operations contradicts Knuth's rule

2019-08-13 Thread Guido van Rossum


Guido van Rossum  added the comment:

PEP 8 intentionally allows users to choose whether to put the operator at the 
start or end of the line (as long as they're consistent within a file or 
project). This is to avoid a barrage of "style fixes" that are just noise.

But PEP 7 is only for CPython's own C code style, and here I don't want things 
to change. When it comes to readability of our code surely there are bigger 
fish to fry.

So I'm closing this as won't fix.

--
resolution:  -> wont fix
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



[issue37838] typing.get_type_hints not working with forward-declaration and decorated functions

2019-08-13 Thread Netzeband


Netzeband  added the comment:

Thanks for your feedback. I can create a pull-request. However, I did it never 
before for the Python-Lib, so I first have to setup the correct environment for 
that and ensure, that I can run all test-cases.

Since I'm on vacation soon, it could take several weeks. If someone wants to 
solve the issue earlier, please don't hesitate. 

I will write it in this issue ticket, as soon as I finished the PR.

--

___
Python tracker 

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



[issue37583] Got a 113 error when running the test_socket

2019-08-13 Thread hai shi


Change by hai shi :


--
pull_requests: +14978
pull_request: https://github.com/python/cpython/pull/15259

___
Python tracker 

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



[issue37841] Python store app launcher has dependency on msvcp140.dll

2019-08-13 Thread miss-islington


miss-islington  added the comment:


New changeset 853eecc7692503fec8240fd9a74d9f88e0392630 by Miss Islington (bot) 
in branch '3.8':
bpo-37841: Remove python_uwp dependency on msvcp140.dll (GH-15253)
https://github.com/python/cpython/commit/853eecc7692503fec8240fd9a74d9f88e0392630


--
nosy: +miss-islington

___
Python tracker 

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



[issue37760] Refactor makeunicodedata.py: dedupe parsing, use dataclass

2019-08-13 Thread Greg Price


Greg Price  added the comment:

> BTW: Since when do we use type annotations in Python's stdlib ?

Hmm, interesting question!

At a quick grep, it's in a handful of places in the stdlib: asyncio, functools, 
importlib. The earliest it appeared was in 3.7.0a4.

It's in more places in the test suite, which I think is a closer parallel to 
this maintainer script in Tools/.

The typing module itself is in the stdlib, so I don't see any obstacle to using 
it more widely. I imagine the main reason it doesn't appear more widely already 
is simply that it's new, and most of the stdlib is quite stable.

--

___
Python tracker 

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



[issue37834] readlink on Windows cannot read app exec links

2019-08-13 Thread Steve Dower


Steve Dower  added the comment:

> I looked into this spawn problem. It's due to Cygwin's spawnve, which calls 
> NtOpenFile to open the file, and then memory-maps it and reads the image 
> header [1].

Great, that's roughly what I suspected. Unfortunately, I've been told that 
looking into Cygwin's (GPL'd) code myself is going to cost me two weeks of dev 
work ("cooling off" period), so someone else will have to help them fix it.

> It could parse out as much as possible and return a struct sequence

TBH, I feel like that's more work than is worth us doing for something that 
will be relatively rarely used, will live in the stdlib, and is obviously 
something that will become outdated as Microsoft adds new reparse points.

If we return the parsed data as opaque bytes then someone can write a simple 
PyPI package to extract the contents. (Presumably the reparse tag will have 
come from stat() already.)

> Maybe have two non-overlapping options, follow_symlinks and follow_nonlinks

I read this suggestion the first time and I think it would send the message 
that we are more capable than we really are :)

In theory, we can't follow any reparse point that isn't documented as being 
followable and provides the target name is a stable, documented manner. The 
appexec links don't do this (I just looked at the returned buffer), so we 
really should just not follow them. They exist solely so that CreateProcess 
internally returns a unique error code that can be handled without impacting 
regular process start, which means we *don't* want to follow them.

Again, if someone writes the PyPI package to parse all known reparse points, 
they can do that.

Now, directory junctions are far more interesting. My gut feel is that we 
should treat them the same as symlinks (with respect to stat vs. lstat) for 
consistency, but I'll gladly defer to you (Eryk) for the edge cases that may 
introduce.

---

My plan for PR 15231 is:
* make os.stat only follow symlinks and junctions
* make os.readlink only read symlinks and junctions
* add st_reparse_tag field to os.stat

--

___
Python tracker 

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



  1   2   3   >