Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text replace on Windows broken #997

Closed
ilanschnell opened this issue Jun 4, 2016 · 7 comments · Fixed by #1008
Closed

Text replace on Windows broken #997

ilanschnell opened this issue Jun 4, 2016 · 7 comments · Fixed by #1008
Labels
locked [bot] locked due to inactivity type::bug describes erroneous operation, use severity::* to classify the type

Comments

@ilanschnell
Copy link
Contributor

ilanschnell commented Jun 4, 2016

After building numexpr using conda-build (using this recipe https://github.com/ContinuumIO/anaconda-recipes/tree/master/numexpr), a user reported:

[testing] C:\Users\palm\Documents\antony\src\ipython>python -c "import numexpr"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\palm\Miniconda3\envs\testing\lib\site-packages\numexpr\__init__
.py", line 24, in <module>
    from .__config__ import show as show_config, get_info
  File "C:\Users\palm\Miniconda3\envs\testing\lib\site-packages\numexpr\__config
__.py", line 5
    mkl_info={'library_dirs': ['C:\Users\palm\Miniconda3\envs\testing\\Library\\
lib'], 'define_macros': [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)], 'librarie
s': ['mkl_sequential_dll', 'mkl_core_dll', 'mkl_intel_lp64_dll', 'mkl_intel_thre
ad_dll'], 'include_dirs': ['C:\Users\palm\Miniconda3\envs\testing\\Library\\incl
ude']}
                              ^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in positio
n 2-3: truncated \UXXXXXXXX escape

Something strange is happening with the text replacement here. The numexpr conda package we are talking about is: http://repo.continuum.io/pkgs/free/win-64/numexpr-2.6.0-np110py35_0.tar.bz2
It contains info/has_prefix, with:

"C:\\Minonda\\envs\\_build" text "Lib/site-packages/numexpr/__config__.py"

Something regarding the \'s is wrong here. I'm not sure if the bug is in conda-build or conda.
Originally, numexpr has always been built using the internal Anaconda system, which by default would never create info/has_prefix on Windows.

CC @msarahan

@ilanschnell ilanschnell added the type::bug describes erroneous operation, use severity::* to classify the type label Jun 4, 2016
@ilanschnell
Copy link
Contributor Author

Ah, and the reason this wasn't caught using testing is because my prefix is C:\Minonda\envs\..., but
when you install the package into C:\Users (which contains \U) the wrong escaping strikes!

@msarahan
Copy link
Contributor

msarahan commented Jun 4, 2016

In the package you linked to, the contents of Lib/site-packages/numexpr/__config__.py seem to be escaped properly. I think this bug might lie in conda's manipulation of that path when installing the package.

However, I want to know more about why you say you'd never create has_prefix on Windows - how would you fix the paths in these files? What would make has_prefix unnecessary?

@msarahan
Copy link
Contributor

msarahan commented Jun 4, 2016

CC @kalefranz - should we move this one to conda?

@ilanschnell
Copy link
Contributor Author

On Windows, info/has_prefix files have never been necessary as far as Anaconda is concerned.
It would be nice to have a no_has_prefix option in meta.yaml, then I could fix the problem by adding:

build:
  no_has_prefix: True              [win]

I will inspect other new Windows packages which have been created using conda recipes, to see if they contain info/has_prefix, and if that might cause problems.

@msarahan
Copy link
Contributor

msarahan commented Jun 5, 2016

OK, but how does that __config__.py get handled with your build system? It seems to have important paths in it that need to be reconfigured on end users' systems. Is that true, or am I missing something?

@ilanschnell
Copy link
Contributor Author

__config__.py didn't get handled in the Anaconda build system. I'm not sure what the __config__.py file is used for, but it never caused any problems not having it updated upon install.

@github-actions
Copy link

Hi there, thank you for your contribution!

This issue has been automatically locked because it has not had recent activity after being closed.

Please open a new issue if needed.

Thanks!

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Apr 22, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity type::bug describes erroneous operation, use severity::* to classify the type
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants