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

2019-11-26 Thread Inada Naoki


Change by Inada Naoki :


--
pull_requests: +16880
pull_request: https://github.com/python/cpython/pull/17400

___
Python tracker 

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



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

2019-11-26 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I cannot creàte a pr now. Please take this issue yourself Inada+san.

--
assignee: serhiy.storchaka -> 

___
Python tracker 

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



[issue38854] Decorator breaks inspect.getsource

2019-11-26 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue38924] pathlib paths .normalize()

2019-11-26 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Can you please add an example of how normalize() should behave? I assume you 
want the same behaviour as os.path.normpath which already accepts a pathlike 
object to be added to pathlib.

--
nosy: +xtreak

___
Python tracker 

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



[issue38715] Regression in compileall ddir parameter when recursing

2019-11-26 Thread Roundup Robot


Change by Roundup Robot :


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

___
Python tracker 

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



[issue38688] Python 3.8 regression: endless loop in shutil.copytree

2019-11-26 Thread Giampaolo Rodola'


Change by Giampaolo Rodola' :


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



[issue38688] Python 3.8 regression: endless loop in shutil.copytree

2019-11-26 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:


New changeset 65c92c5870944b972a879031abd4c20c4f0d7981 by Giampaolo Rodola 
(Bruno P. Kinoshita) in branch '3.8':
[3.8] bpo-38688, shutil.copytree: consume iterator and create list of entries 
to prevent infinite recursion (GH-17397)
https://github.com/python/cpython/commit/65c92c5870944b972a879031abd4c20c4f0d7981


--

___
Python tracker 

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



[issue38908] Troubles with @runtime_checkable protocols

2019-11-26 Thread Guido van Rossum


Guido van Rossum  added the comment:

If the "little helper in abc" solves it, let's do that. The sys._getframe() 
hack has always been a bit smelly -- I assume we can get rid of that then?

--

___
Python tracker 

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



[issue38913] Py_BuildValue("(s#O)", ...) segfaults if entered with exception raised

2019-11-26 Thread danielen


danielen  added the comment:

The problem arises from this code in do_mktuple(), staring at line 394 in 
modsupport.c:

if (**p_format == '#') {
++*p_format;
if (flags & FLAG_SIZE_T)
n = va_arg(*p_va, Py_ssize_t);
else {
if (PyErr_WarnEx(PyExc_DeprecationWarning,
"PY_SSIZE_T_CLEAN will be required for '#' 
formats", 1)) {
return NULL;
}
n = va_arg(*p_va, int);
}
}

If this is entered with an exception raised, PyErr_WarnEx() return NULL, thus 
this function return NULL without consuming the argument relative to the string 
length for the "s#" specifier. This argument is then consumed at the next 
iteration for the "O" specifier, resulting in a segmentation fault when the 
string length is interpreted as an object pointer.

I don't know what is the best solution: either ignoring the return value of 
PyErr_WarnEx or swapping the lines from 

if (PyErr_WarnEx(PyExc_DeprecationWarning,
"PY_SSIZE_T_CLEAN will be required for '#' 
formats", 1)) {
return NULL;
}
n = va_arg(*p_va, int);


to 

n = va_arg(*p_va, int);
if (PyErr_WarnEx(PyExc_DeprecationWarning,
"PY_SSIZE_T_CLEAN will be required for '#' 
formats", 1)) {
return NULL;
}

The handling of the "y#" just below suffers from the same problem.

--

___
Python tracker 

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



[issue38810] SSL connect() raises SSLError "[SSL] EC lib (_ssl.c:728)"

2019-11-26 Thread Benjamin Peterson


Change by Benjamin Peterson :


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

___
Python tracker 

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



[issue38874] asyncio.Queue: putting items out of order when it is full

2019-11-26 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

Yes, five outstanding blocked puts can be bypassed by a put that comes in 
immediately after a get creates space. But this isn't really a problem; there 
are no guarantees on what order puts are executed in, only a guarantee that 
once a put succeeds, it's FIFO ordered with respect to all other puts.

Nothing in the docs even implies the behavior you're expecting, so I'm not 
seeing how even a documentation fix is warranted here. The docs on put clearly 
say:

"Put an item into the queue. If the queue is full, wait until a free slot is 
available before adding the item."

If we forcibly hand off on put even when a slot is available (to allow older 
puts to finish first), then we violate the expectation that waiting is only 
performed when the queue is full (if I test myqueue.full() and it returns 
False, I can reasonably expect that put won't block). This would be especially 
impossible to fix if people write code like `if not myqueue.full(): 
myqueue.put_nowait()`. put_nowait isn't even a coroutine, so it *can't* hand 
off control to the event loop to allow waiting puts to complete, even if it 
wanted to, and it can't fail to put (e.g. by determining the empty slots will 
be filled by outstanding puts in some relatively expensive way), because you 
literally *just* verified the queue wasn't full and had no awaits between the 
test and the put_nowait, so it *must* succeed.

In short: Yes, it's somewhat unpleasant that a queue slot can become free and 
someone else can swoop in and steal it before older waiting puts can finish. 
But any change that "fixed" that would make all code slower (forcing 
unnecessary coroutine switches), and violate existing documentation guarantees.

--

___
Python tracker 

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



[issue33604] HMAC default to MD5 marked as to be removed in 3.6

2019-11-26 Thread Leandro Lima


Leandro Lima  added the comment:

IMV, the adopted solution creates a problem of a mismatch between the signature 
and the function behavior.

I was just hit by this, as I never cared to specify digestmod trusting that 
Python defaults are usually sound choices.

I agree that changing the signature would break more code, but the choice made 
here violates the principle of least astonishment. An error that could be 
caught by a static analysis tool silently entered the code base to be provoked 
only when the function got called.

The choice to break compatibility was already made. Introducing silent bugs is 
something that I think we should avoid.

I've wrote an argument about this in a different message, and I'm not sure if I 
should repeat it here. Here's the link to it:
https://bugs.python.org/msg357551

--
nosy: +Leandro Lima

___
Python tracker 

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



[issue37218] Default hmac.new() digestmod has not been removed from documentation

2019-11-26 Thread Leandro Lima


Leandro Lima  added the comment:

In my view, this function signature changed too silently. Even using static 
type checkers, I could only find about this compatibility breaking change when 
actually running the code.

If I understand well the reason it was done this way, digestmod needed to 
become a mandatory argument, but this couldn't be done without changing the 
order between msg and digestmod in the function's signature.

In my view, the two other ways this could be solved were:
1. hmac.new(key: Union[bytes, bytearray],
digestmod: str,
msg: Union[bytes, bytearray, None] = None)
2. hmac.new(key: Union[bytes, bytearray],
*,
digestmod: str,
msg: Union[bytes, bytearray] = None)

If the signature of the function changed to reflect digestmod becoming 
mandatory, then static code checkers could catch a misuse of the function.

Now, suppose that we're dealing with someone that doesn't use static code 
analysis and a legacy signature used in some code:

hmac.new(b"key", b"msg")

- In option (1), we'd be passing b"msg" as the digestmod argument when the 
original intention was to pass it as the msg argument. But since both have 
disjoint expected types, this mistake would be rejected because passing the 
wrong type would lead to a TypeError
- In option (2) we'd be making clear that from now on, both msg and digestmod 
would only be specifiable as keyword arguments and an inadvertent use of the 
old signature would also lead to a TypeError.

Given that it seems a rather safe signature change (that is: there's no chance 
someone would be able to use the old signature with the new definition) and 
that actually changing the signature would allow for static code analysis tools 
to actually catch the error without needing to run the code, I think that we 
should consider further changing this function and making sure that the change 
doesn't go so easily unnoticed like today.

--
nosy: +Leandro Lima

___
Python tracker 

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



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

2019-11-26 Thread Inada Naoki


Inada Naoki  added the comment:

@Serhiy, would you create a pull request based on your patch?  Or may I?

@James it doesn't make sense at all.  It breaks the file even when only ASCII 
characters are used.

f = SpooledTemporaryFile(mode="w+")
f.write("foobar")
f.seek(3)
f.rollover()
f.write("baz")

--
title: SpooledTemporaryFile doesn't correctly preserve data for text 
(non-binary) SpooledTemporaryFile objects when Unicode characters are written 
-> SpooledTemporaryFile rollover corrupts data silently when Unicode characters 
are written

___
Python tracker 

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



[issue38926] MacOS: 'Install certificates.command' has no effect

2019-11-26 Thread Jeff Berkowitz


New submission from Jeff Berkowitz :

After using the Python-supported installer to install 3.8.0 on my 
employer-owned Mac running High Sierra (10.13.6), the 'Install 
Certificates.command' had no apparently effect on the behavior of Python.

The behavior before executing the script was that a Python program using 
urllib3 was unable to verify that public certificate of github.com. Using curl, 
I could download via the desired URL. But the Python program could not, 
consistently throwing SSL verify errors instead.

I ran the command script several times. I verified that the symlink cert.pem 
was created in /Library/Frameworks/Python.framework/Versions/3.8/etc/openssl 
and that it contained "../../lib/python3.8/site-packages/certifi/cacert.pem" 
and I verified that the latter file had content (4558 lines) and was readable. 
And that it did contain the root cert for Github.

But despite that and despite multiple new shell windows and so on, I could 
never get Python to regard the certs. I eventually worked around this by: 
export SSL_CERT_FILE=/etc/ssl/cert.pem. After this, the Python program using 
urllib3 could verify Github.com's public cert. But as I understand things, this 
env var is actually regarded by the OpenSSL "C" library itself, not Python.(?) 
Which, if true, raises the question of why this was necessary.

Of course, there's quite likely something in my environment that is causing 
this. But it would be nice to know what.

--
components: macOS
messages: 357549
nosy: Jeff Berkowitz, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: MacOS: 'Install certificates.command' has no effect
type: behavior
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



[issue38688] Python 3.8 regression: endless loop in shutil.copytree

2019-11-26 Thread Bruno P. Kinoshita


Change by Bruno P. Kinoshita :


--
pull_requests: +16878
stage: commit review -> patch review
pull_request: https://github.com/python/cpython/pull/17397

___
Python tracker 

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



[issue38810] SSL connect() raises SSLError "[SSL] EC lib (_ssl.c:728)"

2019-11-26 Thread Andy Maier


Andy Maier  added the comment:

Thanks for the help, Christian!

--

___
Python tracker 

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



[issue38810] SSL connect() raises SSLError "[SSL] EC lib (_ssl.c:728)"

2019-11-26 Thread Andy Maier


Andy Maier  added the comment:

Our user was able to fix this issue by upgrading the OpenSSL version used on 
the client side from 1.0.1e-fips to 1.1.1.

It seems to me that Python's SSL support cannot do anything about this issue. 
As far as I'm concerned ths issue can be closed.

--

___
Python tracker 

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



[issue38862] IDLE: Include end newlines in whitespace fix.

2019-11-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


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



[issue38688] Python 3.8 regression: endless loop in shutil.copytree

2019-11-26 Thread Giampaolo Rodola'


Change by Giampaolo Rodola' :


--
stage: patch review -> commit review
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



[issue38862] IDLE: Include end newlines in whitespace fix.

2019-11-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 2fb971940b18bcf5a58b1b242b697d0f1d8ad7ef by Terry Jan Reedy in 
branch '3.7':
[3.7] bpo-38862: IDLE Strip Trailing Whitespace fixes end newlines  (GH-17366) 
(#17379)
https://github.com/python/cpython/commit/2fb971940b18bcf5a58b1b242b697d0f1d8ad7ef


--

___
Python tracker 

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



[issue38862] IDLE: Include end newlines in whitespace fix.

2019-11-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset a9c86f5e1afa2487524b1947153953b583714d62 by Terry Jan Reedy in 
branch '3.8':
[3.8] bpo-38862: IDLE Strip Trailing Whitespace fixes end newlines  (GH-17366)
https://github.com/python/cpython/commit/a9c86f5e1afa2487524b1947153953b583714d62


--

___
Python tracker 

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



[issue38688] Python 3.8 regression: endless loop in shutil.copytree

2019-11-26 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:


New changeset 9bbcbc9f6dfe1368fe7330b117707f828e6a2c18 by Giampaolo Rodola 
(Bruno P. Kinoshita) in branch 'master':
bpo-38688, shutil.copytree: consume iterator and create list of entries to 
prevent infinite recursion (GH-17098)
https://github.com/python/cpython/commit/9bbcbc9f6dfe1368fe7330b117707f828e6a2c18


--

___
Python tracker 

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



[issue38922] code.replace() does not raise audit event

2019-11-26 Thread miss-islington


miss-islington  added the comment:


New changeset 191f94cca6f8cf59535e7459c1113e4a1cdfe201 by Miss Islington (bot) 
in branch '3.8':
bpo-38922: Raise code.__new__ audit event when code object replace() is called 
(GH-17394)
https://github.com/python/cpython/commit/191f94cca6f8cf59535e7459c1113e4a1cdfe201


--
nosy: +miss-islington

___
Python tracker 

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



[issue38922] code.replace() does not raise audit event

2019-11-26 Thread Steve Dower


Change by Steve Dower :


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



[issue38922] code.replace() does not raise audit event

2019-11-26 Thread Steve Dower


Steve Dower  added the comment:


New changeset c7c01ab1e5415b772c68e15f1aba51e520010830 by Steve Dower in branch 
'master':
bpo-38922: Raise code.__new__ audit event when code object replace() is called 
(GH-17394)
https://github.com/python/cpython/commit/c7c01ab1e5415b772c68e15f1aba51e520010830


--

___
Python tracker 

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



[issue38922] code.replace() does not raise audit event

2019-11-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16877
pull_request: https://github.com/python/cpython/pull/17396

___
Python tracker 

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



[issue38923] Spurious OSError "Not enough memory resources" when allocating memory using multiprocessing.RawArray

2019-11-26 Thread Brian Kardon


Brian Kardon  added the comment:

Ah, thank you so much! That makes sense. I'll have to switch to 64-bit python. 

I've marked this as closed - hope that's the right thing to do here.

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

___
Python tracker 

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



[issue18233] SSLSocket.getpeercertchain()

2019-11-26 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

There's another important use case for this, that hasn't been discussed here. 
If you want to use openssl for TLS + the system trust store to verify 
certificates, then you need to disable openssl's certificate validation, 
perform the handshake, and then extract the certificate chain that there peer 
sent and pass it to the system native APIs to validate.

For this case, we don't need to do any validation or resolution on the chain – 
we just want to pull out the DER that the peer sent. AFAICT, the lack of this 
functionality is the one major blocker to using the system trust store with the 
'ssl' module.

--
nosy: +njs

___
Python tracker 

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



[issue38925] Decoding unicode not supported after upd to 2.7.17 [possible pymysql related?]

2019-11-26 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Hi Sebastian,

It will help if you do some minimal debugging before reporting what you think 
is a bug. Also, you should report what version you are upgrading from, not just 
the version you have upgraded to.

It may help you to provide better bug reports if you read this: 
http://sscce.org/

"Dcoding unicode" does not make sense and never did, and hasn't been supported 
since since at least version 2.4:

py> unicode(u'a', 'uft-8')
Traceback (most recent call last):
  File "", line 1, in ?
TypeError: decoding Unicode is not supported

One *encodes* Unicode to bytes, and *decodes* bytes to Unicode.

What I believe is happening is that somewhere, somehow, your ``stringList`` 
variable has a Unicode string object in it, rather than all byte-strings. 
Calling `', '.join(stringList)` returns a Unicode string if any item in the 
list is Unicode.

I'm closing this as "Not a bug" as it is not a bug in the language.

--
nosy: +steven.daprano
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue38916] Remove array.fromstring

2019-11-26 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thoughts:
* The tostring() method should be handled in the same way.
* Remediation is easy because from_bytes() is a alias
* Still, all removals cause disruption from at least some users
* The only real benefit of removing it is a sense of tidiness;
  otherwise, there's no harm to keeping it (it's not broken).
* The other deprecation in the array module says, "Deprecated since
  version 3.3, will be removed in version 4.0".  Perhaps this
  one should have had the same qualifier.

--
nosy: +rhettinger

___
Python tracker 

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



[issue38914] Clarify wording for warning message when checking a package

2019-11-26 Thread Jürgen Gmach

Jürgen Gmach  added the comment:

Thank you, both of you!

I especially appreciate the further information about how setuptools and 
distutils play together.

--

___
Python tracker 

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



[issue38925] Decoding unicode not supported after upd to 2.7.17 [possible pymysql related?]

2019-11-26 Thread Sebastian Szwarc


New submission from Sebastian Szwarc :

As follow up to my recent bug error regarding segmentation fault.
Installed 2.7.17 on Mojave.
Because MySQLdb for reason unknown (SSL required error) is impossible to 
install by PIP I used PyMysql and modified line as `import pymysql as MySQLdb`

There is no segmentation fault for now (what indicates there can be bug in 
older python interpreter) but:
the following line worked fine for 2+ years:

colVals = unicode(", ".join(stringList), 'utf-8')

however now I got the error:
2019-11-26 23:25:55,273 [INFO]: Beginning incremental ingest of epf_video_price 
(200589 records)
Traceback (most recent call last):
  File "EPFImporter2.py", line 453, in 
main()
  File "EPFImporter2.py", line 436, in main
fieldDelim=fieldSep)
  File "EPFImporter2.py", line 221, in doImport
ing.ingest(skipKeyViolators=skipKeyViolators)
  File "/Users/sebastian/Documents/test2/EPFIngester.py", line 111, in ingest
self.ingestIncremental(skipKeyViolators=skipKeyViolators)
  File "/Users/sebastian/Documents/test2/EPFIngester.py", line 206, in 
ingestIncremental
skipKeyViolators=skipKeyViolators)
  File "/Users/sebastian/Documents/test2/EPFIngester.py", line 375, in 
_populateTable
colVals = unicode(", ".join(stringList), 'utf-8')
TypeError: decoding Unicode is not supported

So the questions:
1. why decoding Unicode is not supported if previously was and worked fine?
2. is it python thing or some pymysql enforcing rules ?


For reference I attached populateTable function

--
components: macOS
files: populateTable.txt
messages: 357537
nosy: Sebastian Szwarc, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: Decoding unicode not supported after upd to 2.7.17 [possible pymysql 
related?]
type: behavior
versions: Python 2.7
Added file: https://bugs.python.org/file48745/populateTable.txt

___
Python tracker 

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



[issue38045] enum.Flag instance creation is slow

2019-11-26 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 0b41a922f95f62b620d5a197b9f2ed8e4bb70730 by Ethan Furman 
(HongWeipeng) in branch 'master':
bpo-38045: Improve the performance of _decompose() in enum.py (GH-16483)
https://github.com/python/cpython/commit/0b41a922f95f62b620d5a197b9f2ed8e4bb70730


--

___
Python tracker 

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



[issue38924] pathlib paths .normalize()

2019-11-26 Thread Ionuț Ciocîrlan

New submission from Ionuț Ciocîrlan :

pathlib paths should expose a `.normalize()` method. This is highly useful, 
especially in web-related scenarios.

On `PurePath` its usefulness is obvious, but it's debatable for `Path`, as it 
would yield different results from `.resolve()` in case of symlinks (which 
resolves them before normalizing).

--
components: Library (Lib)
messages: 357534
nosy: iciocirlan
priority: normal
severity: normal
status: open
title: pathlib paths .normalize()
type: enhancement
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



[issue38923] Spurious OSError "Not enough memory resources" when allocating memory using multiprocessing.RawArray

2019-11-26 Thread Christian Heimes


Christian Heimes  added the comment:

Good catch, Zach! A 32bit version of Python would certainly explain your 
problem. A 32bit process can only address 4 GB of address space. Almost half of 
the address space is reserved for OS, stack, Python itself, and other things. 
That leaves a little more than 2 GB of free heap memory for user data. Due to 
memory fragmentation it is possible that the allocator can't find a continuous 
free block 1 GB.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue38923] Spurious OSError "Not enough memory resources" when allocating memory using multiprocessing.RawArray

2019-11-26 Thread Zachary Ware


Zachary Ware  added the comment:

You appear to be using a 32-bit version of Python on Windows; do you get the 
same behavior using the 64-bit version?

--
components:  -ctypes

___
Python tracker 

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



[issue38923] Spurious OSError "Not enough memory resources" when allocating memory using multiprocessing.RawArray

2019-11-26 Thread Brian Kardon


New submission from Brian Kardon :

When I try to create a series of multiprocessing.RawArray objects, I get an 
"OSError: Not enough memory resources are available to process this command". 
However, by my calculations, the total amount of memory I'm trying to allocate 
is just about 1 GB, and my system reports that it has around 20 GB free memory. 
I can't find any information about any artificial memory limit, and my system 
seems to have plenty of memory for this, so it seems like a bug to me. This is 
my first issue report, so I apologize if I'm doing this wrong.

The attached script produces the following output on my Windows 10 64-bit 
machine with Python 3.7:

Creating buffer # 0
Creating buffer # 1
Creating buffer # 2
Creating buffer # 3
Creating buffer # 4
...etc...
Creating buffer # 276
Creating buffer # 277
Creating buffer # 278
Creating buffer # 279
Creating buffer # 280
Traceback (most recent call last):
  File ".\Cruft\memoryErrorTest.py", line 10, in 
buffers.append(mp.RawArray(imageDataType, imageDataSize))
  File "C:\Users\Brian 
Kardon\AppData\Local\Programs\Python\Python37-32\lib\multiprocessing\context.py",
 line 129, in RawArray
return RawArray(typecode_or_type, size_or_initializer)
  File "C:\Users\Brian 
Kardon\AppData\Local\Programs\Python\Python37-32\lib\multiprocessing\sharedctypes.py",
 line 61, in RawArray
obj = _new_value(type_)
  File "C:\Users\Brian 
Kardon\AppData\Local\Programs\Python\Python37-32\lib\multiprocessing\sharedctypes.py",
 line 41, in _new_value
wrapper = heap.BufferWrapper(size)
  File "C:\Users\Brian 
Kardon\AppData\Local\Programs\Python\Python37-32\lib\multiprocessing\heap.py", 
line 263, in __init__
block = BufferWrapper._heap.malloc(size)
  File "C:\Users\Brian 
Kardon\AppData\Local\Programs\Python\Python37-32\lib\multiprocessing\heap.py", 
line 242, in malloc
(arena, start, stop) = self._malloc(size)
  File "C:\Users\Brian 
Kardon\AppData\Local\Programs\Python\Python37-32\lib\multiprocessing\heap.py", 
line 134, in _malloc
arena = Arena(length)
  File "C:\Users\Brian 
Kardon\AppData\Local\Programs\Python\Python37-32\lib\multiprocessing\heap.py", 
line 38, in __init__
buf = mmap.mmap(-1, size, tagname=name)
OSError: [WinError 8] Not enough memory resources are available to process this 
command

--
components: Library (Lib), Windows, ctypes
files: memoryErrorTest.py
messages: 357531
nosy: bkardon, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Spurious OSError "Not enough memory resources" when allocating memory 
using multiprocessing.RawArray
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48744/memoryErrorTest.py

___
Python tracker 

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



[issue38922] code.replace() does not raise audit event

2019-11-26 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



[issue38920] Audit events for unhandled exceptions

2019-11-26 Thread Steve Dower


Steve Dower  added the comment:

+Victor in case you'd like to check my changes to the unraisable hook 
implementation.

--
nosy: +vstinner

___
Python tracker 

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



[issue38922] code.replace() does not raise audit event

2019-11-26 Thread Steve Dower


New submission from Steve Dower :

Because code.replace() manually creates a new code object (that is, with 
arbitrary co_code rather than via the compiler), it should raise code.__new__ 
with its arguments.

--
assignee: steve.dower
messages: 357529
nosy: steve.dower
priority: normal
severity: normal
status: open
title: code.replace() does not raise audit event
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



[issue21063] Touch up one-line descriptions of modules for module index

2019-11-26 Thread Brett Cannon


Brett Cannon  added the comment:


New changeset 2f2489310d89f589a091aa09ac1eb973d9a383d8 by Brett Cannon (Miss 
Islington (bot)) in branch '3.7':
bpo-21063: Improve module synopsis for distutils (GH-17363) (#17381)
https://github.com/python/cpython/commit/2f2489310d89f589a091aa09ac1eb973d9a383d8


--

___
Python tracker 

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



[issue38916] Remove array.fromstring

2019-11-26 Thread Brett Cannon


Brett Cannon  added the comment:

Although I will admit we have not had a discussion on python-dev about removing 
stuff that was left for Python 2.7 compatibility, so that discussion should 
probably occur first before we go ripping stuff out.

--

___
Python tracker 

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



[issue38921] Max Recursion Depth Reached in Logging Library

2019-11-26 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Can you please attach a simple script to reproduce the issue?

--
nosy: +vinay.sajip, xtreak

___
Python tracker 

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



[issue38021] pep425 tag for AIX is inadequate

2019-11-26 Thread Paul Moore


Paul Moore  added the comment:

> replacement platform_tag, not compatibility tag.

Ah, I see, sorry. In that case, this should be fine, it's purely a CPython 
question. There's obviously a follow-on discussion about how that platform tag 
is *incorporated* into the compatibility tags, but as you say, that's a 
separate point.

--

___
Python tracker 

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



[issue38916] Remove array.fromstring

2019-11-26 Thread Brett Cannon


Brett Cannon  added the comment:

If it was documented as deprecated and raising a deprecation warning then 3.2 
is definitely far enough back to warrant removing it.

--

___
Python tracker 

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



[issue38920] Audit events for unhandled exceptions

2019-11-26 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +16875
pull_request: https://github.com/python/cpython/pull/17393

___
Python tracker 

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



[issue38921] Max Recursion Depth Reached in Logging Library

2019-11-26 Thread Joy


New submission from Joy :

Seeing an issue with the logger fmt not setting correctly in the Handler class. 
Our code calls format many times which works for a while and then we receive 
the following errors:

[3206] 2019/11/26 12:42:31.011> [ERROR]   File 
"/usr/lib/python3.7/logging/__init__.py", line 1725, in info
[3206] 2019/11/26 12:42:31.013> [ERROR] self.log(INFO, msg, *args, **kwargs)
[3206] 2019/11/26 12:42:31.014> [ERROR]   File 
"/usr/lib/python3.7/logging/__init__.py", line 1763, in log
[3206] 2019/11/26 12:42:31.016> [ERROR] self.logger.log(level, msg, *args, 
**kwargs)
[3206] 2019/11/26 12:42:31.017> [ERROR]   File 
"/usr/lib/python3.7/logging/__init__.py", line 1444, in log
[3206] 2019/11/26 12:42:31.018> [ERROR] self._log(level, msg, args, **kwargs)
[3206] 2019/11/26 12:42:31.019> [ERROR]   File 
"/usr/lib/python3.7/logging/__init__.py", line 1514, in _log
[3206] 2019/11/26 12:42:31.021> [ERROR] self.handle(record)
[3206] 2019/11/26 12:42:31.022> [ERROR]   File 
"/usr/lib/python3.7/logging/__init__.py", line 1524, in handle
[3206] 2019/11/26 12:42:31.024> [ERROR] self.callHandlers(record)
[3206] 2019/11/26 12:42:31.025> [ERROR]   File 
"/usr/lib/python3.7/logging/__init__.py", line 1586, in callHandlers
[3206] 2019/11/26 12:42:31.026> [ERROR] hdlr.handle(record)
[3206] 2019/11/26 12:42:31.027> [ERROR]   File 
"/usr/lib/python3.7/logging/__init__.py", line 894, in handle
[3206] 2019/11/26 12:42:31.029> [ERROR] self.emit(record)
[3206] 2019/11/26 12:42:31.029> [ERROR]   File 
"/usr/lib/python3.7/logging/__init__.py", line 1127, in emit
[3206] 2019/11/26 12:42:31.031> [ERROR] StreamHandler.emit(self, record)
[3206] 2019/11/26 12:42:31.032> [ERROR]   File 
"/usr/lib/python3.7/logging/__init__.py", line 1025, in emit
[3206] 2019/11/26 12:42:31.033> [ERROR] msg = self.format(record)
[3206] 2019/11/26 12:42:31.035> [ERROR]   File 
"/usr/lib/python3.7/logging/__init__.py", line 869, in format
[3206] 2019/11/26 12:42:31.036> [ERROR] return fmt.format(record)
[3206] 2019/11/26 12:42:31.037> [ERROR]   File 
"/usr/lib/python3.7/logging/__init__.py", line 869, in format
[3206] 2019/11/26 12:42:31.039> [ERROR] return fmt.format(record)
[3206] 2019/11/26 12:42:31.040> [ERROR]   File 
"/usr/lib/python3.7/logging/__init__.py", line 869, in format
[3206] 2019/11/26 12:42:31.041> [ERROR] return fmt.format(record)
[3206] 2019/11/26 12:42:31.042> [ERROR]   [Previous line repeated 978 more 
times]
[3206] 2019/11/26 12:42:31.043> [ERROR]   File 
"/usr/lib/python3.7/logging/__init__.py", line 608, in format
[3206] 2019/11/26 12:42:31.045> [ERROR] record.message = record.getMessage()
[3206] 2019/11/26 12:42:31.046> [ERROR]   File 
"/usr/lib/python3.7/logging/__init__.py", line 367, in getMessage
[3206] 2019/11/26 12:42:31.048> [ERROR] msg = str(self.msg)
[3206] 2019/11/26 12:42:31.049> [ERROR] RecursionError
[3206] 2019/11/26 12:42:31.049> [ERROR] :
[3206] 2019/11/26 12:42:31.050> [ERROR] maximum recursion depth exceeded while 
calling a Python object


I believe after a while the fmt object is not being set correctly and ends up 
calling the Handler's format function again and again.

--
components: Library (Lib)
messages: 357523
nosy: joy
priority: normal
severity: normal
status: open
title: Max Recursion Depth Reached in Logging Library
type: crash
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



[issue27501] Add typing.py class describing a PEP 3118 buffer object

2019-11-26 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

Cross-ref to the typing issue https://github.com/python/typing/issues/593. It 
looks like there is some interest in this feature.

--

___
Python tracker 

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



[issue26730] SpooledTemporaryFile doesn't correctly preserve data for text (non-binary) SpooledTemporaryFile objects when Unicode characters are written

2019-11-26 Thread James Hennessy


James Hennessy  added the comment:

The quickest fix for the data corruption problem is to delete the line
newfile.seek(file.tell(), 0)
from the rollover() method.

This doesn't fix the inconsistency of tell() and seek(), but it's very low 
risk.  It's technically a change to the API, that rollover() no longer 
preserves the seek position, but unless the user was writing only characters 
from the ISO-8859-1 character set, it wasn't working properly before anyway.

--

___
Python tracker 

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



[issue38021] pep425 tag for AIX is inadequate

2019-11-26 Thread Michael Felt


Michael Felt  added the comment:

On 22/11/2019 10:42, Paul Moore wrote:
> Paul Moore  added the comment:
>
> PyPA member here - if this PR is defining new compatibility tags,
replacement platform_tag, not compatibility tag.
>  I would have expected it to need discussion as a revision to PEP 425, much 
> like the manylinux efforts did. (It may actually be a closer parallel with 
> MacOS, which didn't have a tagging PEP - I'm not sure how that would relate 
> here, but as MacOS is a much more mainstream platform I'd be inclined to err 
> on the side of caution and look for AIX to be explicitly covered in the tag 
> specs).

As I understand the 'manylinux*' compatibility tags - which are used as
a replacement for platform tags - these compatibility tags are added on
by the packager who works in a carefully configured environment in order
to support binary compatibility over multiple Linux distributions and
releases.

Before AIX 6.1 binary compatibility in AIX was not guaranteed upfront.
Starting with AIX 6.1 IBM has a policy of guaranteeing binary
compatibility for applications.

>From https://www.recarta.co.uk/our-partners/software-partners/ibm-aix/

This page, from IBM, speaks of binary compatibility even going back to
AIX 3.2 -
https://www.ibm.com/support/knowledgecenter/en/ssw_aix_72/install/binary_compatability.html

So, again - the PR is to provide an adequate platform tag. As is, an
adequate tag works on equality. Once the platform tag is established -
then - "we" (I guess that will mean me writing and "the community"
providing feedback) can look at how to use the tags over different
`releases` of AIX. Like MacOS, unlike Linux - there is only one distributor.

I am willing to work on an informational PEP - as long as waiting for
that process to complete does not mean an adequate platform_tag is left
in limbo for months to years. This new PEP would have two pieces - a)
describe the AIX platform tag; b) describe how tags of different
releases are compared and accepted or rejected as binary compatible.

Please note: the PR does not address any aspect of point b). Without
point a) there is no basis for point b).

Sincerely,

Michael

>
> I thought that was something that had been discussed on the Pip tracker, but 
> maybe the implications weren't clear (I don't really understand the AIX 
> scheme, so I'm relying on someone else, probably Michael, to propose 
> something that could be added to PEP 425 and to lead/guide the discussion).
>
> --
> nosy: +paul.moore
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue38905] venv python reports wrong sys.executable in a subprocess on Windows

2019-11-26 Thread Steve Dower

Steve Dower  added the comment:

> But then I need two separate workflows based on what is passed in. For py.exe 
> I need to run it and get sys.executable. But for python.exe I *cannot* use 
> sys.executable because that’s the base interepeter, not the venv path I want. 
> And `if Path(arg).stem == "py"` just seems like a bug waiting to happen.

If you use shutil.which() to resolve "python" or "py" against PATH (which 
doesn't include the application directory), then you'll get the full path to 
the correct python.exe and will get the expected sys.executable. So it's only 
one flow that works for both once you add the shutil.which step.

--

___
Python tracker 

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



[issue38919] support Assignment Operators

2019-11-26 Thread Zachary Ware


Zachary Ware  added the comment:

Agreed with Karthikeyan.  This is a PEP-level change, meaning it will first 
need to find some approval on python-ideas, a PEP will need to be written and 
eventually approved before an issue should be opened to implement the change; 
thus I'm closing this issue as "rejected".  I will warn you that it's very 
unlikely that this will make it through that process, but you are welcome to 
try :)

--
components: +Interpreter Core
nosy: +zach.ware
resolution:  -> rejected
stage:  -> resolved
status: open -> closed
type:  -> enhancement

___
Python tracker 

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



[issue38920] Audit events for unhandled exceptions

2019-11-26 Thread Steve Dower


Change by Steve Dower :


--
assignee:  -> steve.dower

___
Python tracker 

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



[issue38920] Audit events for unhandled exceptions

2019-11-26 Thread Steve Dower


Change by Steve Dower :


--
keywords: +patch
pull_requests: +16874
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/17392

___
Python tracker 

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



[issue38920] Audit events for unhandled exceptions

2019-11-26 Thread Steve Dower


New submission from Steve Dower :

We currently have no audit events for unhandled exceptions.

While these can be recorded by sys.excepthook or sys.unraisablehook in Python 
code, there is no way to intercept them from C code set up before running 
Python code. There's also no way to collect information about what hook is 
running, in the case where Python code may have overridden it (for example, to 
suppress error reporting when malicious code fails).

--
messages: 357517
nosy: steve.dower
priority: normal
severity: normal
stage: needs patch
status: open
title: Audit events for unhandled exceptions
type: enhancement
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



[issue38892] Audit Hook doc typos and confusion

2019-11-26 Thread miss-islington


miss-islington  added the comment:


New changeset 86d9933cc627c4232f9702ca0766713714ebbc53 by Miss Islington (bot) 
in branch '3.8':
bpo-38892: Improve docs for audit event (GH-17361)
https://github.com/python/cpython/commit/86d9933cc627c4232f9702ca0766713714ebbc53


--
nosy: +miss-islington

___
Python tracker 

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



[issue38892] Audit Hook doc typos and confusion

2019-11-26 Thread Steve Dower


Steve Dower  added the comment:

Thanks Terry!

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



[issue38913] Py_BuildValue("(s#O)", ...) segfaults if entered with exception raised

2019-11-26 Thread danielen


danielen  added the comment:

It is not reproducible with PY_SSIZE_T_CLEAN defined.

--

___
Python tracker 

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



[issue38892] Audit Hook doc typos and confusion

2019-11-26 Thread Steve Dower


Steve Dower  added the comment:


New changeset e563a155be60fc0757914f87c8138f10de00bb16 by Steve Dower (Terry 
Jan Reedy) in branch 'master':
bpo-38892: Improve docs for audit event (GH-17361)
https://github.com/python/cpython/commit/e563a155be60fc0757914f87c8138f10de00bb16


--

___
Python tracker 

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



[issue38892] Audit Hook doc typos and confusion

2019-11-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16873
pull_request: https://github.com/python/cpython/pull/17391

___
Python tracker 

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



[issue38913] Py_BuildValue("(s#O)", ...) segfaults if entered with exception raised

2019-11-26 Thread Steve Dower


Steve Dower  added the comment:

Does it depend on whether PY_SSIZE_T_CLEAN is defined?

--
nosy: +steve.dower

___
Python tracker 

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



[issue38919] support Assignment Operators

2019-11-26 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This needs to be discussed on python-ideas mailing list. Inplace operation for 
walrus operator like :*= feels difficulty to read than (x := x * 2) and would 
require changes to grammar.

--
nosy: +xtreak

___
Python tracker 

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



[issue26730] SpooledTemporaryFile doesn't correctly preserve data for text (non-binary) SpooledTemporaryFile objects when Unicode characters are written

2019-11-26 Thread Inada Naoki


Inada Naoki  added the comment:

But poor performance is better than silent data corruption.
If we can not fix the rollover right now, stop the spooling is a considerable 
option for next bugfix release.

--

___
Python tracker 

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



[issue22377] %Z in strptime doesn't match EST and others

2019-11-26 Thread miss-islington


miss-islington  added the comment:


New changeset bc441ed7c1449f06df37905ee6289aa93b85d4cb by Miss Islington (bot) 
(Karl Dubost) in branch 'master':
bpo-22377: Fixes documentation for %Z in datetime (GH-16507)
https://github.com/python/cpython/commit/bc441ed7c1449f06df37905ee6289aa93b85d4cb


--
nosy: +miss-islington

___
Python tracker 

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



[issue38914] Clarify wording for warning message when checking a package

2019-11-26 Thread Paul Ganssle


Paul Ganssle  added the comment:

For the future, we generally tend to keep distutils pretty "frozen", only 
making minor changes or the changes needed to build Python itself. Instead we 
generally make changes in setuptools, which for the moment monkey-patches 
distutils (and into which distutils will eventually be merged). One of the big 
reasons is that setuptools is used across all versions of Python, so the 
changes are automatically backported, whereas changes to distutils will only be 
seen by people using the most recent Python versions.

In this case, it's not really a substantive change, so I think we can leave it 
in distutils, I just wanted to bring this up as an FYI.

--
nosy: +p-ganssle

___
Python tracker 

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



[issue38919] support Assignment Operators

2019-11-26 Thread mohamad khosravi


New submission from mohamad khosravi :

support "Assignment Operators":

x = "ME"
while len(x:*=2) < 64:print("value doubled!")

--
messages: 357507
nosy: mohamad khosravi
priority: normal
severity: normal
status: open
title: support Assignment Operators
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



[issue26730] SpooledTemporaryFile doesn't correctly preserve data for text (non-binary) SpooledTemporaryFile objects when Unicode characters are written

2019-11-26 Thread James Hennessy


James Hennessy  added the comment:

I don't like the idea of using a TemporaryFile right from the beginning in text 
mode.  You might as well remove text mode support altogether if that's the 
approach you want to take, since it undoes any potential performance benefit of 
using SpooledTemporaryFile in the first place.

--

___
Python tracker 

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



[issue26730] SpooledTemporaryFile doesn't correctly preserve data for text (non-binary) SpooledTemporaryFile objects when Unicode characters are written

2019-11-26 Thread James Hennessy


James Hennessy  added the comment:

I have to disagree with the idea that SpooledTemporaryFile is not useful.  
Although on some systems, the file system may appear as fast as memory, that 
cannot be assumed to be universally true.  I think the idea behind 
SpooledTemporaryFile is completely valid.

--

___
Python tracker 

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



[issue38913] Py_BuildValue("(s#O)", ...) segfaults if entered with exception raised

2019-11-26 Thread Matthias Klose


Matthias Klose  added the comment:

seen with the current 3.8 branch.

--
keywords: +3.8regression
nosy: +doko, lukasz.langa
priority: normal -> release blocker

___
Python tracker 

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



[issue36375] PEP 499 implementation: "python -m foo" binds the main module as both __main__ and foo in sys.modules

2019-11-26 Thread Eric Snow


Eric Snow  added the comment:

Exactly. :)

I'd expect PEP 499 to specify changing __module__ of classes and functions from 
__main__ to the module name (__spec__.name).  This aligns closely with the 
whole point of the PEP. :)  As a bonus, it will simplify things for pickling 
(which doesn't inherently deal well with __main__).

--

___
Python tracker 

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



[issue38918] Add __module__ entry for function type in inspect docs table.

2019-11-26 Thread Eric Snow


New submission from Eric Snow :

The docs page for the inspect module has a large table describing the special 
attributes of various important types.  One entry for function attributes is 
missing: __module__.  It should be added.

Note that __module__ *is* included in the function attributes listed in the 
language reference. [2]

The same goes for the "method" (really "instance method") section of the table: 
it should also have __module__. [3]


[1] https://docs.python.org/3/library/inspect.html#types-and-members
[2] https://docs.python.org/3/reference/datamodel.html#index-34
[3] https://docs.python.org/3/reference/datamodel.html#index-36

--
assignee: docs@python
components: Documentation
keywords: easy, newcomer friendly
messages: 357502
nosy: docs@python, eric.snow
priority: normal
severity: normal
stage: needs patch
status: open
title: Add __module__ entry for function type in inspect docs table.
type: enhancement
versions: Python 3.7, 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



[issue38910] AssertionError: ElementTree not initialized, missing root

2019-11-26 Thread Stefan Behnel


Change by Stefan Behnel :


--
resolution:  -> third party
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



[issue38917] Color setting doesn't work in tkinter

2019-11-26 Thread Acid Ascorbic


New submission from Acid Ascorbic :

It is impossible to set colors properly in Treeview.
Python behavior is different between versions 3.6.2 and 3.7.3/3.8.0.
Origin: 
https://stackoverflow.com/questions/57634982/can-i-change-the-foreground-color-of-a-single-column-in-python-treeview/59047842
Example 1:

from tkinter import ttk
import tkinter as tk

root = tk.Tk()
tree = ttk.Treeview(root)
c = tree.insert('', 'end', text='This is critical message', tags='critical')
tree.insert(c, 'end', text='This is child of critical message', tags='critical')
for i in range(5):
tree.insert('', 'end', text='This is non-critical message')
tree.tag_configure('critical', background='red', foreground="black")
tree.pack()
root.mainloop()

Example 2:

import tkinter as tk
from tkinter import ttk

root = tk.Tk()
style = ttk.Style(root)
style.theme_use("clam")
style.configure("Treeview", background="black",
fieldbackground="black", foreground="white")
tree = ttk.Treeview(root)
tree.insert("", 0, "item", text="item")
tree.pack()
root.mainloop()

--
components: Tkinter
messages: 357501
nosy: Acid Ascorbic
priority: normal
severity: normal
status: open
title: Color setting doesn't work in tkinter
type: behavior
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue38914] Clarify wording for warning message when checking a package

2019-11-26 Thread Jürgen Gmach

Jürgen Gmach  added the comment:

Thank you for your feedback.

Paul Ganssle suggested a updated wording over at
https://github.com/pypa/pep517/issues/73
so this is why I created a pr accordingly.

The intent of this issue and the pr is to minimize the confusion for a beginner 
with Python packaging (e.g myself) by doing something with the probably wrong 
word "must".

Changing the checks is another way to fix this issue, but it is beyond my scope 
to say one is better or the other.

--

___
Python tracker 

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



[issue36221] Setting PYTHONASYNCIODEBUG breaks warnings

2019-11-26 Thread Denis S. Otkidach


Denis S. Otkidach  added the comment:

It's fixed in 3.8 final, but the problem persists in 3.7.5

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



[issue38914] Clarify wording for warning message when checking a package

2019-11-26 Thread Éric Araujo

Change by Éric Araujo :


--
type: enhancement -> behavior
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



[issue38914] Clarify wording for warning message when checking a package

2019-11-26 Thread Éric Araujo

Éric Araujo  added the comment:

For your project, if you define maintainer and maintainer-email (with your own 
info), it’s too bad that adding author results in a warning for missing 
author-email!

The goal of these checks as I understand them is a best effort to encourage 
projects to contain contact information (and recognition for the work).  It 
seems legitimate to know the original author name but not email, and too bad 
that the simplest way to avoid the warning is to remove the author info.

I wonder if it would be going too far to change the checks to avoid the warning 
if we have author, maintainer and maintainer-email (or even more combinations? 
given that email format allows embedding a name directly there)

--

___
Python tracker 

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



[issue38916] Remove array.fromstring

2019-11-26 Thread Dong-hee Na


Dong-hee Na  added the comment:

For whom are interested in this issue,
Please wait until the core developer decides to approve this issue. :)
After that, we can review the PR for this issue.

Thank you for understanding.

--

___
Python tracker 

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



[issue38916] Remove array.fromstring

2019-11-26 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +brett.cannon

___
Python tracker 

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



[issue38916] Remove array.fromstring

2019-11-26 Thread Dong-hee Na


Change by Dong-hee Na :


--
keywords: +easy (C)

___
Python tracker 

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



[issue38916] Remove array.fromstring

2019-11-26 Thread Dong-hee Na


Dong-hee Na  added the comment:

I'd like to tag this issue as an easy issue.

--

___
Python tracker 

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



[issue38916] Remove array.fromstring

2019-11-26 Thread Dong-hee Na


New submission from Dong-hee Na :

array.fromstring was deprecated at 3.2

IMHO, now we can remove array.fromstring.
For my research, there is no usage on the standard library.
I 'd like to propose that let's remove array.fromstring from 3.9

--
components: Library (Lib)
messages: 357495
nosy: benjamin.peterson, corona10, serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: Remove array.fromstring
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



[issue38910] AssertionError: ElementTree not initialized, missing root

2019-11-26 Thread Joseph Reagle


Joseph Reagle  added the comment:

On 11/26/19 12:06 AM, Karthikeyan Singaravelan wrote:
> Karthikeyan Singaravelan  added the comment:
> 
> This seems more like an issue with lxml.

I posted a report over there now too:

https://bugs.launchpad.net/lxml/+bug/1854057

--

___
Python tracker 

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



[issue38901] Add a CLI flag to venv to use the pwd basename as the prompt

2019-11-26 Thread Vinay Sajip


Vinay Sajip  added the comment:

Since there is already a --prompt available, I'd prefer a solution that allowed 
some special value(s) to be passed for this, e.g.

--prompt .

or perhaps

--prompt __curdir__

--

___
Python tracker 

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



[issue38915] 'r[/]*', str, re.MULTILINE | re.DOTALL Won't match // in a string in Python3.6.8

2019-11-26 Thread Yan


Change by Yan :


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

___
Python tracker 

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



[issue38915] 'r[/]*', str, re.MULTILINE | re.DOTALL Won't match // in a string in Python3.6.8

2019-11-26 Thread Yan


New submission from Yan :

str="//"
matches = re.finditer('r[/]*', str, re.MULTILINE | re.DOTALL)
for match in matches:
print(match.group(0))

The above will match double forward slash in Python2.7.15  but NOT in 
Python3.6.8.

--
components: Library (Lib)
messages: 357492
nosy: yanioaioan
priority: normal
severity: normal
status: open
title: 'r[/]*', str, re.MULTILINE | re.DOTALL Won't match // in a string in 
Python3.6.8
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue38914] Clarify wording for warning message when checking a package

2019-11-26 Thread Jürgen Gmach

Change by Jürgen Gmach :


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

___
Python tracker 

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



[issue26730] SpooledTemporaryFile doesn't correctly preserve data for text (non-binary) SpooledTemporaryFile objects when Unicode characters are written

2019-11-26 Thread Inada Naoki


Inada Naoki  added the comment:

Creating files is slow on Windows too.

But I think we should fix the data corruption ASAP.

While Serhiy's patch looks good to me, there is a more quick and safe way to 
fix the data corruption.  Use TemporaryFile at first if it is text mode.

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



[issue26730] SpooledTemporaryFile doesn't correctly preserve data for text (non-binary) SpooledTemporaryFile objects when Unicode characters are written

2019-11-26 Thread Inada Naoki


Change by Inada Naoki :


--
priority: normal -> critical

___
Python tracker 

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



[issue38914] Clarify wording for warning message when checking a package

2019-11-26 Thread Jürgen Gmach

New submission from Jürgen Gmach :

When creating a package for PyPi, and naming an author, but not an 
author_email, you get a warning as follows:

warning: Check: missing meta-data: if 'author' supplied, 'author_email' must be 
supplied too

The specs ( https://packaging.python.org/specifications/core-metadata/#author ) 
do not enforce this behavior, so I'd like to change the wording from `must` to 
`should`.

This can be reproduced by creating a setup.py, providing `author`, but not 
`author_email`, and then calling `python setup.py check` or `python -m 
pep517.build .`.

This issue was discussed at:
https://discuss.python.org/t/which-fields-are-required-for-a-setup-py-especially-is-author-required/2705
and
https://github.com/pypa/pep517/issues/73

Background:
I ported a 16 year old package to Python 3, and tried to upload it to PyPi. I 
know the author name, but not his email address. Also, I think he does not like 
to get bothered with emails for a project he abandoned 16 years ago.

P.S.: I am working on a PR for this and update this issue accordingly.

--
components: Distutils
messages: 357490
nosy: dstufft, eric.araujo, jugmac00
priority: normal
severity: normal
status: open
title: Clarify wording for warning message when checking a package
type: enhancement

___
Python tracker 

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



[issue38897] Example in socket documentation uses deprecated array.fromstring

2019-11-26 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks David for the report and patch.

--
nosy: +xtreak
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



[issue38897] Example in socket documentation uses deprecated array.fromstring

2019-11-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16869
pull_request: https://github.com/python/cpython/pull/17387

___
Python tracker 

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



[issue38803] test_wait3 and test_wait4 leaked references on x86 Gentoo Refleaks 3.x

2019-11-26 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks for the fix Eddie Elizondo!

--

___
Python tracker 

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



[issue27145] long_add and long_sub might return a new int where _ints[x] could be returned

2019-11-26 Thread STINNER Victor


STINNER Victor  added the comment:

It seems like there are a few corner cases where long integers are not 
normalized:
https://github.com/python/cpython/pull/15716#pullrequestreview-298002027

But the initial issue described here has been fixed, so it's better to keep 
this issue closed. If someone wants to cover more cases (to normalize), please 
open a separated issue.

Thanks HongWeipeng for the fix and Oren Milman for the original bug report and 
original patches!

--

___
Python tracker 

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