[issue24981] Add a test which uses the ast module to compile the stdlib

2015-09-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 This is a great idea. -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing

[issue23517] datetime.utcfromtimestamp rounds results incorrectly

2015-09-01 Thread Larry Hastings
Larry Hastings added the comment: > too late for 3.5.0 How's that? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2015-09-01 Thread Martin Panter
Martin Panter added the comment: A test case with data like this would make more sense to me: # Response without HTTP status line or header, modelling responses sent by # some proxies that do not support CONNECT body = b"400 Bad Request" -- ___ Pytho

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2015-09-01 Thread Martin Panter
Martin Panter added the comment: Left some review comments. But I don’t completely understand the test case. Is it true there are proxies that do not send a HTTP status line (like HTTP/1.0 200 Connection Established), but do sned the rest of the HTTP header section? This is what the test case

[issue24982] shutil.make_archive doesn't archive empty directories

2015-09-01 Thread Eugene Kolo
New submission from Eugene Kolo: Zip file is sometimes known to only contain files and the paths to them, but it can also have have empty folders, they are zero length files with a flag set. make_archive just ignores empty directories, I propose that there should either be a flag, or it should

[issue23517] datetime.utcfromtimestamp rounds results incorrectly

2015-09-01 Thread STINNER Victor
STINNER Victor added the comment: Ok, I fixed the issue in Python 3.6. Example with the initial message: $ python2.7 -c 'import datetime; print(datetime.datetime.utcfromtimestamp(1424817268.274).microsecond); print(datetime.datetime.utcfromtimestamp(-1424817268.274).microsecond)' 274000 726000

[issue23517] datetime.utcfromtimestamp rounds results incorrectly

2015-09-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset b690bf218702 by Victor Stinner in branch 'default': Issue #23517: datetime.datetime.fromtimestamp() and https://hg.python.org/cpython/rev/b690bf218702 -- ___ Python tracker

[issue23517] datetime.utcfromtimestamp rounds results incorrectly

2015-09-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset abeb625b20c2 by Victor Stinner in branch 'default': Issue #23517: Add "half up" rounding mode to the _PyTime API https://hg.python.org/cpython/rev/abeb625b20c2 -- nosy: +python-dev ___ Python tracker

[issue24929] _strptime.TimeRE should not enforce range in regex

2015-09-01 Thread Steve Yeung
Steve Yeung added the comment: I'm not sure what format I'm supposed to provide the test in. I attached a file that has the diff of the changes I made, and how the error message is changed (and improved!) in both datetime and time. -- Added file: http://bugs.python.org/file40319/file

[issue24981] Add a test which uses the ast module to compile the stdlib

2015-09-01 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +yselivanov ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue24981] Add a test which uses the ast module to compile the stdlib

2015-09-01 Thread Brett Cannon
New submission from Brett Cannon: Issue #24975 shows that we can easily end up with holes in support from the ast module. We should probably make sure we have a test that goes through the entire stdlib, Does an ast.parse(), and then passes the result to compile() to verify no exceptions are ra

[issue24975] Python 3.5 can't compile AST involving PEP 448 unpacking

2015-09-01 Thread Brett Cannon
Brett Cannon added the comment: Created issue #24981 to track the test case idea. -- ___ Python tracker ___ ___ Python-bugs-list maili

[issue24975] Python 3.5 can't compile AST involving PEP 448 unpacking

2015-09-01 Thread Yury Selivanov
Yury Selivanov added the comment: Larry, I created a PR for you: https://bitbucket.org/larry/cpython350/pull-requests/10/issue-24975-fix-ast-compilation-for-pep/diff Brett, Should we do that in a separate issue targeting 3.6 only? -- ___ Python tr

[issue24891] race condition in initstdio() (python aborts running under nohup)

2015-09-01 Thread Yi Ding
Yi Ding added the comment: I'm not sure this is a race condition. There's a crash every single time python is started when running the test.sh script under nohup. If it's a race condition, it should only happen some of the time, not every single time. Can you reeevaluate the priority? --

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2015-09-01 Thread Garfield222
Garfield222 added the comment: This error occurs when using youtube-dl Complete log is here: https://github.com/rg3/youtube-dl/issues/6727 -- ___ Python tracker ___

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2015-09-01 Thread Garfield222
Garfield222 added the comment: Same error happens if http_proxy="223.19.230.181:80" variable is set. -- nosy: +Garfield222 ___ Python tracker ___

[issue24912] The type of cached objects is mutable

2015-09-01 Thread Nathaniel Smith
Nathaniel Smith added the comment: Pull request version of patch is here: https://bitbucket.org/larry/cpython350/pull-requests/9/fix-issue-24912-disallow-reassigning-the/diff (identical to issue24912-v2.patch except for the addition of a NEWS entry) --

[issue24912] The type of cached objects is mutable

2015-09-01 Thread Guido van Rossum
Guido van Rossum added the comment: OK, then I think it's between you and Serhiy. -- ___ Python tracker ___ ___ Python-bugs-list maili

[issue24912] The type of cached objects is mutable

2015-09-01 Thread Nathaniel Smith
Nathaniel Smith added the comment: > I do understand your predicament. Can you live with just a special case for > modules? __class__ assignment is full of non-portable special cases already. Not only can I live with it, but -- unless I misunderstand your meaning -- this is exactly the approac

[issue7175] Define a standard location and API for configuration files

2015-09-01 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Sep 01, 2015, at 07:15 PM, Glyph Lefkowitz wrote: >There are other advantages to following the XDG spec. If we follow it >correctly (and not, like Barry suggested, start adding random other >directories like ~/.python) I was really just suggesting reading

[issue24980] Allow for providing 'on_new_thread' callback to 'concurrent.futures.ThreadPoolExecutor'

2015-09-01 Thread Joshua Harlow
Joshua Harlow added the comment: Initial possible patch. -- keywords: +patch type: enhancement -> Added file: http://bugs.python.org/file40318/add_future_callback.patch ___ Python tracker _

[issue24980] Allow for providing 'on_new_thread' callback to 'concurrent.futures.ThreadPoolExecutor'

2015-09-01 Thread Eric Fried
Changes by Eric Fried : -- nosy: +2uasimojo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue24912] The type of cached objects is mutable

2015-09-01 Thread Guido van Rossum
Guido van Rossum added the comment: PS. I have very little time this week or next to review everything -- if we don't find a reasonable compromise it *will* be rolled back. -- ___ Python tracker __

[issue24912] The type of cached objects is mutable

2015-09-01 Thread Guido van Rossum
Guido van Rossum added the comment: I don't think I told you to do it this way -- that message of mind sounded pretty noncommittal in all directions. I do understand your predicament. Can you live with just a special case for modules? __class__ assignment is full of non-portable special cases

[issue24912] The type of cached objects is mutable

2015-09-01 Thread Mark Shannon
Mark Shannon added the comment: I think Nathaniel and Eugene argument that you cannot replace the module in sys.modules safely in erroneous. Immediately after the module is created by importlib it is inserted into sys.modules. The code object for the module is then executed. At that point, whe

[issue24980] Allow for providing 'on_new_thread' callback to 'concurrent.futures.ThreadPoolExecutor'

2015-09-01 Thread Joshua Harlow
Changes by Joshua Harlow : -- components: +Library (Lib) ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue24980] Allow for providing 'on_new_thread' callback to 'concurrent.futures.ThreadPoolExecutor'

2015-09-01 Thread Joshua Harlow
Changes by Joshua Harlow : -- versions: +Python 3.6 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue24980] Allow for providing 'on_new_thread' callback to 'concurrent.futures.ThreadPoolExecutor'

2015-09-01 Thread Joshua Harlow
Changes by Joshua Harlow : -- type: -> enhancement ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue7175] Define a standard location and API for configuration files

2015-09-01 Thread Glyph Lefkowitz
Glyph Lefkowitz added the comment: XDG_CONFIG_HOME is not generally set to anything; the default of ~/.config is usually fine. However, the point is that you _can_ set it to point at a different location. The relevant specification is here: http://standards.freedesktop.org/basedir-spec/basedi

[issue24912] The type of cached objects is mutable

2015-09-01 Thread Nathaniel Smith
Nathaniel Smith added the comment: Guido van Rossum wrote: > But first, why is it so important to assign the __class__ of a module? It > seems somebody is trying to make modules into what they weren't meant to be. Because you told me to do it this way on python-dev :-( https://mail.python.org

[issue24980] Allow for providing 'on_new_thread' callback to 'concurrent.futures.ThreadPoolExecutor'

2015-09-01 Thread Joshua Harlow
New submission from Joshua Harlow: In situations where thread-local variables need to be setup it is quite useful to be able to hook into the thread creation process, so that as each new thread is spun up by the ThreadPoolExecutor that the threads created initially call into a provided callbac

[issue24912] The type of cached objects is mutable

2015-09-01 Thread Guido van Rossum
Guido van Rossum added the comment: If we don't reach an agreement we should fall back to Serhiy's (1) only. Eugene: Without more motivation that sounds like very questionable functionality to want to add to modules. I don't have time to read the discussion that led up to this, but modules are

[issue24912] The type of cached objects is mutable

2015-09-01 Thread Eugene Toder
Eugene Toder added the comment: Guido: IIUC the general intention is to support @property and __getattr__ style hooks on the module level. Assigning to sys.modules[name] from the module itself is a bit too late -- there's already a global dict for this module, and no way to create a module fro

[issue24975] Python 3.5 can't compile AST involving PEP 448 unpacking

2015-09-01 Thread Brett Cannon
Brett Cannon added the comment: Do we not have a test that compiles the entire stdlib using the ast module? We used to have one for the old compiler package. If don't have such a test we should probably add it even if it requires a -u option. -- nosy: +brett.cannon ___

[issue24978] Contributing to Python 2x and 3x Documentation. Translation to Russian.

2015-09-01 Thread Georg Brandl
Georg Brandl added the comment: Someone will have to step up to manage this effort. The technical side is pretty much solved with sphinx-i18n. I think this is something the PSF should sponsor. (I wrote a proposal to the board a while ago, but I couldn't find a candidate to do it.) --

[issue24978] Contributing to Python 2x and 3x Documentation. Translation to Russian.

2015-09-01 Thread Brett Cannon
Brett Cannon added the comment: Is it time we start managing translations somehow? Or at least have a link off of docs.python.org to various translations so they are easier to discover? -- nosy: +brett.cannon ___ Python tracker

[issue24912] The type of cached objects is mutable

2015-09-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The c0d25de5919e changeset consists of three parts: 1) Fixes a bug (disallow an assignment of incompatible __class__ that happens to have the same __basesize__). 2) Allows __class__ assignment for module type. 3) Allows __class__ assignment for other types, i

[issue24934] django_v2 benchmark not working in Python 3.6

2015-09-01 Thread Brett Cannon
Brett Cannon added the comment: I would still rather wait until Django 1.9.0 is officially released else we are benchmarking alpha code which doesn't seem worth it. With Python 3.6.0 not due out until about 15 months after 1.9.0 comes out I think going 3 months without a Django benchmark for 3

[issue24934] django_v2 benchmark not working in Python 3.6

2015-09-01 Thread Brett Cannon
Changes by Brett Cannon : -- assignee: -> brett.cannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue7175] Define a standard location and API for configuration files

2015-09-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: If this is about existing config files, then we should make sure we don't break existing installations. Also, multiple possible locations in the home dir are confusing. If this is about new config files, then ~/.config/python/XXX is probably ok. I'm not sure

[issue24974] ICC on Windows 8.1: _decimal fails to compile with default fp model

2015-09-01 Thread Stefan Krah
Stefan Krah added the comment: If "#pragma float_control(precise, push)" is exactly the MSVC default then I'm fine with putting it on top of FENV_ACCESS. There's nothing speed sensitive going on here: In the 32-bit build the x87 FPU is used for modular multiplication of integers and needs the co

[issue24965] Implement PEP 498: Literal String Formatting

2015-09-01 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +yselivanov ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue24973] CFLAGS for Visual Studio

2015-09-01 Thread Steve Dower
Steve Dower added the comment: All environment variables are promoted to MSBuild properties, so if you "set IncludeSSL=false" before building then it will show up (which is exactly how the proposed patch is getting CFLAGS in). Unfortunately, batch file argument parsing is pretty horrid. I'd be

[issue24974] ICC on Windows 8.1: _decimal fails to compile with default fp model

2015-09-01 Thread Zachary Ware
Zachary Ware added the comment: Steve Dower added the comment: > fenv_access is not available when compiling with /fp:fast, which is > apparently ICC's default. > > The proposed workaround here changes that default to /fp:strict, which is a > very different model, for all of CPython. I proposed

[issue24912] The type of cached objects is mutable

2015-09-01 Thread STINNER Victor
STINNER Victor added the comment: Sorry, I don't have time to read the whole discussion. Since we are *very* close to 3.5 final, I agree with Mark: "Please revert c0d25de5919e. Breaking the interpreter in order to facilitate some obscure use case is unacceptable." We can reintroduce the featu

[issue24974] ICC on Windows 8.1: _decimal fails to compile with default fp model

2015-09-01 Thread Steve Dower
Steve Dower added the comment: fenv_access is not available when compiling with /fp:fast, which is apparently ICC's default. The proposed workaround here changes that default to /fp:strict, which is a very different model, for all of CPython. I proposed using #pragma float_control to force /f

[issue7175] Define a standard location and API for configuration files

2015-09-01 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm of mixed opinion. I personally don't like cluttering up my $HOME with a jillion dotfiles so I appreciate the organization XDG_CONFIG_HOME offers. But that also makes things less discoverable. Looking in XDG_CONFIG_HOME first with a fallback to $HOME seems

[issue7175] Define a standard location and API for configuration files

2015-09-01 Thread R. David Murray
R. David Murray added the comment: That standard is just wrong, dotfiles belong in $HOME :) I'm only half joking, having grown up with Unix and having had the experience of flailing around for a while before I figured out a particular program's rc file was in .config instead of where I expect

[issue23406] interning and list comprehension leads to unexpected behavior

2015-09-01 Thread R. David Murray
R. David Murray added the comment: I agree that the table entry could be made more precise. I would suggest replacing the table entry with "equivalent to adding s to itself n times". This formulation serves to explain *why* the multiply operation works the way it does: >>> a = [1, []] >>> b

[issue24912] The type of cached objects is mutable

2015-09-01 Thread Guido van Rossum
Guido van Rossum added the comment: I don't want to own this, but this is absolutely a release blocker. I see three ways out: - Fix it right (if possible) -- "system immutable" types such as int should not allow __class__ assignment. Risk: there might be other cases (the code being patched is

[issue24912] The type of cached objects is mutable

2015-09-01 Thread Eugene Toder
Eugene Toder added the comment: Nathaniel, what if we allow creating module objects from an existing dict instead of always creating a new one. Does this solve your namespace diversion problem? FWIW, when I discovered this change I was quite surprised this came through without a PEP. I agree

[issue24979] Allow timezone offsets greater than 24 hours

2015-09-01 Thread TJ
New submission from TJ: The datetime module only supports timezone offsets within 24 hours of UTC: https://docs.python.org/3/library/datetime.html#datetime.tzinfo.utcoffset This seems like an arbitrary restriction, and prevents the library from being used in arbitrary timezone translations. Fo

[issue24965] Implement PEP 498: Literal String Formatting

2015-09-01 Thread Eric V. Smith
Eric V. Smith added the comment: Make sure f-strings are identified as literals in error messages. -- Added file: http://bugs.python.org/file40317/pep-498-2.diff ___ Python tracker _

[issue24974] ICC on Windows 8.1: _decimal fails to compile with default fp model

2015-09-01 Thread Facundo Batista
Changes by Facundo Batista : -- nosy: -facundobatista ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue22798] time.mktime doesn't update time.tzname

2015-09-01 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: BTW: The most portable way to access the timezone name of a given local time is to use strftime() with %Z as format character. -- ___ Python tracker __

[issue22798] time.mktime doesn't update time.tzname

2015-09-01 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: mktime() does change several global C runtime variables on Linux. See the man page on http://linux.die.net/man/3/mktime However, the Python documentation does not mention anything about having time.tzname being tied to the C lib global: https://docs.pytho

[issue24978] Contributing to Python 2x and 3x Documentation. Translation to Russian.

2015-09-01 Thread Eugene
New submission from Eugene: I am very much begging pardon if this is not the place to ask for, but.. I would like to make a thorough translation of the official Library Reference and the beginners guide to Python 2.x 3.x in Russian language. I am aware this type of translation will be placed a

[issue24974] ICC on Windows 8.1: _decimal fails to compile with default fp model

2015-09-01 Thread Stefan Krah
Stefan Krah added the comment: Steve: What do you mean by "global option"? The C99 standard says that FENV_ACCESS (if set), is active until the end of the translation unit (here: mpdecimal.c). -- ___ Python tracker

[issue24974] ICC on Windows 8.1: _decimal fails to compile with default fp model

2015-09-01 Thread Stefan Krah
Stefan Krah added the comment: On Linux ICC has something like "fast-math" by default. The situation is a bit annoying: On Unix ICC defines __GNUC__, but does not really have all the features. Here ICC defines _MSC_VER, but does not behave like cl.exe. [I know it's a hard problem to be fully co

[issue24965] Implement PEP 498: Literal String Formatting

2015-09-01 Thread Eric V. Smith
Eric V. Smith added the comment: Fixed validate_exprs bug. -- Added file: http://bugs.python.org/file40316/pep-498-1.diff ___ Python tracker ___ _

[issue24977] shutil copy to non-existant directory

2015-09-01 Thread Jake Howard
New submission from Jake Howard: If you try and copy a file using shutil.copy to a directory that doesnt exist, it tries to copy the file to the location of the directory, and errors as shutil can't open a directory for 'WB' access, throwing an error, that doesnt reflect the problem.

[issue24912] The type of cached objects is mutable

2015-09-01 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: FWIW: I still think that allowing to change .__class__ on instances of static types if wrong and should be undone. If we want to make this a feature of the language we should have a PEP and the associated discussion to be able to judge and document the pos

[issue24946] Tkinter tests that fail on linux in tiling window manager

2015-09-01 Thread Florian Bruhin
Changes by Florian Bruhin : -- nosy: -The-Compiler ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue24946] Tkinter tests that fail on linux in tiling window manager

2015-09-01 Thread Florian Bruhin
Florian Bruhin added the comment: At least with my WM, there is no concept of having floating windows when in tiling mode, so I don't think that would be possible. I also don't think there's a standard way to tell a window manager to not tile windows. What about opening a simple window with a

[issue24912] The type of cached objects is mutable

2015-09-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: > From where I sit this all looks like a massive > overreaction/misunderstanding: I introduced a bug, the cause is > obvious, and it's straightforward to fix. I agree with Nathaniel here. Let's just commit the fix instead of acting like irrational beings.

[issue24912] The type of cached objects is mutable

2015-09-01 Thread Nathaniel Smith
Nathaniel Smith added the comment: Thanks Raymond. Hi Guido. Sorry about the mess. My overview of the situation so far, and of the patch currently attached to this bug, is here (and a bit in the next post): https://bugs.python.org/issue24912#msg249438 >From where I sit this all looks like a

[issue24829] Use interactive input even if stdout is redirected

2015-09-01 Thread Adam Bartoš
Adam Bartoš added the comment: How about reconsidering in the case that the machinery around PyOS_Readline is rewritten as I suggest in #17620 ? -- ___ Python tracker ___ __

[issue24912] The type of cached objects is mutable

2015-09-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: Guido, do you have any thoughts on this? Several of us (me included) think http://hg.python.org/lookup/c0d25de5919e probably should not have been done. Mutating non-heap types crosses an implicit boundary that we've long resisted crossing because it opens

[issue24912] The type of cached objects is mutable

2015-09-01 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 01.09.2015 04:38, Nathaniel Smith wrote: > Mark Lemburg wrote: >> Python code will generally assume that it can trust >> builtin types. It doesn't expect 42 + 2 to clear out the root dir, >> just because some package installed from PyPI happens to feel in

[issue24934] django_v2 benchmark not working in Python 3.6

2015-09-01 Thread Florin Papa
Florin Papa added the comment: Please download Django from their github website: https://github.com/django/django I checked and their latest stable release - Django 1.8.4 - from https://pypi.python.org/pypi/Django still has the getargspec issue. Apparently the github version is 1.9.0 alpha. I

[issue24934] django_v2 benchmark not working in Python 3.6

2015-09-01 Thread Florin Papa
Changes by Florin Papa : Added file: http://bugs.python.org/file40315/Django-1.9.zip ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue7175] Define a standard location and API for configuration files

2015-09-01 Thread flying sheep
flying sheep added the comment: no, sorry, but ~/.python is wrong on linux. there exists a standard about where things belong: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html it says that configuration stuff belongs into `XDG_CONFIG_HOME`, with a fallback to `~/.config/

[issue24968] Python 3 raises Unicode errors with the xxx.UTF-8 locale

2015-09-01 Thread Roberto Sánchez
Roberto Sánchez added the comment: Ok, that makes sense, besides David pointed me about another opened issue that could help to solve cases like this: http://bugs.python.org/issue15216 If the encoding is wrong because the environment but we can change the initial stream encodings (in stdin/out

[issue24934] django_v2 benchmark not working in Python 3.6

2015-09-01 Thread Berker Peksag
Berker Peksag added the comment: I just downloaded Django-1.8.zip (florin.papa, 2015-08-27 11:49) and opened Django-1.8/django/__init__.py to check the Django version: VERSION = (1, 9, 0, 'alpha', 0) I think GitHub lets you download the master branch by default. I'd suggest to download th

[issue24966] shutil.get_terminal_size() throws ValueError if stdout is detached, no fallback

2015-09-01 Thread Roberto Sánchez
Roberto Sánchez added the comment: Yeah, sorry, actually I was thinking in the stdin/out section, the detach() doc itself is Ok, the problem comes when is called in stdin/out. -- ___ Python tracker ___