[issue32973] Importing the same extension module under multiple names breaks non-reinitialisable extension modules

2018-03-02 Thread Stefan Behnel
Stefan Behnel added the comment: > change the extension module cache to key on filename and init function name ... or on the pointer to the PyInit function. If that's the same, we obviously have the same extension module. If it differs, even for the same module name,

[issue3177] Add shutil.open

2018-03-02 Thread Socob
Change by Socob <206a8...@opayq.com>: -- nosy: +Socob ___ Python tracker ___ ___ Python-bugs-list mailing

[issue30811] A venv created and activated from within a virtualenv uses the outer virtualenv's site-packages rather than its own.

2018-03-02 Thread Tzu-ping Chung
Tzu-ping Chung added the comment: @cosven you are correct! I made some additional observation while working on adding venv support to pew, in this thread: https://github.com/berdario/pew/pull/173. I’ll try to summarise below. The root problem is indeed virtualenv’s custom

[issue32978] Issues with reading large float values in AIFC files

2018-03-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: But I don't know the exact format for infinities and NaNs. -- ___ Python tracker ___

[issue32985] subprocess.Popen: Confusing documentation for restore_signals

2018-03-02 Thread Alicia Boya García
New submission from Alicia Boya García : The docs state: > If restore_signals is true (the default) all signals that Python has set to > SIG_IGN are restored to SIG_DFL in the child process before the exec. > Currently this includes the SIGPIPE, SIGXFZ and SIGXFSZ signals.

[issue32973] Importing the same extension module under multiple names breaks non-reinitialisable extension modules

2018-03-02 Thread Stefan Behnel
Change by Stefan Behnel : -- components: +Extension Modules nosy: +scoder ___ Python tracker ___

[issue32973] Importing the same extension module under multiple names breaks non-reinitialisable extension modules

2018-03-02 Thread Petr Viktorin
Petr Viktorin added the comment: Well, PEP 489 basically punts this to module authors: generally, C globals are bad, but if you do have global state, please manage it, keeping in mind that multiple module objects can be created from the extension. That's required to make

[issue32978] Issues with reading large float values in AIFC files

2018-03-02 Thread Mark Dickinson
Mark Dickinson added the comment: > If left the OverflowError propagated I would catch it at the caller place > (_read_float() is used only once) and reraise as aifc.Error. Ah, if there's a dedicated exception type already then yes, agreed that raising aifc.Error (with a

[issue32978] Issues with reading large float values in AIFC files

2018-03-02 Thread Mark Dickinson
Mark Dickinson added the comment: > What if return 80-bit infinities and NaN as 64-bit infinities and NaN and > raise an error in the case of finite numbers overflow? That's certainly reasonable from a pure floating-point-conversion perspective: it's exactly what I'd

[issue32986] multiprocessing, default assumption of Pool size unhelpful

2018-03-02 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +5726 stage: -> patch review ___ Python tracker ___

[issue32984] IDLE: set and unset __file__ for startup files

2018-03-02 Thread Terry J. Reedy
Terry J. Reedy added the comment: When the IDLE GUI process is started, its main.__file__ is set to the idlelib .py file used to start the process. If IDLE is started with -n, so that user code is run in the same process (the original mode), the -r or -s startup file and

[issue32968] Fraction modulo infinity should behave consistently with other numbers

2018-03-02 Thread Elias Zamaria
Elias Zamaria added the comment: Any suggestions as to what I should do? I can either update my pull request with my floordiv change, or create a new pull request, or wait a while to see if anyone else has any opinion on changing the behavior. --

[issue32973] Importing the same extension module under multiple names breaks non-reinitialisable extension modules

2018-03-02 Thread Eric Snow
Eric Snow added the comment: PEP 489 ("Multi-phase extension module initialization") is relevant here, so I've nosied Petr. -- nosy: +encukou ___ Python tracker

[issue32980] Remove functions that do nothing in _Py_InitializeCore()

2018-03-02 Thread Benjamin Peterson
Benjamin Peterson added the comment: Future maintainers of what exactly can expect these functions to be called? CPython? If we need to do initialization of frameobject.c later, we can simply add _PyFrame_Init back. We certainly don't support ELF-interposition of

[issue32978] Issues with reading large float values in AIFC files

2018-03-02 Thread Mark Dickinson
Mark Dickinson added the comment: > But I don't know the exact format for infinities and NaNs. >From the Intel software developer manuals: For infinities: Sign bit: 0 or 1 (positive or negative infinity) Exponent field (15 bits): all ones Significand (64 bits): first bit

[issue32984] IDLE: set and unset __file__ for startup files

2018-03-02 Thread Terry J. Reedy
Terry J. Reedy added the comment: Revised, more exact, URL: https://stackoverflow.com/questions/49054093/cannot-use-file-when-running-startup-file-in-idles-normal-mode -- ___ Python tracker

[issue32984] IDLE: set and unset __file__ for startup files

2018-03-02 Thread Terry J. Reedy
New submission from Terry J. Reedy : 'python somefile.py' sets main.__file__ to 'somefile.py'. 'python' leaves __file__ unset. If PYTHONSTARTUP is set to somefile.py, 'python' executes somefile.py in main with __file__ set to 'somefile.py', then unsets __file__ before the

[issue32978] Issues with reading large float values in AIFC files

2018-03-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your review Mark. If left the OverflowError propagated I would catch it at the caller place (_read_float() is used only once) and reraise as aifc.Error. OverflowError is not expected exception. It never is raised

[issue32978] Issues with reading large float values in AIFC files

2018-03-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What if return 80-bit infinities and NaN as 64-bit infinities and NaN and raise an error in the case of finite numbers overflow? -- ___ Python tracker

[issue32986] multiprocessing, default assumption of Pool size unhelpful

2018-03-02 Thread M J Harvey
New submission from M J Harvey : Hi, multiprocessing's default assumption about Pool size is os.cpu_count() ie all the cores visible to the OS. This is tremendously unhelpful when running multiprocessing code inside an HPC batch system (PBS Pro in my case), as there's

[issue28134] socket.socket(fileno=fd) does not work as documented

2018-03-02 Thread YoSTEALTH
YoSTEALTH added the comment: It would be nice if "python" accounted for such low level os things. None the less client.detach() method works fine. I really did enjoy your talk, kinda bummed it was short and didn't get into more details. Thanks for your help and

[issue32983] UnicodeDecodeError 'ascii' codec can't decode byte in position - ordinal not in range(128)

2018-03-02 Thread Glenn Linderman
Glenn Linderman added the comment: The problem here is that the error message is trying to write to an output device using ASCII. If there is no error, there is no error message print attempt. The error message, when written to an ASCII device, needs to be escaped.

[issue32986] multiprocessing, default assumption of Pool size unhelpful

2018-03-02 Thread Ned Deily
Change by Ned Deily : -- nosy: +davin, pitrou ___ Python tracker ___ ___ Python-bugs-list

[issue32378] test_npn_protocols broken with LibreSSL 2.6.1+

2018-03-02 Thread Bernard Spil
Bernard Spil added the comment: My pleasure! Glad we sorted this out for no-nextprotoneg and LibreSSL :D -- ___ Python tracker

[issue32963] Python 2.7 tutorial claims source code is UTF-8 encoded

2018-03-02 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: I'm not intending to work on this, nothing until after PyCon :) Feel free to pick it up. -- ___ Python tracker

[issue32985] subprocess.Popen: Confusing documentation for restore_signals

2018-03-02 Thread Ned Deily
Change by Ned Deily : -- nosy: +giampaolo.rodola, gregory.p.smith ___ Python tracker ___

[issue32963] Python 2.7 tutorial claims source code is UTF-8 encoded

2018-03-02 Thread Brett Cannon
Brett Cannon added the comment: If no one gets to this before the sprints at PyCon US I will take care of it, but anyone can feel free to submit a pull request to fix this. -- assignee: docs@python -> brett.cannon keywords: +easy

[issue32982] Parse out invisible Unicode characters?

2018-03-02 Thread Glenn Linderman
Glenn Linderman added the comment: Characters should not be stripped during compilation. But I can see where it might be helpful if the codepoint of the character, and the printed form just in case it is printable, could helpfully be included in the error message, as

[issue32955] IDLE crashes when trying to save a file

2018-03-02 Thread Terry J. Reedy
Terry J. Reedy added the comment: What do you mean by crash? An exception from Python (which is not a crash)? or something from MacOS? -- ___ Python tracker

[issue32732] LoggingAdapter ignores extra kwargs of Logger#log()

2018-03-02 Thread Vinay Sajip
Vinay Sajip added the comment: The existing LoggerAdapter functionality has been around since Jan 2008, and it seems that no one in that time has raised this as a must-have. In summary: 1. If you want to pass different kwargs in every time, use a logger. 2. If you

[issue32982] Parse out invisible Unicode characters?

2018-03-02 Thread Matthew Barnett
Matthew Barnett added the comment: For the record, '\u200e' is '\N{LEFT-TO-RIGHT MARK}'. -- nosy: +mrabarnett ___ Python tracker

[issue32933] mock_open does not support iteration around text files.

2018-03-02 Thread Terry J. Reedy
Change by Terry J. Reedy : -- nosy: +ezio.melotti, michael.foord, rbcollins versions: +Python 3.8 -Python 3.4, Python 3.5 ___ Python tracker

[issue32988] datetime.datetime.strftime('%s') always uses local timezone, even with aware datetimes

2018-03-02 Thread Adam Williamson
New submission from Adam Williamson : Test script: import pytz import datetime utc = pytz.timezone('UTC') print(datetime.datetime(2017, 1, 1, tzinfo=utc).strftime('%s')) Try running it with various system timezones: [adamw@xps13k pagure (more-timezone-fun %)]$ TZ='UTC'

[issue32988] datetime.datetime.strftime('%s') always uses local timezone, even with aware datetimes

2018-03-02 Thread Paul Ganssle
Paul Ganssle added the comment: adamwill: I think datetime's strftime is a wrapper around the system strftime, so it varies between platforms. Might be useful to specify which platform you are seeing this behavior on. -- nosy: +p-ganssle

[issue28124] Rework SSL module documentation

2018-03-02 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +5731 ___ Python tracker ___

[issue32988] datetime.datetime.strftime('%s') always uses local timezone, even with aware datetimes

2018-03-02 Thread Adam Williamson
Adam Williamson added the comment: Paul: right. This is on Linux - specifically Fedora Linux, but I don't think it matters. glibc strftime and strptime depend on an underlying struct called 'tm'. 'man strftime' says: %s The number of seconds since the Epoch,

[issue32988] datetime.datetime.strftime('%s') always uses local timezone, even with aware datetimes

2018-03-02 Thread Adam Williamson
Adam Williamson added the comment: I'd suggest that if that is the case, it would be better for the docs to *specifically mention* that `%s` is not supported and should not be used, rather than simply not mentioning it. When it's used in real code (note someone in the SO

[issue32988] datetime.datetime.strftime('%s') always uses local timezone, even with aware datetimes

2018-03-02 Thread Paul Ganssle
Paul Ganssle added the comment: I suspect discussion should be centralized in issue 12750, but if it were up to me %s would either work as expected or throw an error. Silently giving the wrong answer is a terrible compromise. --

[issue12750] add cross-platform support for %s strftime-format code

2018-03-02 Thread Adam Williamson
Adam Williamson added the comment: On the "attractive nuisance" angle: I just ran right into this problem, and reported https://bugs.python.org/issue32988 . As I suggested there, if Python doesn't try to fix this, I'd suggest it should at least *explicitly document* that

[issue32989] IDLE: Incorrect signature in call from editor to pyparse.find_good_parse_start

2018-03-02 Thread Terry J. Reedy
Terry J. Reedy added the comment: To be clear, the signature that got changed in 2005 is the signature for find_good_parse_start ('fgps'), which was previously def find_good_parse_start(self, use_ps1, is_char_in_string=None, _synchre=_synchre) When the use_ps1 parameter

[issue32989] IDLE: Incorrect signature in call from editor to pyparse.find_good_parse_start

2018-03-02 Thread Terry J. Reedy
Terry J. Reedy added the comment: Since _synchre is never passed, it should not be a parameter either. I think we should either limit this to fixing the call, with no unit test added, or expand to 'fix find_good_parse_start and buggy call', with revised tests. It might be

[issue32958] socket module calls with long host names can fail with idna codec error

2018-03-02 Thread Aaron Black
Aaron Black added the comment: Just to be clear, I don't know if the socket needs to support 64 character long host name sections, so here's an example url that is at the root of my problem that I'm pretty sure it should support: >>> import socket >>> h = >>>

[issue32963] Python 2.7 tutorial claims source code is UTF-8 encoded

2018-03-02 Thread Brett Cannon
Brett Cannon added the comment: New changeset 20003f9162631c47b79202316036d13d74484e4c by Brett Cannon in branch '2.7': bpo-32963: Fix the tutorial to state source has a default encoding of ASCII (GH-5961)

[issue32963] Python 2.7 tutorial claims source code is UTF-8 encoded

2018-03-02 Thread Brett Cannon
Brett Cannon added the comment: Thanks for the bug report, Martijn! -- keywords: -patch resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue32987] tokenize.py parses unicode identifiers incorrectly

2018-03-02 Thread Steve B
New submission from Steve B : Here is an example involving the unicode character MIDDLE DOT · : The line ab·cd = 7 is valid Python 3 code and is happily accepted by the CPython interpreter. However, tokenize.py does not like it. It says that the middle-dot is an error

[issue32958] socket module calls with long host names can fail with idna codec error

2018-03-02 Thread Ned Deily
Ned Deily added the comment: Thanks for the report. The behavior you see can be further isolated to socket.gethostbyname: >>> import socket >>> h = >>> "0123456789012345678901234567890123456789012345678901234567890123.example.com" >>> socket.gethostbyname(h) Traceback (most

[issue32963] Python 2.7 tutorial claims source code is UTF-8 encoded

2018-03-02 Thread Brett Cannon
Change by Brett Cannon : -- keywords: +patch pull_requests: +5729 stage: -> patch review ___ Python tracker ___

[issue32758] Stack overflow when parse long expression to AST

2018-03-02 Thread Brett Cannon
Brett Cannon added the comment: The PR adds the documentation warnings. Serhiy, can you double-check that I have the appropriate functions and the comment is acceptable? -- ___ Python tracker

[issue25427] Remove the pyvenv script in Python 3.8

2018-03-02 Thread Brett Cannon
Change by Brett Cannon : -- keywords: +patch pull_requests: +5730 stage: needs patch -> patch review ___ Python tracker ___

[issue32758] Stack overflow when parse long expression to AST

2018-03-02 Thread Brett Cannon
Change by Brett Cannon : -- keywords: +patch pull_requests: +5728 stage: needs patch -> patch review ___ Python tracker ___

[issue32989] IDLE: Incorrect signature in call from editor to pyparse.find_good_parse_start

2018-03-02 Thread Cheryl Sabella
New submission from Cheryl Sabella : >From msg312726 on issue32880. The call to find_good_parse_start: bod = y.find_good_parse_start(self.context_use_ps1, self._build_char_in_string_func(startatindex)) sends 3 parameters. And in

[issue32880] IDLE: Fix and update and cleanup pyparse

2018-03-02 Thread Cheryl Sabella
Change by Cheryl Sabella : -- dependencies: +IDLE: Incorrect signature in call from editor to pyparse.find_good_parse_start ___ Python tracker

[issue32988] datetime.datetime.strftime('%s') always uses local timezone, even with aware datetimes

2018-03-02 Thread Paul Ganssle
Paul Ganssle added the comment: It seems that %s is not supported and the fact that it works at all is incidental. See issue 12750 and this SO thread: https://stackoverflow.com/questions/11743019/convert-python-datetime-to-epoch-with-strftime --

[issue32988] datetime.datetime.strftime('%s') always uses local timezone, even with aware datetimes

2018-03-02 Thread Adam Williamson
Adam Williamson added the comment: Yeah, I've added a comment there. I agree we can keep subsequent discussion in that issue. Closing this as a dupe. I actually have the same thought as you, but I suspect making something that "worked" before start throwing an error

[issue32989] IDLE: Incorrect signature in call from editor to pyparse.find_good_parse_start

2018-03-02 Thread Terry J. Reedy
Terry J. Reedy added the comment: If fgps never returns 0, then returning 0 instead of None would allow simplification of if bod is not None or startat == 1: break parser.set_lo(bod or 0) to if bod or startat

[issue32980] Remove functions that do nothing in _Py_InitializeCore()

2018-03-02 Thread Nick Coghlan
Nick Coghlan added the comment: Yeah, dropping _PyFrame_Init/Fini for 3.8+ would make sense. It's PyByteArray_Init/Fini that probably aren't worth the hassle of removing, since the lack of a leading underscore means they'd need to go through a deprecation cycle.

[issue32964] Reuse a testing implementation of the path protocol in tests

2018-03-02 Thread miss-islington
Change by miss-islington : -- pull_requests: +5724 ___ Python tracker ___

[issue32964] Reuse a testing implementation of the path protocol in tests

2018-03-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset b21d155f57d284aecf9092a9bd24258293965c2f by Serhiy Storchaka in branch 'master': bpo-32964: Reuse a testing implementation of the path protocol in tests. (#5930)

[issue32983] UnicodeDecodeError 'ascii' codec can't decode byte in position - ordinal not in range(128)

2018-03-02 Thread Jiri Prajzner
Jiri Prajzner added the comment: Locate "\u179a\u1794\u17b6\u179a\u200b\u17a7\u1794\u1780\u179a\u178e\u17cd\u200b\u179a\u17bb\u1780\u179a\u1780\u200b"->"\u179f\u17d2\u179c\u17c2\u1784\u179a\u1780

[issue32964] Reuse a testing implementation of the path protocol in tests

2018-03-02 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +5725 ___ Python tracker ___ ___

[issue32964] Reuse a testing implementation of the path protocol in tests

2018-03-02 Thread miss-islington
miss-islington added the comment: New changeset a13b65422a1078104e9f53ad41945ea380a80798 by Miss Islington (bot) in branch '3.7': bpo-32964: Reuse a testing implementation of the path protocol in tests. (GH-5930)

[issue32980] Remove functions that do nothing in _Py_InitializeCore()

2018-03-02 Thread Nick Coghlan
Nick Coghlan added the comment: (Bringing my response from core-mentorship over to the main tracker) These APIs are exposed to embedding applications via the pylifecycle header: https://github.com/python/cpython/blob/master/Include/pylifecycle.h#L143 While we technically

[issue32983] UnicodeDecodeError 'ascii' codec can't decode byte in position - ordinal not in range(128)

2018-03-02 Thread Jiri Prajzner
Jiri Prajzner added the comment: Locate "URL \u307e\u305f\u306f\u691c\u7d22\u8a9e\u53e5\u3092\u5165\u529b\u3057\u307e\u3059"->"URL \u307e\u305f\u306f\u691c\u7d22\u8a9e\u53e5\u3092\u5165\u529b\u3057\u307e\u3059" and browse "http://www.google.com; website throws the same

[issue32983] UnicodeDecodeError 'ascii' codec can't decode byte in position - ordinal not in range(128)

2018-03-02 Thread Jiri Prajzner
New submission from Jiri Prajzner : Locate "Barra de navegació"->"Término de búsqueda o dirección" and browse "http://www.columbia.edu/~fdc/utf8/; website - results in: Exception UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 73: ordinal not in

[issue30811] A venv created and activated from within a virtualenv uses the outer virtualenv's site-packages rather than its own.

2018-03-02 Thread cosven
cosven added the comment: It is actually a bug in virtualenv instead of venv. > the outer environment's pip leaks into the inner environment; This is true, but why? In short, the inner-env python binary use `outer-env/` directory as its `prefix` direcotry, but the

[issue32430] Simplify Modules/Setup{,.dist,.local}

2018-03-02 Thread Kubilay Kocak
Change by Kubilay Kocak : -- nosy: +koobs ___ Python tracker ___ ___

[issue32968] Fraction modulo infinity should behave consistently with other numbers

2018-03-02 Thread Mark Dickinson
Mark Dickinson added the comment: [Elias Zamaria] > I see exactly that. Understood; that's how I interpreted your "changed one test to make sure that it works". It seems we understand each other. :-) So yes, one always needs to be very cautious about changing deliberate,

[issue32978] Issues with reading large float values in AIFC files

2018-03-02 Thread Mark Dickinson
Mark Dickinson added the comment: > And I think that using math.ldexp() can be more preferable that pow(2.0, ...) Yes, absolutely agreed. I'll take a look at the PR. -- ___ Python tracker