Change by Malcolm Smith :
--
versions: +Python 3.10
___
Python tracker
<https://bugs.python.org/issue31196>
___
___
Python-bugs-list mailing list
Unsubscribe:
Malcolm Smith added the comment:
I think it's unlikely that anyone is depending on the ability to enter blank
lines in a "try" block in an InteractiveConsole, especially when blank lines
terminate the input in almost every other context.
Conversely, everyone who's ever entered a
Malcolm Smith added the comment:
I agree that both behaviors are reasonable. However, the InteractiveConsole
documentation says it should "closely emulate the behavior of the interactive
Python interpreter". Since people are familiar with the native interpreter, any
difference i
Hi
https://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy also has a numpy wheel
1.19.4+vanilla‑cp39‑cp39‑win_amd64.whl
"Vanilla is a minimal distribution, which does not include any optimized
BLAS libray or C runtime DLLs."
Have not tried this.
cheers
Malcolm
On 30/11/2020 7:1
HI
Just had the same problem.
The solution that worked for me was (
pip uninstall numpy
then
pip install numpy==1.19.3
The latest update to windows has an error in the BLAS libray causing the
error. its a known problem.
hope this helps
Malcolm
On 29/11/2020 10:28 am, Larry Burford
Malcolm Smith added the comment:
> Try for example create/rename .somename.jpg file in Ubuntu.
> It is normal image with .jpg extension. You could open it etc.
>
> You can't use standard python splitext() function to detect extension.
Yes you can (Python 3.8.2):
>>> sp
Is there a difference between the following 2 ways to launch a console-less
script under Windows?
python
Malcolm Smith added the comment:
It's definitely a bug and not a documentation lapse. There's no reason why
blank lines should have that effect, and no indication in the code that this
was intentional.
--
___
Python tracker
<ht
Malcolm Smith added the comment:
It looks like this has now been done and released. Can the issue be closed?
--
nosy: +Malcolm Smith
___
Python tracker
<https://bugs.python.org/issue34
Malcolm Smith added the comment:
This isn't documented, but CDLL(None) is translated to dlopen(NULL), which
"causes a search for a symbol in the main program, followed by all shared
libraries loaded at program startup, and then all shared libraries loaded by
dlopen() with the
appear to
provide support to push/pull files to/from a repo.
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
crypt data in memory before saving
to disk and to read files into memory and decrypt from there using io.BytesIO
streams.
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
Thanks Paul and Dan.
@Paul: Yes, it *IS* a bit confusing . Your pip explanation hit the spot.
@Dan: Yes, symlinks would be a good work around.
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
!
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
Folder
|
+-App INI file
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
behavior by setting a script specific environment
variable or by using a command line switch to point to a different location or
config file.
We store our preferences in an INI style config file which we've found easier
to support when there's problems.
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
Python Cookbook; highly recommended.
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
You may need to update your ODBC driver from version 13 to 17.x.
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
> I am exactly in the "pretty advanced usage": I want to create a zip that
> embed numpy. In this case, I have to bundle the C extension. How can I do
> that?
1. PyInstaller
2. PyOxide (new technology, may or may not support Numpy)
Let us know how you make out.
> I've also taken to having my files auto-formatted with yapf on save ...
@Cameron: Have you considered black at all and if so, what are your thoughts?
Thanks,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
quot;pip" to mean the right
> thing just as "python" does, but maybe something's cached?
I think you're on to something. Running pip as a package (python -m pip) will
force the use of the virtual env copy of pip. Running pip as an application vs
package may use the system
Dave Malcolm added the comment:
I think when I wrote this I was over-optimistically thinking that we could just
add more patterns, but if it's becoming a pain, then your approach looks good
to me.
--
nosy: +dmalcolm
___
Python tracker
<ht
> From: Ed Leafe
> StackOverflow:
> https://stackoverflow.com/questions/25584276/how-to-disable-site-enable-user-site-for-an-environment
Thanks Ed! My takeaway from the above article and our path going forward is to
explictly force ENABLE_USER_SITE to false via Python's "-s&quo
f
python*.exe found via Explorer.
This behavior observed across multiple Windows 2016 Enterprise servers and
Windows 10 Professional desktops.
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
tion: When ENABLE_USER_SITE is true, packages can get accidentally
installed in user specific Python\Python3XX\site-packages folder, overriding
system packages and ... apparently (at least under Windows) ... virtual
environment packages as well.
Thank you,
Malcolm
--
https://mail.python.org/mailma
64-bit Python 3.6.8 running on Windows with a virtual environment activated.
"pip -v" reports 19.0.3
"python -m pip" reports 19.1.1
Is this behavior by design or a bug?
My takeaway is that its better to run "python -m pip ..." vs "pip ..." when
runnin
sts folder or under each package?
4. Use a src folder or not? If so, where to put above files relative to the src
folder?
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
lecting text pausing the running process.
Unchecking the Windows console's Quick Edit mode stops this behavior.
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
sure I'm not
typing random Ctrl+S keystrokes while working.
Thanks again Eryk!
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
of my Python script's control. If
there's a way to disable this behavior under Windows 10/Windows Server 2016,
I'm open to that as well.
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
are launched independent of the
parent (manager) process?
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
env and recreate it again to start with a fresh env
6. reinstall each directly imported module (from list in used-modules.txt);
this will pull in dependencies again
7. pip freeze > requirements.txt <--- this should be the exact modules used by
our code
Thank you,
Malcolm
--
https://mail.p
nv6. reinstall each directly imported
module (from list in used-
modules.txt); this will pull in dependencies again7. pip freeze >
requirements.txt <--- this should be the exact modules
used by our code
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
Software, licensed under the GPLv3 or later.
Enjoy!
Dave Malcolm
--
https://mail.python.org/mailman/listinfo/python-announce-list
Support the Python Software Foundation:
http://www.python.org/psf/donations/
Any recommendations on normalizing path strings in cross platform
(Windows, Linux, macOS) for unit tests?
Our goal is to normalize path strings to use forward slash separators so
that we can consistently reference path strings in our unit tests in a
cross platform way.
Example: Under Windows we
specific issues to be concerned with or is there a general
pattern here? I work across Windows, Linux, and macOS.
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
Malcolm Smith added the comment:
Please reopen this issue. The distutils2 project has now been abandoned, so
that's no longer a justification for taking no action.
At the very least, the documentation should be fixed to either warn about this
surprising behavior, or make it clear
I have a class method that adds additional context to many of the
class's log messages. Rather than calling, for example, logger.info(
'message ...' ) I would like to call my_object.log( 'message ...' ) so
that this additional context is managed in a single place. I'm actually
doing that and its
Curious to learn what Python related git pre-commit hooks people are
using? What hooks have you found useful and which hooks have you tried
and abandoned? Appreciate any suggestions for those new to this process.
Background: Window, macOS, and Linux dev environments, PyCharm professional
edition
Curious to hear if any of you are running Python scripts/apps on MS
Azure cloud services? What services are you using and what has your
experience been? Advice?
Background: Customer migrating to Azure. I'm trying to get ahead of the curve
regarding how Python-friendly the Azure platform is.
Dave Malcolm added the comment:
Thanks!
--
___
Python tracker
<https://bugs.python.org/issue9263>
___
___
Python-bugs-list mailing list
Unsubscribe:
Is there a technique that would allow a script to verify its
requirements.txt file before it runs? Use case: To detect unexpected
changes to a script's runtime environment. Does the pip module expose
any methods for this type of task?
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo
outputting module name and line number so I can always go back and
double check a caller's location in source, but that seems like an
archaic way to find this type of information.
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
temporary files,
named sockets/pipes, etc. Is there any consensus on best practice here? Thank
you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
temporary files, named sockets/pipes, etc. Is there
any consensus on best practice here?
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
Thanks for the replies! I'm going to investigate the use of python-gnupg [1]
which is a Python wrapper for the GPG command line utility. This library is
based on gpg.py written by Andrew Kuchling. I'm all ears if f anyone has any
alternative recommendations or python-gnupg tips to share. BTW:
Is there a benefit to using one of these techniques over the other?
Is one approach more Pythonic and preferred over the other for
style reasons?
message = message.encode('UTF-8')
message = bytes(message, 'UTF-8')
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
e SSH keys for verification
Any suggestions on techniques and/or libraries appreciated.
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
On 28/08/2018 7:09 AM, John Pote wrote:
On 26/08/2018 00:55, Malcolm wrote:
I am trying to understand why regex is not extracting all of the
characters between two delimiters.
The complete string is the xmp IFD data extracted from a .CR2 image
file.
I do have a work around, but it's messy
I am trying to understand why regex is not extracting all of the
characters between two delimiters.
The complete string is the xmp IFD data extracted from a .CR2 image file.
I do have a work around, but it's messy and possibly not future proof.
Any insight greatly appreciated.
Malcolm
My
Thanks to everyone who contributed to this thread. Great feedback and
suggestions! - Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
> You might try:
> from getopt import getopt
> or the (apparently newer):
> from optparse import OptionParser
Thanks Mike. My question was trying to make a distinction between Python
options (flags that precede the script or module name) and arguments (the
script specific values passed on the
values
via a single environment variable (something like PYTHONOPTIONS) vs individual
environment variables.
Thank you
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
having these
options confused with command line arguments?
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
,
recommendations, etc.
Thanks!
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
Malcolm Smith added the comment:
FYI: I have created issue 33689 for the non-Windows-specific issue.
--
___
Python tracker
<https://bugs.python.org/issue29
New submission from Malcolm Smith :
The `site` module documentation says that in .pth files, "Blank lines and lines
beginning with # are skipped.". However, the implementation does not actually
skip blank lines. It then joins the empty string to the site-packages
directory,
Malcolm Smith added the comment:
> I'm not aware of any such issue with .pth files - the underscore in ._pth is
> deliberate.
An identical issue *does* exist for .pth files. As you can see from examining
site.addpackage, it does not ignore blank lines as the documentation says.
A
, licensed under the GPLv3 or
later.
Enjoy!
Dave Malcolm
--
https://mail.python.org/mailman/listinfo/python-announce-list
Support the Python Software Foundation:
http://www.python.org/psf/donations/
We're using virtual environments with Python 3.6. Since all our pip
installed modules are in our environment's local site-packages folder,
is the distribution of a virtual environment as simple as recursively
zipping the environment's root folder and distributing that archive to
another machine
> Perhaps it doesn't need to be said, but just to be sure: don't use eval if
> you don't trust the people writing the configuration file. They can do nearly
> unlimited damage to your environment. They are writing code that you are
> running.
Of course! Script and config file are running in
Looking for your suggestions on best practice techniques for managing
secrets used by Python daemon scripts. Use case is Windows scripts
running as NT Services, but interested in Linux options as well.
Here's what we're considering
1. Storing secrets in environment vars
2. Storing secrets in
My original post reformatted for text mode:
Looking for advice on how to expand f-string literal strings whose values I'm
reading from a configuration file vs hard coding into
my script as statements. I'm using f-strings as a very simple template language.
I'm currently using the following
Looking for advice on how to expand f-string literal strings whose
values I'm reading from a configuration file vs hard coding into
my script as statements. I'm using f-strings as a very simple
template language.
I'm currently using the following technique to expand these f-strings.
Is there a
Dave Malcolm <dmalc...@redhat.com> added the comment:
On Fri, 2018-02-23 at 00:16 +, Cheryl Sabella wrote:
> Cheryl Sabella <chek...@gmail.com> added the comment:
>
> Did PEP553 make this issue obsolete?
I *think* they have slightly different scope: if I'm reading it r
New submission from Malcolm Smith <malcolm.sm...@gmail.com>:
At some point the Python 3 documentation of str.join has been copied to Python
2. This includes the sentence "A TypeError will be raised if there are any
non-string values in iterable, including bytes objects."
Malcolm Smith <malcolm.sm...@gmail.com> added the comment:
Related: Issue15795
--
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python
New submission from Malcolm Smith <malcolm.sm...@gmail.com>:
The documentation explicitly says "file information is extracted as accurately
as possible". But the `zipfile` module doesn't actually extract any metadata at
all. I assume this text was copied and pasted from the
Dave Malcolm added the comment:
The problem is that there are so many variables:
* which version of which compiler
* optimization flags
* which version of gdb
* which CPU architecture
etc (and the compiler and/or gdb could be carrying patches from downstream
distributors...)
All of these can
New submission from Malcolm Smith:
The standard interpreter is more eager to give an error on incomplete input,
while the InteractiveConsole will keep on prompting for more:
Python 3.5.3 (default, Apr 10 2017, 07:53:16) [GCC 6.3.0 64 bit (AMD64)] on
win32
Type "help", "copyr
Malcolm Smith added the comment:
I agree that the first two paragraphs are confusing. It's clearly not true to
say "The search order is same as that used by getattr() except that the type
itself is skipped", because as noted above, everything *earlier* than the type
in the MRO is al
Changes by Malcolm Smith <malcolm.sm...@gmail.com>:
--
nosy: +Malcolm Smith
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15360>
___
New submission from Malcolm Smith:
https://docs.python.org/3/reference/simple_stmts.html#the-import-statement
defers the full specification of relative imports to PEP 328. PEP 328 gives the
example "from ...sys import path" in a second-level package, and notes "while
that las
Thank you Peter and Jussi - both your solutions were very helpful!
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
in enumerate( some_iterable, max_count=10 ):
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
New submission from Malcolm Smith:
https://docs.python.org/3.6/reference/executionmodel.html#builtins-and-restricted-execution
describes the various things you can do with __builtins__, but then says
"Users should not touch __builtins__; it is strictly an implementation detail."
If
? Are there any 3rd party libraries that monitor CPU/core
and memory utilization to dynamically tune these values based on
system capacity?
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
keys to
sets and compare these sets to determine which keys are unique and can
be merged and which keys are dupes and should be tracked in that manner.
At a high level, does this sound like a reasonable approach?
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
Another endorsement for Webfaction.
--
https://mail.python.org/mailman/listinfo/python-list
Looking for a quick way to calculate lines of code/comments in a
collection of Python scripts. This isn't a LOC per day per developer
type analysis - I'm looking for a metric to quickly judge the complexity
of a set of scripts I'm inheriting.
Thank you,
Malcolm
--
https://mail.python.org/mailman
ous to me :)
Packaging and distributing Python scripts as zipped archives is such a
powerful feature I'm surprised that there hasn't been more written on
this topic.
Thank you for sharing these tips with me and the rest of the Python list
community !!
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
Oscar/MRAB,
> You could put something between the file and the reader ...
Thank you both for your suggestions ... brilliant! You guys helped me
solve my problem and gave me an excellent strategy for future scenarios.
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
by this object. I would like to log
the actual line read by the CSVDictReader, not the processed data
returned in the dict.
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
Hi Paul,
WOW!:)
I really appreciate the detailed response. You answered all my
questions. I'm looking forward to testing out your pylaunch wrapper.
Thank you very much!
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
these embedded files (by opening up the zipapp as a zip
archive and navigating from there?).
Thank you,
Malcolm
[1] The zipapp feature of Python 3.5 is pretty cool: It allows you to
package your Python scripts in a single executable zip file. This
isn't a replacement for tools like
also be run as a script, giving the filename of a Python script as its
argument, after which a report of the imported modules will be printed.
https://docs.python.org/3.5/library/modulefinder.html
Note there's a similar module for Python 2.7.
--
Malcolm
--
https://mail.python.org/mailman
and "from import ...". I know I could write a
script to do this, but certainly there must be such a capability in the
standard library?
Use case: Discovering list of modules to use for building a Python 3.5
zipapp distributable.
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
Ned and Random832,
Ned: Thank you - your example answered my question.
Random832: Thank you for the reminder about "from import
" still importing the module. Yes, I had forgotten that behavior.
Best,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
Python 3.5: Is there a way to dynamically import specific names from a
module vs importing the full module?
By dynamic I mean via some form of importlib machinery, eg. I'm looking
for the dynamic "from import " equivalent of "import
"'s importlib.import_module.
Thank yo
= value.replace(match, '', 1).strip()
while value.endswith(match):
value = value[0:len(value) - len(match)].strip()
# BOILERPLATE: update the value we just transformed
self.data[self.rule.target_column] = value
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
error handler
import codecs
def custom_unicode_error_handler(e):
bad_bytes = e.object[e.start:e.end]
print( 'Bad bytes: ' + bad_bytes.hex())
return ('', e.end)
codecs.register_error('custom_unicode_error_handler',
custom_unicode_error_handler)
Malcolm
--
https://mail.python.org
is to count the total number of UnicodeExceptions within a file
(as a data quality metric) and track the frequency of specific bad
code's (via a collections.counter dict) to see if there's a pattern that
can be traced to bad upstream process.
Malcolm
Remove them? Not sure what you mean, exactly
decoded so I can pass this line on to the CSV reader. At a high
level it seems that I need to wrap the decoding of a line until it
passes with out any errors. Any suggestions appreciated.
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
> You could use win_unicode_console enabled in sitecustomize or usercustomize.
> https://pypi.python.org/pypi/win_unicode_console
The pypi link you shared has an excellent summary of the issues
associated when working Unicode from the Windows terminal.
Thank you Eryk.
Malcolm
--
Chris,
> Don't forget that the print function can simply be shadowed.
I did forget! Another excellent option. Thank you!
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
.
Malcolm
[1] PYTHONIOENCODING=ascii:backslashreplace
--
https://mail.python.org/mailman/listinfo/python-list
a
specific way?
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
Thank you Laurent!
- Original message -
From: Laurent Pointal
With __name__ you will have one logger per source file (module), with
corresponding filtering possibilities, and organized hierarchically as
are
packages (logging use . to built its loggers
Hi Eryk,
Awesome! Thank you very much for your detailed answer!!
Malcolm
Linux has the O_TMPFILE open() flag [1]. This creates an anonymous file
that gets automatically deleted when the last open file descriptor is
closed. If the file isn't opened O_EXCL, then you can make it permanent
1 - 100 of 583 matches
Mail list logo