[issue12837] Patch for issue #12810 removed a valid check on socket ancillary data

2013-12-13 Thread Brett Cannon
Brett Cannon added the comment: Two things. First, I'm sorry David but my mind is not working fully enough at the moment to see how msg_controllen is compared to cmsg_len_end without relying on external value coming in through the parameters of the function. Second, I have re-uploaded my patch

[issue19977] Use "surrogateescape" error handler for sys.stdin and sys.stdout on UNIX for the C locale

2013-12-13 Thread Sworddragon
Sworddragon added the comment: What would happen if we call this example script with LANG=C on the patch?: --- import os for name in sorted(os.listdir('ä')): print(name) --- Would it throw an exception on os.listdir('ä')? -- ___ Python track

[issue19977] Use "surrogateescape" error handler for sys.stdin and sys.stdout on UNIX for the C locale

2013-12-13 Thread STINNER Victor
STINNER Victor added the comment: test_ls.py: test script producing invalid filenames and then trying to display them into stdout. Output with UTF-8 locale, UTF-8 terminal and Python 3.3 (or unpatched 3.4, it's the same): ascii.txt utf8:é€.txt Output with C locale (ASCII), UTF-8 terminal a

[issue19977] Use "surrogateescape" error handler for sys.stdin and sys.stdout on UNIX for the C locale

2013-12-13 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- versions: +Python 3.5 -Python 3.4 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue19977] Use "surrogateescape" error handler for sys.stdin and sys.stdout on UNIX for the C locale

2013-12-13 Thread STINNER Victor
STINNER Victor added the comment: os.fsencode(text) always fail if text cannot be encoded to sys.getfilesystemencoding(). surrogateescape doesn't help here. Your example is "artificial", you should not get 'ä'. All OS data is decoded from the filesystem encoding using the surrogateescape error

[issue19977] Use "surrogateescape" error handler for sys.stdin and sys.stdout on UNIX for the C locale

2013-12-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: > When LANG=C is used to get the english language (which is a mistake, > LC_CTYPE=C should be used instead) I think you mean LC_MESSAGES=C here. (but it's not only about the English language; it's also about other locale parameters such as number formatting) I

[issue19562] Added description for assert statement

2013-12-13 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am going to reject this. Assert failures should never be seen by users and for a developer "assert 1 <= month <= 12" is as clear as "month must be in 1..12." -- nosy: +belopolsky resolution: -> wont fix stage: -> committed/rejected status: o

[issue18036] "How do I create a .pyc file?" FAQ entry is out of date

2013-12-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset a14f830196ec by R David Murray in branch '3.3': #18036: update .pyc FAQ entry in light of PEP 3147. http://hg.python.org/cpython/rev/a14f830196ec New changeset a757bdfce6b3 by R David Murray in branch 'default': Merge: #18036: update .pyc FAQ entry

[issue19946] Have multiprocessing raise ImportError when spawning a process that can't find the "main" module

2013-12-13 Thread Brett Cannon
Brett Cannon added the comment: Multiple questions from Oliver to answer. > Why has this issue been closed? Because the decided issue of this bug -- raising AttributeError over ImportError -- was fixed. > Won't the spawn and forkserver mode work in Python 3.4 for Python program > started by

[issue19562] Added description for assert statement

2013-12-13 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: @terry - datetime.py was originally written as a prototype for the C code and many seemingly unpythonic constructs therein are motivated by the desire to ease the translation to C. I would not mind simplifying _DI4Y calculation as you suggest, but please

[issue19946] Have multiprocessing raise ImportError when spawning a process that can't find the "main" module

2013-12-13 Thread Olivier Grisel
Olivier Grisel added the comment: > The semantics are not going to change in python 3.4 and will just stay as > they were in Python 3.3. Well the semantics do change: in Python 3.3 the spawn and forkserver modes did not exist at all. The "spawn" mode existed but only implicitly and only under

[issue18036] "How do I create a .pyc file?" FAQ entry is out of date

2013-12-13 Thread R. David Murray
R. David Murray added the comment: Thanks, A Kaptur and Phil. I used Phil's patch, and added some additional tweaks and words. (For example, I don't think PYTHONDONTWRITEBYTECODE existed when the FAQ entry was last updated). I've chosen to maintain the existing flow, since it matches the tit

[issue19968] Using DESTDIR breaks sys.path

2013-12-13 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +eric.araujo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue19977] Use "surrogateescape" error handler for sys.stdin and sys.stdout on UNIX for the C locale

2013-12-13 Thread R. David Murray
R. David Murray added the comment: Reintroducing moji-bake intentionally doesn't sound like a particularly good idea, wasn't that what python3 was supposed to help prevent? It does seem like a utf-8 default is the Way of the Future. Or even the present, most places. -- _

[issue19298] Use __attribute__(cleanup ...) to detect refleaks

2013-12-13 Thread Stefan Krah
Changes by Stefan Krah : -- nosy: +skrah ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.or

[issue19946] Have multiprocessing raise ImportError when spawning a process that can't find the "main" module

2013-12-13 Thread Brett Cannon
Brett Cannon added the comment: I'm sorry, Oliver, you are simply going to have to wait for Python 3.5 at this point to get the new semantics you want. -- ___ Python tracker ___

[issue12837] Patch for issue #12810 removed a valid check on socket ancillary data

2013-12-13 Thread Brett Cannon
Brett Cannon added the comment: Christian Heimes pointed out #ifdef __clang__ might be necessary to silence warnings on other platforms. -- ___ Python tracker ___ __

[issue19946] Have multiprocessing raise ImportError when spawning a process that can't find the "main" module

2013-12-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I'm sorry, Oliver, you are simply going to have to wait for Python 3.5 > at this point to get the new semantics you want. Side note: it's Olivier, not Oliver. -- ___ Python tracker

[issue19968] Using DESTDIR breaks sys.path

2013-12-13 Thread Quanah Gibson-Mount
Quanah Gibson-Mount added the comment: Ok, so the general idea is to be able to install your software in a specific location and then symlink it back into another location (like /usr/local). This allows quick and easy software version swapping. I've used it to do things like test mariadb vs

[issue19963] Update docs for importlib.import_module()

2013-12-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset a44be62026fc by Brett Cannon in branch '3.3': Issue #19963: Document that importlib.import_module() will import http://hg.python.org/cpython/rev/a44be62026fc New changeset 33938321d46f by Brett Cannon in branch 'default': merge for issue #19963 http

[issue19963] Update docs for importlib.import_module()

2013-12-13 Thread Brett Cannon
Changes by Brett Cannon : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue19946] Have multiprocessing raise ImportError when spawning a process that can't find the "main" module

2013-12-13 Thread Olivier Grisel
Olivier Grisel added the comment: I can wait (or monkey-patch the stuff I need as a temporary workaround in my code). My worry is that Python 3.4 will introduce a new feature that is very crash-prone. Take this simple program that uses the newly introduced `get_context` function (the same pro

[issue19968] Python does not play well with 'stow'.

2013-12-13 Thread R. David Murray
R. David Murray added the comment: Since it appears to be a perl based, it is not too surprising it works well with perl :) A little googling turns up someone suggesting that the logic for finding things be changed slightly, such that if the binary is itself a symbolic link, it will look in t

[issue19946] Have multiprocessing raise ImportError when spawning a process that can't find the "main" module

2013-12-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Let's reopen, shall we? If not for 3.4, at least for 3.5. It's likely that multiprocessing needs a __main__ simply because it needs a way to replicate the parent process' state in the child (for example, the set of imported modules, the logging configuration,

[issue19946] Have multiprocessing raise ImportError when spawning a process that can't find the "main" module

2013-12-13 Thread Olivier Grisel
Olivier Grisel added the comment: For Python 3.4: Maybe rather than raising ImportError, we could issue warning to notify the users that names from the __main__ namespace could not be loaded and make the init_module_attrs return early. This way a multiprocessing program that only calls functi

[issue19977] Use "surrogateescape" error handler for sys.stdin and sys.stdout on UNIX for the C locale

2013-12-13 Thread Toshio Kuratomi
Toshio Kuratomi added the comment: My impression was that python3 was supposed to help get rid of UnicodeError tracebacks, not mojibake. If mojibake was the problem then we should never have gone down the surrogateescape path for input. -- ___ Pyth

[issue19968] Python does not play well with 'stow'.

2013-12-13 Thread Quanah Gibson-Mount
Quanah Gibson-Mount added the comment: Thank you very much for looking at it. :) Since I can work around it easily enough, I'm set for now, but it would be great to see Python play nicely with stow in a future release. -- ___ Python tracker

[issue19701] Update multiprocessing for PEP 451

2013-12-13 Thread Brett Cannon
Brett Cannon added the comment: I think this is as fixed as it's going to be until Python 3.5 and the code is updated to use runpy (see http://bugs.python.org/issue19978). -- dependencies: -refactor pythonrun.c to make use of specs (__main__.__spec__) resolution: -> fixed status: open

[issue19978] Update multiprocessing.spawn to use runpy.run_path

2013-12-13 Thread Brett Cannon
Changes by Brett Cannon : -- dependencies: +refactor pythonrun.c to make use of specs (__main__.__spec__) ___ Python tracker ___ ___ P

[issue19705] Update test.test_namespace_pkgs to PEP 451

2013-12-13 Thread Brett Cannon
New submission from Brett Cannon: There is nothing to update; the tests work through the import statement directly. -- dependencies: -Merge all (non-syntactic) import-related tests into test_importlib resolution: -> invalid status: open -> closed

[issue19972] Leak in pickle (?)

2013-12-13 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: The patch is good. I am not sure if you need the freefunc cast though. The example in the PEP 3121 should updated if freefunc is actually required. I didn't define freefunc because of this example. -- ___ Pyth

[issue19562] Added description for assert statement

2013-12-13 Thread Terry J. Reedy
Terry J. Reedy added the comment: Thank you for the explanation. If the style comment is not in the file already, you might add it whenever you next edit the file for substantive purposes (a real bug or feature change). Ditto for _DI4Y. -- ___ Pytho

[issue19977] Use "surrogateescape" error handler for sys.stdin and sys.stdout on UNIX for the C locale

2013-12-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Mojibake in input can cause decoding error in other application which consumes output of Python script. In some cases this can be even worse thin UnicodeError in producer. But for C locale this makes sense. I think we should try this experiment in 3.5. Ther

[issue19979] Missing nested scope vars in class scope (bis)

2013-12-13 Thread Armin Rigo
New submission from Armin Rigo: This is a repeat of the old issue 532860: "NameError assigning to class in a func". It is about class statements' variable lookups, which has different behavior at module level or in a nested scope: def f(n): class A: n = n # doesn't work, tries

[issue19974] tarfile doesn't overwrite symlink by directory

2013-12-13 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +serhiy.storchaka versions: +Python 3.4 ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue19704] Update test.test_threaded_import to PEP 451

2013-12-13 Thread Roundup Robot
New submission from Roundup Robot: New changeset dbb9c23e1887 by Brett Cannon in branch 'default': Issue #19704: Port test.test_threaded_import to PEP 451 http://hg.python.org/cpython/rev/dbb9c23e1887 -- nosy: +python-dev ___ Python tracker

[issue19704] Update test.test_threaded_import to PEP 451

2013-12-13 Thread Brett Cannon
Changes by Brett Cannon : -- dependencies: -Merge all (non-syntactic) import-related tests into test_importlib resolution: -> fixed status: open -> closed ___ Python tracker _

[issue19385] dbm.dumb should be consistent when the database is closed

2013-12-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Now this seems odd, maybe catching + reraising an exception has a greater > overhead than a func call and checking if an attribute is None. Yes, of course, catching + reraising an exception is costly. But when an exception is not raised, this is cheap. Usu

[issue4130] Intel icc 9.1 does not support __int128_t used by ctypes

2013-12-13 Thread Stefan Krah
Stefan Krah added the comment: Our included libffi is: 2013-03-17 Anthony Green * README: Update for 3.0.13. * configure.ac: Ditto. * configure: Rebuilt. * doc/*: Update version. According to https://sourceware.org/libffi/ that is the latest released version

[issue19972] Leak in pickle (?)

2013-12-13 Thread Stefan Krah
Stefan Krah added the comment: I just see that it should be: static void pickle_free(PyObject *m) ... Even then, the cast is necessary, otherwise you get this warning: /home/stefan/hg/cpython/Modules/_pickle.c:7450:1: warning: initialization from incompatible pointer type [enabled by default

[issue19975] Remove unused imports from webbrowser

2013-12-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset f2c6b0485ce6 by R David Murray in branch 'default': #19975: remove unused imports from webbrowser module. http://hg.python.org/cpython/rev/f2c6b0485ce6 -- nosy: +python-dev ___ Python tracker

[issue19975] Remove unused imports from webbrowser

2013-12-13 Thread R. David Murray
R. David Murray added the comment: Thanks, Claudiu. -- nosy: +r.david.murray resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker ___ ___

[issue17088] ElementTree incorrectly refuses to write attributes without namespaces when default_namespace is used

2013-12-13 Thread Wim
Wim added the comment: Here's an improved patch (and improved testcase). It's a little more intrusive than the last patch because when a default namespace is being used, two distinct qname caches must be made. -- Added file: http://bugs.python.org/file33125/bug17088_2.patch __

[issue19980] Improve help('non-topic') response

2013-12-13 Thread Terry J. Reedy
New submission from Terry J. Reedy: >>> help(1) # help on int >>> help(b'a') # help on bytes >>> help('a') no Python documentation found for 'a' The reason for this unhelpful response is that strings are treated differently from all other non-class objects. (msg205861 thought this a bug.) The s

[issue18918] help('FILES') finds no documentation

2013-12-13 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- nosy: +terry.reedy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue19914] help([object]) returns "Not enough memory." on standard Python types, object and object functions

2013-12-13 Thread Terry J. Reedy
Terry J. Reedy added the comment: cp65001 fails in many ways quite independent of Python. Idle: >>> "ሴé€㑖Ѓ⌴*" 'ሴé€㑖Ѓ⌴*' Pasting the same string into Command Prompt (Win 7, USA, updated): C:\Users\Terry>echo "?‚*" "?‚*" C:\Users\Terry>chcp 65001 Active code page: 65001 C:\Users\Terry>ech

[issue19980] Improve help('non-topic') response

2013-12-13 Thread Mark Lawrence
Mark Lawrence added the comment: IMHO this must be changed. >>> help('') # nothing!!! >>> help('a') Help on module a: ... I happened to have a module called a.py in the default directory. -- nosy: +BreamoreBoy ___ Python tracker

[issue19970] Typo of `immediatly` and `agin` words

2013-12-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8e18a3b54bbe by R David Murray in branch '3.3': #19970: Fix some comment typos. http://hg.python.org/cpython/rev/8e18a3b54bbe New changeset 358a35471f9f by R David Murray in branch 'default': Merge: #19970: Fix some comment typos. http://hg.python.o

[issue19970] Typo of `immediatly` and `agin` words

2013-12-13 Thread R. David Murray
R. David Murray added the comment: Thanks, Vajrasky. -- nosy: +r.david.murray resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker ___ __

[issue19933] Round default argument for "ndigits"

2013-12-13 Thread Terry J. Reedy
Terry J. Reedy added the comment: The docstring is better than the current doc as it says that the default precision is 0, without calling that the default for ndigits. ''' round(number[, ndigits]) -> number Round a number to a given precision in decimal digits (default 0 digits).

[issue19953] __iadd__() doc not strictly correct

2013-12-13 Thread Terry J. Reedy
Terry J. Reedy added the comment: The current doc is correct. Unlike the old incorrect version of the operator doc (#7259), it does not say that the call is all of the execution. The suggested replacement "x = x.__iadd__(y) is called" is not correct as statements are not called. The said, it

[issue19954] test_tk floating point exception on my gentoo box with tk 8.6.1

2013-12-13 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- title: test_tk floating point exception on my gentoo box running tk 8.6.1 -> test_tk floating point exception on my gentoo box with tk 8.6.1 ___ Python tracker __

[issue19936] Executable permissions of Python source files

2013-12-13 Thread Tshepang Lekhonkhobe
Changes by Tshepang Lekhonkhobe : -- nosy: +tshepang ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue19956] inspect.getsource(obj.foo) fails when foo is an injected method constructed from another method

2013-12-13 Thread Terry J. Reedy
Terry J. Reedy added the comment: I do not think you have exactly identified a bug, certainly not one we would fix in an existing release. The behavior in more of an unintended consequence of separate decisions resulting from an unanticipated usage. I am not sure what, if anything, should be d

[issue19962] Create a 'python.bat' script to invoke interpreter from source root

2013-12-13 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- nosy: +terry.reedy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue19099] struct.pack fails first time with unicode fmt

2013-12-13 Thread Vajrasky Kok
Vajrasky Kok added the comment: Okay, I think the error message can be improved because in Python 2.7 we differentiate very clearly the string from the unicode. >>> import struct >>> struct.Struct(1) Traceback (most recent call last): File "", line 1, in TypeError: Struct() argument 1 must b

[issue19970] Typo of `immediatly` and `agin` words

2013-12-13 Thread Vajrasky Kok
Vajrasky Kok added the comment: R. David Murray, there is a reason I create separate patches for 3.3 and 3.4. You couldn't just merge them. Python 3.4 has additional file with typo, which is immediatly in Doc/library/asyncio-protocol.rst. :) -- ___

[issue14432] Bug in generator if the generator in created in a temporary C thread

2013-12-13 Thread Nick Coghlan
Nick Coghlan added the comment: Ah, I always forget that frameobject.h isn't included from python.h because none of the names have underscore prefixes. In that case, together with the new note in the porting section, I agree this is fine. -- ___ Pytho

[issue19977] Use "surrogateescape" error handler for sys.stdin and sys.stdout on UNIX for the C locale

2013-12-13 Thread Nick Coghlan
Nick Coghlan added the comment: Getting rid of mojibake was the goal, surrogateescape was about dealing with cases where the "avoid mojibake" checks were spuriously breaking round-tripping between OS APIs due to other configuration errors (with LANG=C being set, or LANG not being set at all be

[issue19846] Python 3 raises Unicode errors with the C locale

2013-12-13 Thread Nick Coghlan
Nick Coghlan added the comment: Thanks Victor - I now agree that trying to guess another encoding is a bad idea, and that enabling surrogateescape for the standard streams under the C locale is a better way to go. -- ___ Python tracker

[issue16355] inspect.getcomments() does not work in the interactive shell

2013-12-13 Thread Vajrasky Kok
Vajrasky Kok added the comment: So, I just found out that imp has been deprecated. Here is the patch that uses importlib.machinery instead of imp.load_source. -- Added file: http://bugs.python.org/file33127/issue16355_v5.diff ___ Python tracker

<    1   2