[issue28333] input() with Unicode prompt produces mojibake on Windows

2016-10-07 Thread Eryk Sun
Eryk Sun added the comment: I'm sure Steve already has this covered, but FWIW here's a patch to call WriteConsoleW. Here's the result with the patch applied: >>> sys.ps1 = '»»» ' »»» input("αβψδ: ") αβψδ: spam 'spam' and with interactive stdin and stdout/stderr redirected to a

Re: Doubled backslashes in Windows paths [Resolved]

2016-10-07 Thread BartC
On 07/10/2016 18:41, Oz-in-DFW wrote: On 10/7/2016 12:30 AM, Oz-in-DFW wrote: I'm using Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)] on Windows 7 I'm trying to write some file processing that looks at file size, extensions, and several other things and

[issue28388] Update documentation for typing module

2016-10-07 Thread Ivan Levkivskyi
New submission from Ivan Levkivskyi: Here is the patch with updates according to recent changes in typing module and PEP 484: - most things are not classes now - outcome of parameterizing generics is cached - Union does not unify everything with Any - few minor fixes This patch also fixes

Re: Question on multiple Python users in one application

2016-10-07 Thread Gregory Ewing
Dennis Lee Bieber wrote: normally the main file of a Python program is still the plain text, It doesn't have to be, though -- you can do 'python somefile.pyc' and it will happily run it. and imported modules are retrieved from the file system as (if found) PYC pre-compiled, otherwise the

Re: Question on multiple Python users in one application

2016-10-07 Thread Gregory Ewing
Dennis Lee Bieber wrote: What is it... A Burroughs mainframe running a version of FORTH? The Burroughs architecture is a stack architecture, so the machine code looks like a version of Forth in some ways. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

[issue28374] SyntaxError: invalid token in python2.7/test/test_grammar.py

2016-10-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: The absence of a space is intentional. See #21642. Fix applied 2014-06-07. Hence Berker's guesses. def test_float_exponent_tokenization(self): # See issue 21642. self.assertEqual(1 if 1else 0, 1) self.assertEqual(1 if 0else 0, 0)

[issue28333] input() with Unicode prompt produces mojibake on Windows

2016-10-07 Thread Eryk Sun
Eryk Sun added the comment: When I pointed this issue out in code reviews, I assumed you would add the relatively simple fix to decode the prompt and call WriteConsoleW. The long-term fix in issue 17620 has to be worked out with cross-platform support, and ISTM that it can wait for 3.7. Off

[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2016-10-07 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Since the quick fix is now applied, I think it should not be a release blocker any more. -- ___ Python tracker ___

[issue28100] Refactor error messages in symtable.c

2016-10-07 Thread Ivan Levkivskyi
Changes by Ivan Levkivskyi : -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue28367] Add more standard baud rate constants to "termios"

2016-10-07 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- stage: -> patch review versions: +Python 3.7 ___ Python tracker ___

[issue28352] winfo_pathname(..) | window id "xyz" doesn't exist in this application. | Python 3.4.4

2016-10-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: At least give a minimal but complete example that works in 3.4.1 but fails in 3.4.4. What you put in the title in not valid syntax. -- nosy: +serhiy.storchaka, terry.reedy ___ Python tracker

[issue28340] TextIOWrapper.tell extremely slow

2016-10-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: I suggest that you try backporting the patch to 2.7 and and/or ask on #4 whether there was a positive reason not to do so (and mention that you opened this issue to do so). -- nosy: +terry.reedy ___ Python

[issue28333] input() with Unicode prompt produces mojibake on Windows

2016-10-07 Thread Steve Dower
Steve Dower added the comment: This may force issue17620 into 3.6 - we really ought to be getting and using sys.stdin and sys.stderr in PyOS_StdioReadline() rather than going directly to the raw streams. The problem here is that we're still using fprintf to output the prompt, even though we

[issue28334] netrc does not work if $HOME is not set

2016-10-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: On Windows, HOME is both split into two variables and replaced by USERPROFILE. C:\Users\Terry>set HOME HOMEDRIVE=C: HOMEPATH=\Users\Terry C:\Users\Terry>set USERPROFILE USERPROFILE=C:\Users\Terry So if it make sense to run this on Windows*, I would call it a

[issue28333] input() with Unicode prompt produces mojibake on Windows

2016-10-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: This is a regression from 3.5.2, where input("α") displays "α". -- ___ Python tracker ___

[issue28326] multiprocessing.Process depends on sys.stdout being open

2016-10-07 Thread Tiago Antao
Tiago Antao added the comment: This is the first patch that I am submitting. More than willing to do any changes deemed necessary... -- ___ Python tracker

[issue28333] input() with Unicode prompt produces mojibake on Windows

2016-10-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: Same output with cp437. -- nosy: +terry.reedy ___ Python tracker ___ ___

[issue28331] "CPython implementation detail:" removed when content translated

2016-10-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: I abbreviated title to make most of it visible in listings. -- nosy: +terry.reedy title: "CPython implementation detail:" is removed when contents is translated -> "CPython implementation detail:" removed when content translated

[issue28326] multiprocessing.Process depends on sys.stdout being open

2016-10-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: Patch looks plausible to me. The flush calls definitely need to be guarded. -- nosy: +terry.reedy stage: -> patch review type: -> behavior ___ Python tracker

define variables in the txt file using python

2016-10-07 Thread Xristos Xristoou
hello i have one .txt file and i want to create python script with sys.argv or argparse or other package to define some variables in the txt file and i take some result. txt file maybe like this : input number 1= %var1% input number 2= %var2% result = %vresult(var1-var2)% how can i write

Re: Doubled backslashes in Windows paths [Resolved]

2016-10-07 Thread Oz-in-DFW
On 10/7/2016 12:30 AM, Oz-in-DFW wrote: > I'm using Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC > v.1900 32 bit (Intel)] on Windows 7 > > I'm trying to write some file processing that looks at file size, > extensions, and several other things and I'm having trouble getting a >

[issue21720] "TypeError: Item in ``from list'' not a string" message

2016-10-07 Thread Berker Peksag
Berker Peksag added the comment: Here's a patch to demonstrate what I meant in msg226047. Example from the REPL: >>> __import__('encodings', fromlist=[u'aliases']) Traceback (most recent call last): File "", line 1, in TypeError: Item in ``from list'' must be str, not unicode --

[issue28317] Improve support of FORMAT_VALUE in dis

2016-10-07 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka ___ Python tracker ___

[issue28379] PyUnicode_CopyCharacters could lead to undefined behaviour

2016-10-07 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka ___ Python tracker ___

[issue25783] test_traceback.test_walk_stack() fails when run directly (without regrtest)

2016-10-07 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.5, Python 3.7 ___ Python tracker

[issue25783] test_traceback.test_walk_stack() fails when run directly (without regrtest)

2016-10-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8d150de9edba by Serhiy Storchaka in branch '3.5': Issue #25783: Fixed test_traceback when run directly (without regrtest). https://hg.python.org/cpython/rev/8d150de9edba New changeset 4646b64139c9 by Serhiy Storchaka in branch '3.6': Issue #25783:

[issue24098] Multiple use after frees in obj2ast_* methods

2016-10-07 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue25783] test_traceback.test_walk_stack() fails when run directly (without regrtest)

2016-10-07 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka ___ Python tracker ___

[issue28257] Regression for star argument parameter error messages

2016-10-07 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.6, Python 3.7 ___ Python tracker

[issue28257] Regression for star argument parameter error messages

2016-10-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 35676cd72352 by Serhiy Storchaka in branch '3.5': Issue #28257: Improved error message when pass a non-mapping as a var-keyword https://hg.python.org/cpython/rev/35676cd72352 -- ___ Python tracker

Re: xml parsing with lxml

2016-10-07 Thread Doug OLeary
On Friday, October 7, 2016 at 3:21:43 PM UTC-5, John Gordon wrote: > root = doc.getroot() > for child in root: > print(child.tag) > Excellent! thank, you sir! that'll get me started. Appreciate the reply. Doug O'Leary -- https://mail.python.org/mailman/listinfo/python-list

[issue18287] PyType_Ready() should sanity-check the tp_name field

2016-10-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5c459b0f2b75 by Serhiy Storchaka in branch '3.5': Issue #18287: PyType_Ready() now checks that tp_name is not NULL. https://hg.python.org/cpython/rev/5c459b0f2b75 New changeset ba76dd106e66 by Serhiy Storchaka in branch '2.7': Issue #18287:

[issue18287] PyType_Ready() should sanity-check the tp_name field

2016-10-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Niklas for your report and patch. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

Re: xml parsing with lxml

2016-10-07 Thread John Gordon
In <622ea3b0-88b4-420b-89e0-9e7c6e866...@googlegroups.com> Doug OLeary writes: > >>> from lxml import etree > >>> doc =3D etree.parse('config.xml') > Now what? For instance, how do I list the top level children of > ? root = doc.getroot() for child in root:

Re: BeautifulSoup help !!

2016-10-07 Thread Navneet Siddhant
i was able to almost get the results i require but only half of the info is showing up. i.e suppose there are 20 coupons showing on the page but when i print them using the container they are in only 5 are printed on the screen. Also figured out how to write to csv file , but even here only 1

[issue28387] double free in io.TextIOWrapper

2016-10-07 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- components: +IO nosy: +benjamin.peterson, serhiy.storchaka, stutzbach priority: normal -> high stage: -> patch review ___ Python tracker

[issue26293] Embedded zipfile fields dependent on absolute position

2016-10-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your report and testing. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.7 ___ Python tracker

[issue26293] Embedded zipfile fields dependent on absolute position

2016-10-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 9a99a88301ef by Serhiy Storchaka in branch '2.7': Issue #26293: Fixed writing ZIP files that starts not from the start of the https://hg.python.org/cpython/rev/9a99a88301ef -- ___ Python tracker

xml parsing with lxml

2016-10-07 Thread Doug OLeary
Hey; I'm trying to gather information from a number of weblogic configuration xml files using lxml. I've found any number of tutorials on the web but they all seem to assume a knowledge that I apparently don't have... that, or I'm just being rock stupid today - that's distinct possibility

[issue28387] double free in io.TextIOWrapper

2016-10-07 Thread Sebastian Cufre
Changes by Sebastian Cufre : -- keywords: +patch Added file: http://bugs.python.org/file45005/textio.c.patch ___ Python tracker ___

[issue28387] double free in io.TextIOWrapper

2016-10-07 Thread Sebastian Cufre
New submission from Sebastian Cufre: We have found that you can produce a crash when an instance of _io.TextIOWrapper is being deallocated while there's another thread invoking the garbage collector. I've attached a simple script that should reproduce the issue (textiowrapper_crash.py)

[issue26293] Embedded zipfile fields dependent on absolute position

2016-10-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 005704f5634f by Serhiy Storchaka in branch '3.5': Issue #26293: Fixed writing ZIP files that starts not from the start of the https://hg.python.org/cpython/rev/005704f5634f New changeset b06e75ae1981 by Serhiy Storchaka in branch '3.6': Issue

Re: Passing Variable to Function

2016-10-07 Thread John McKenzie
Brendan and Alister, thank you both for responding. I am very inexperienced with python, but not new to computers so on my own I realized the strings vs number mistake. (I seem to work with and learn about Python for a few weeks at a time with 6 to 12 months in between. Need to change that

[issue24098] Multiple use after frees in obj2ast_* methods

2016-10-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 47d5bf5a846f by Serhiy Storchaka in branch '2.7': Issue #24098: Fixed possible crash when AST is changed in process of https://hg.python.org/cpython/rev/47d5bf5a846f New changeset f575710b5f56 by Serhiy Storchaka in branch '3.5': Issue #24098:

[issue28385] Bytes objects should reject all formatting codes with an error message

2016-10-07 Thread Марк Коренберг
Марк Коренберг added the comment: Yes, that message will be sufficient. Perfectly. -- ___ Python tracker ___

[issue28384] hmac cannot be used with shake algorithms

2016-10-07 Thread SilentGhost
Changes by SilentGhost : -- components: +Extension Modules nosy: +christian.heimes type: -> behavior ___ Python tracker ___

[issue28378] urllib2 does not handle cookies with `,`

2016-10-07 Thread SilentGhost
SilentGhost added the comment: Could you please post an example of what you're being sent from the server and how your code handles / fails to deal with it. -- nosy: +SilentGhost stage: -> test needed versions: +Python 2.7 ___ Python tracker

Re: default argument value is mutable

2016-10-07 Thread Marko Rauhamaa
"D'Arcy J.M. Cain" : > On Fri, 07 Oct 2016 16:09:19 +0200 > jmp wrote: >> What about >> >> def test(): >>if not hasattr(test, '_store'): test._store={'x':0} >>test._store['x'] += 1 > > Why is everyone working so hard to avoid creating a class?

[issue28386] Improve documentation about tzinfo.dst(None)

2016-10-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: None is passed to tzinfo.dst() when it is called from time.dst() method. This is documented in the relevant section: . I am not sure whether if it is worth repeating in the abstract

Re: bugreport os.path.dirname and os.path.basename

2016-10-07 Thread Chris Angelico
On Sat, Oct 8, 2016 at 4:34 AM, h2m2 wrote: > os.path.dirname('G:\Programmierung\Python\Portugal > Training\Python-for-Algorithms--Data-Structures--and--Life\Algorithm > Analysis and Big O\testFile.ipynb') > > result and bug is: > 'G:\\Programmierung\\Python\\Portugal >

bugreport os.path.dirname and os.path.basename

2016-10-07 Thread h2m2
in the meantime, I am subscribed and confirmed - the bug below as requested - Original message - From: h2m2 To: python-list@python.org Subject: bugreport os.path.dirname and os.path.basename Date: Wed, 05 Oct 2016 16:49:17 +0200 bug:

[issue28386] Improve documentation about tzinfo.dst(None)

2016-10-07 Thread R. David Murray
Changes by R. David Murray : -- nosy: +belopolsky ___ Python tracker ___ ___

[issue28377] struct.unpack of Bool

2016-10-07 Thread Berker Peksag
Changes by Berker Peksag : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> struct.unpack('?', '\x02') returns (False,) on Mac OSX ___ Python tracker

Re: segfault using shutil.make_archive

2016-10-07 Thread Michael Torrie
On 10/06/2016 10:46 AM, Tim wrote: > I need to zip up a directory that's about 400mb. > I'm using shutil.make_archive and I'm getting this response: > > Segmentation fault: 11 (core dumped) > > The code is straightforward (and works on other, smaller dirs): > >

[issue24452] Make webbrowser support Chrome on Mac OS X

2016-10-07 Thread Senthil Kumaran
Senthil Kumaran added the comment: The patch looks good to me. (The test coverage for chrome browser can be improved. But that seems a like a different change than the current one). -- assignee: -> orsenthil nosy: +orsenthil versions: +Python 3.7 -Python 3.4, Python 3.5

Re: BeautifulSoup help !!

2016-10-07 Thread Pierre-Alain Dorange
Navneet Siddhant wrote: > I guess I will have to extract data from multiple divs as only extracting > data from the parent div which has other divs in it with the different > data is coming up all messed up. Will play around and see if I could get > through it. Let me

Re: Doubled backslashes in Windows paths

2016-10-07 Thread BartC
On 07/10/2016 13:39, BartC wrote: On 07/10/2016 06:30, Oz-in-DFW wrote: I'm getting an error message on an os.path.getsize call; But the main error appears to be due to the presence of quotes, whether at each end, or inside the path, enclosing an element with spaces for example. Try using

Re: segfault using shutil.make_archive

2016-10-07 Thread Tim
On Friday, October 7, 2016 at 5:18:11 AM UTC-4, Chris Angelico wrote: > On Fri, Oct 7, 2016 at 5:24 PM, dieter wrote: > > Memory allocations are frequent (in many places) and they fail rarely. > > Therefore, there is quite a high probability that some of those > > allocations fail to check that

[issue28386] Improve documentation about tzinfo.dst(None)

2016-10-07 Thread Daniel Moisset
New submission from Daniel Moisset: The datetime module documentation[1] describes the tzinfo.dst method with a single "dt" argument without being too explicit about possible values for it. The implication is that dt should be a datetime object, but the implementation of time.dst() [2]

[issue21720] "TypeError: Item in ``from list'' not a string" message

2016-10-07 Thread Berker Peksag
Berker Peksag added the comment: I think we can classify this one as a usability bug and improve the exception message. -- nosy: +ncoghlan ___ Python tracker

[issue28383] __hash__ documentation recommends naive XOR to combine but this is suboptimal

2016-10-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: This makes sense. Note that this is the way hashes are implemented for the datetime objects: . -- nosy: +belopolsky ___ Python tracker

[issue28315] incorrect "in ?" output in 'divide' example at "Defining Clean-up Actions" in tutorial

2016-10-07 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Hi Jaysinh, I reviewed your changes, they look good to me. I can't approve it, so it would still be good for a core dev here to take another pass. Thanks :) -- ___ Python tracker

[issue21720] "TypeError: Item in ``from list'' not a string" message

2016-10-07 Thread Tim Graham
Tim Graham added the comment: As far as I can tell, this isn't an issue on Python 3. Can this be closed since Python 2 is only receiving bug fixes now? -- nosy: +Tim.Graham ___ Python tracker

[issue28383] __hash__ documentation recommends naive XOR to combine but this is suboptimal

2016-10-07 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +eric.araujo ___ Python tracker ___ ___ Python-bugs-list

Re: default argument value is mutable

2016-10-07 Thread ast
"jmp" a écrit dans le message de news:mailman.213.1475849391.30834.python-l...@python.org... On 10/07/2016 03:45 PM, ast wrote: "jmp" a écrit dans le message de news:mailman.210.1475844513.30834.python-l...@python.org... On 10/07/2016 02:07

[issue28128] Improve the warning message for invalid escape sequences

2016-10-07 Thread Eric V. Smith
Eric V. Smith added the comment: Sorry for not responding earlier. It's unlikely I'll have time for this before beta 2, although I can probably get to it after that and before beta 3. Don't let me stop someone else from improving on the patch. --

[issue28385] Bytes objects should reject all formatting codes with an error message

2016-10-07 Thread Eric V. Smith
Eric V. Smith added the comment: Yes, I think we should implement this for object.__format__. Marking as easy. -- components: +Interpreter Core -Library (Lib) keywords: +easy (C) ___ Python tracker

[issue28385] Bytes objects should reject all formatting codes with an error message

2016-10-07 Thread R. David Murray
R. David Murray added the comment: Bytes don't support formatting codes, so they are passed through to object, which doesn't support any formatting codes, and produces the error message you see. Since all other built in types reject invalid codes with a message that mentions their type, I

[issue25720] Fix curses module compilation with ncurses6

2016-10-07 Thread Chi Hsuan Yen
Chi Hsuan Yen added the comment: Thanks masamoto! There's another minor issue about this patch: if there's no curses.h (ncurses built with --without-curses-h), the detection always fails. -- ___ Python tracker

[issue26906] format(object.__reduce__) fails intermittently

2016-10-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yet one demonstration of this bug: $ ./python -IS >>> import operator >>> operator.length_hint(iter("abc")) 0 >>> import collections.abc >>> operator.length_hint(iter("abc")) 3 -- ___ Python tracker

[issue27972] Confusing error during cyclic yield

2016-10-07 Thread Guido van Rossum
Guido van Rossum added the comment: I've meditated on this and I've changed my mind. A task that awaits itself is so obviously not following the task protocol that it should be shot on sight. No exceptions. (Only the task itself should ever set the result or exception, and *only* by returning or

[issue25720] Fix curses module compilation with ncurses6

2016-10-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Added a comment on Rietveld. -- ___ Python tracker ___ ___

[issue28385] Non-informative exception while formatting strings.

2016-10-07 Thread Марк Коренберг
New submission from Марк Коренберг: $ python3 -c "'{0:s}'.format(b'qwe')" Traceback (most recent call last): File "", line 1, in TypeError: non-empty format string passed to object.__format__ Spent many hours to detect bug in my code. -- components: Library (Lib) messages: 278244

Re: default argument value is mutable

2016-10-07 Thread D'Arcy J.M. Cain
On Fri, 07 Oct 2016 16:09:19 +0200 jmp wrote: > What about > > def test(): >if not hasattr(test, '_store'): test._store={'x':0} >test._store['x'] += 1 Why is everyone working so hard to avoid creating a class? -- D'Arcy J.M. Cain System Administrator, Vex.Net

Re: default argument value is mutable

2016-10-07 Thread jmp
On 10/07/2016 03:45 PM, ast wrote: "jmp" a écrit dans le message de news:mailman.210.1475844513.30834.python-l...@python.org... On 10/07/2016 02:07 PM, ast wrote: "jmp" a écrit dans le message de

[issue26081] Implement asyncio Future in C to improve performance

2016-10-07 Thread INADA Naoki
INADA Naoki added the comment: fastfuture3-wip.patch is work in progress implementation of implementing __repr__ and __del__ in C. I post it to avoid duplicated works. Known TODOs: * Support overriding Future._repr_info() * Fix __del__ is not called (Research how tp_del, tp_finalize, and

Re: Doubled backslashes in Windows paths

2016-10-07 Thread eryk sun
On Fri, Oct 7, 2016 at 10:46 AM, Steve D'Aprano wrote: > That's because > > "C: > > is an illegal volume label (disk name? I'm not really a Windows user, and > I'm not quite sure what the correct terminology here would be). It's not an illegal device name, per se.

Re: Doubled backslashes in Windows paths

2016-10-07 Thread Ned Batchelder
On Friday, October 7, 2016 at 8:39:55 AM UTC-4, BartC wrote: > On 07/10/2016 06:30, Oz-in-DFW wrote: > > I'm using Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC > > v.1900 32 bit (Intel)] on Windows 7 > > > > I'm trying to write some file processing that looks at file size, > >

Re: default argument value is mutable

2016-10-07 Thread ast
"jmp" a écrit dans le message de news:mailman.210.1475844513.30834.python-l...@python.org... On 10/07/2016 02:07 PM, ast wrote: "jmp" a écrit dans le message de news:mailman.209.1475841371.30834.python-l...@python.org... On 10/07/2016 01:38

[issue25720] Fix curses module compilation with ncurses6

2016-10-07 Thread Ismail Donmez
Ismail Donmez added the comment: @masamoto thank you! -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue25720] Fix curses module compilation with ncurses6

2016-10-07 Thread Masayuki Yamamoto
Masayuki Yamamoto added the comment: I updated the patch that add configuration check for is_pad. the is_pad is wrapped into py_is_pad at Modules/_cursesmodule.c:932 by either of three ways. Case one -- is_pad is found: Define the macro that is simple wrapping. Case two -- is_pad is not found,

Re: default argument value is mutable

2016-10-07 Thread Steve D'Aprano
On Fri, 7 Oct 2016 11:48 pm, jmp wrote: > On 10/07/2016 02:07 PM, ast wrote: >> It can be used to store some variables from one call of >> a function to an other one. >> >> def test( _store={'x':0}): >> >> x = _store['x'] >> . do some stuff >>_store['x'] = x > > For personal

Re: default argument value is mutable

2016-10-07 Thread Steve D'Aprano
On Fri, 7 Oct 2016 10:38 pm, Daiyue Weng wrote: > Hi, I declare two parameters for a function with default values [], > > def one_function(arg, arg1=[], arg2=[]): > > PyCharm warns me: > > Default argument value is mutable, > > what does it mean? and how to fix it? The usual way to avoid

[issue28384] hmac cannot be used with shake algorithms

2016-10-07 Thread Thomas Kluyver
Changes by Thomas Kluyver : -- nosy: +takluyver ___ Python tracker ___ ___

[issue28379] PyUnicode_CopyCharacters could lead to undefined behaviour

2016-10-07 Thread Xiang Zhang
Xiang Zhang added the comment: v2 applies Serhiy's suggestions. -- Added file: http://bugs.python.org/file45001/PyUnicode_CopyCharacters_v2.patch ___ Python tracker

[issue28378] urllib2 does not handle cookies with `,`

2016-10-07 Thread Grzegorz Sikorski
Grzegorz Sikorski added the comment: It looks urllib2 works with this scenario, but upper level request fails. -- ___ Python tracker ___

Re: Doubled backslashes in Windows paths

2016-10-07 Thread eryk sun
On Fri, Oct 7, 2016 at 9:27 AM, Peter Otten <__pete...@web.de> wrote: > To fix the problem either use forward slashes (which are understood by > Windows, too) Using forward slash in place of backslash is generally fine, but you need to be aware of common exceptions, such as the following: (1)

Re: default argument value is mutable

2016-10-07 Thread jmp
On 10/07/2016 02:07 PM, ast wrote: "jmp" a écrit dans le message de news:mailman.209.1475841371.30834.python-l...@python.org... On 10/07/2016 01:38 PM, Daiyue Weng wrote: So the rule of thumb for default argument value is "No mutable" Cheers, It can be used to

Re: Doubled backslashes in Windows paths

2016-10-07 Thread BartC
On 07/10/2016 06:30, Oz-in-DFW wrote: I'm using Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)] on Windows 7 I'm trying to write some file processing that looks at file size, extensions, and several other things and I'm having trouble getting a reliably

[issue28376] rangeiter_new fails when creating a range of step 0

2016-10-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: And merged in a6eb6acfe04a. -- ___ Python tracker ___ ___

[issue28376] rangeiter_new fails when creating a range of step 0

2016-10-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: rangeiter_new() was added in r55167. -- ___ Python tracker ___ ___

[issue28377] struct.unpack of Bool

2016-10-07 Thread Meador Inge
Meador Inge added the comment: Looks like a dup to me. -- nosy: +meador.inge ___ Python tracker ___ ___

Re: default argument value is mutable

2016-10-07 Thread ast
"jmp" a écrit dans le message de news:mailman.209.1475841371.30834.python-l...@python.org... On 10/07/2016 01:38 PM, Daiyue Weng wrote: So the rule of thumb for default argument value is "No mutable" Cheers, It can be used to store some variables from one call

Re: default argument value is mutable

2016-10-07 Thread ast
"Daiyue Weng" a écrit dans le message de news:mailman.208.1475840291.30834.python-l...@python.org... Hi, I declare two parameters for a function with default values [], def one_function(arg, arg1=[], arg2=[]): PyCharm warns me: Default argument value is mutable, what

Re: default argument value is mutable

2016-10-07 Thread jmp
On 10/07/2016 01:38 PM, Daiyue Weng wrote: Hi, I declare two parameters for a function with default values [], def one_function(arg, arg1=[], arg2=[]): PyCharm warns me: Default argument value is mutable, what does it mean? and how to fix it? cheers You'll run into this bug def

[issue28384] hmac cannot be used with shake algorithms

2016-10-07 Thread Min RK
New submission from Min RK: HMAC digest methods call inner.digest() with no arguments, but new-in-3.6 shake algorithms require a length argument. possible solutions: 1. add optional length argument to HMAC.[hex]digest, and pass through to inner hash object 2. set hmac.digest_size, and use

[issue28376] rangeiter_new fails when creating a range of step 0

2016-10-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Raising a DeprecationWarning in 3.6 doesn't hurt. -- ___ Python tracker ___

default argument value is mutable

2016-10-07 Thread Daiyue Weng
Hi, I declare two parameters for a function with default values [], def one_function(arg, arg1=[], arg2=[]): PyCharm warns me: Default argument value is mutable, what does it mean? and how to fix it? cheers -- https://mail.python.org/mailman/listinfo/python-list

Re: Doubled backslashes in Windows paths

2016-10-07 Thread Steve D'Aprano
On Fri, 7 Oct 2016 04:30 pm, Oz-in-DFW wrote: > I'm using Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC > v.1900 32 bit (Intel)] on Windows 7 > > I'm trying to write some file processing that looks at file size, > extensions, and several other things and I'm having trouble

Re: Doubled backslashes in Windows paths

2016-10-07 Thread Peter Otten
Oz-in-DFW wrote: > I'm using Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC > v.1900 32 bit (Intel)] on Windows 7 > > I'm trying to write some file processing that looks at file size, > extensions, and several other things and I'm having trouble getting a > reliably usable path

  1   2   >